Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=api&page=1004&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 12539 results for "api"(2019ms)

extractImportsmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import ts from "npm:typescript";
3

manifold_daily_loan_collectormain.tsx2 matches

@jackc•Updated 1 year ago
1export default async function() {
2 const res = await fetch("https://api.manifold.markets/request-loan", {
3 headers: {
4 Authorization: `Key ${Deno.env.get("manifoldApiKey")}`,
5 },
6 });

manifold_daily_loan_collectorREADME.md2 matches

@jackc•Updated 1 year ago
3Instructions:
41. Fork this Val.
52. Get your Manifold API key [from your profile](https://manifold.markets/profile).
63. Add `manifoldApiKey` with your key to the [Val Environment Variables](https://www.val.town/settings/environment-variables).
74. Hit run! It will run daily to collect your loans.

valtownToSQLitemain.tsx1 match

@postpostscript•Updated 1 year ago
60export async function valtownToSQLite(options: { sqlite: SqliteInterface } = { sqlite }) {
61 await options.sqlite.execute(createQuery);
62 let url = "https://api.val.town/v1/search/vals?query=%20&limit=100";
63 while (true) {
64 const resp = await fetch(url);

createmain.tsx1 match

@websandbox•Updated 1 year ago
1export async function create({ code, token }: { code: string; token: string }) {
2 const { error, details, url } = await (await fetch("https://websandbox-createAPI.web.val.run", {
3 body: JSON.stringify({ code, token }),
4 method: "POST",

createAPIREADME.md1 match

@websandbox•Updated 1 year ago
1Migrated from folder: real/createAPI

blogSqliteUniverseREADME.md4 matches

@postpostscript•Updated 1 year ago
6### Val Town-Hosted SQLite
7
8[Val Town](https://val.town/) hosts SQLite as part of its standard library ([@std/sqlite](https://val.town/v/std/sqlite)). This makes a fetch request against their closed-source API (using your API token) which returns results in a consistent format. This is great because you can host your own endpoints that work similarly, and _reuse code that was only designed in mind for that original hosted interface_
9
10The standard format (abridged to important fields):
161import { sqliteUniverseWithOptions, patterns, defaultPatterns } from "https://esm.town/v/postpostscript/sqliteUniverse";
162import { createSqlite } from "https://esm.town/v/postpostscript/sqliteWasm";
163import { sqliteFromAPI } from "https://esm.town/v/postpostscript/sqliteFromAPI";
164import { Statement } from "https://esm.town/v/postpostscript/sqliteBuilder";
165
185 /^~\/(\w+)/,
186 ({ endpoint, tables, match }) => {
187 return sqliteFromAPI(`@postpostscript/${match[1]}`)
188 },
189 ]
192 fallback({ endpoint, tables }) {
193 // if an endpoint is not found, this will be called
194 return sqliteFromAPI(`@postpostscript/sqlitePublic`)
195 },
196 },

aqiREADME.md1 match

@ProgStudio•Updated 1 year ago
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12

cdnREADME.md1 match

@pomdtr•Updated 1 year ago
23### Fetching private val
24
25Pass an api token as an username
26
27```console

readmemain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { gfm } from "https://esm.town/v/pomdtr/gfm";
3
16
17export async function readme(author: string, name: string) {
18 const { readme } = await api(`/v1/alias/${author}/${name}`);
19 return readme;
20}

vapi-minutes-db2 file matches

@henrywilliams•Updated 11 hours ago

social_data_api_project3 file matches

@tsuchi_ya•Updated 3 days ago
snartapi
papimark21