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/$2?q=api&page=1432&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 17539 results for "api"(4814ms)

VALLErunmain.tsx5 matches

@roadlabs•Updated 10 months ago
32 Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
33 Start your response with a comment explaining how your approach will work, what libraries or
34 API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
35 the simplest way to achieve the goal, though you can add some inline comments to explain your
36 reasoning (not for every line, but for major groups of lines). Don't use any environment variables
37 unless strictly necessary, for example use APIs that don't require a key, prefer internal function
38 imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
39 functions where possible. Unless specified, don't add error handling,
40 make sure that errors bubble up to the caller.
41 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
42 not practical for the user's request (e.g. if they ask for a particular animated gif).
43 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
44 explicitly specified otherwise. Use the current val name for the storage key, which you can get
45 using the "pomdtr/extractValInfo" val, which you can call like this:
430 const tempValName = `valle_tmp_${Math.random() * 10}`.replaceAll(".", "");
431 const newCode = tokens.join("").replaceAll("```ts", "").replaceAll("```", "").replace(/^ts\n/, "");
432 // Errors in running the val bubble up through this API, so ignore them.
433 await vt.vals.create({ name: tempValName, code: newCode, type: "httpnext" as any, privacy: "unlisted" }).catch(
434 (error) => {

glideImportDemomain.tsx4 matches

@dvdsgl•Updated 10 months ago
5import * as Glide from "https://esm.town/v/dvdsgl/glide?v=661";
6
7// 2. Add an environment variable named "glide" with your Glide API
8// token.
9//
14const table = "replace-me-abc123-xyz456";
15
16// 4. Implement row fetching using an API or a library:
17//
18// For example, you could call an API in a loop, using yield for each
19// batch of rows to import.
20async function* getRows() {
31// 5. Run the import.
32//
33// Warning: This API will completely replace the contents and columns
34// of the target table.
35await Glide.importTable({ table, getRows });

glidemain.tsx5 matches

@dvdsgl•Updated 10 months ago
4import { v4 as uuidv4 } from "npm:uuid";
5
6const baseUrl = `https://api.glideapps.com`;
7
8type Stash = { $stashID: string };
48}
49
50// Handles calling fetch, checking for API errors
51function fetchGlide<A>(
52 method: "GET" | "POST" | "PUT",
91): Effect.Effect<PutResult, GlideError> =>
92 Effect.gen(function*() {
93 // Some tables have a prefix, e.g. "native-table-" but this API
94 // does not accept it.
95 id = id.replace("native-table-", "");
127 return { $stashID: id };
128 }).pipe(
129 // Sometimes the API just fails
130 Effect.retry({ times: 3 }),
131 );
161 const stream = Stream.fromAsyncIterable(
162 // We buffer the rows into larger chunks
163 // because many APIs only fetch small chunks (e.g. 100)
164 // records at a time.
165 bufferAsyncIterable(getRows()),

azureCheetahmain.tsx5 matches

@tmcw•Updated 10 months ago
35 Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
36 Start your response with a comment explaining how your approach will work, what libraries or
37 API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
38 the simplest way to achieve the goal, though you can add some inline comments to explain your
39 reasoning (not for every line, but for major groups of lines). Don't use any environment variables
40 unless strictly necessary, for example use APIs that don't require a key, prefer internal function
41 imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
42 functions where possible. Unless specified, don't add error handling,
43 make sure that errors bubble up to the caller.
44 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
45 not practical for the user's request (e.g. if they ask for a particular animated gif).
46 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
47 explicitly specified otherwise. Use the current val name for the storage key, which you can get
48 using the "pomdtr/extractValInfo" val, which you can call like this:
422 const tempValName = `valle_tmp_${Math.random() * 10}`.replaceAll(".", "");
423 const newCode = tokens.join("").replaceAll("```ts", "").replaceAll("```", "").replace(/^ts\n/, "");
424 // Errors in running the val bubble up through this API, so ignore them.
425 await vt.vals.create({ name: tempValName, code: newCode, type: "httpnext" as any, privacy: "unlisted" }).catch(
426 (error) => {

VALLErunmain.tsx5 matches

@tmcw•Updated 10 months ago
35 Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
36 Start your response with a comment explaining how your approach will work, what libraries or
37 API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
38 the simplest way to achieve the goal, though you can add some inline comments to explain your
39 reasoning (not for every line, but for major groups of lines). Don't use any environment variables
40 unless strictly necessary, for example use APIs that don't require a key, prefer internal function
41 imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
42 functions where possible. Unless specified, don't add error handling,
43 make sure that errors bubble up to the caller.
44 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
45 not practical for the user's request (e.g. if they ask for a particular animated gif).
46 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
47 explicitly specified otherwise. Use the current val name for the storage key, which you can get
48 using the "pomdtr/extractValInfo" val, which you can call like this:
422 const tempValName = `valle-tmp-${Math.random() * 10}`.replaceAll(".", "");
423 const newCode = tokens.join("").replaceAll("```ts", "").replaceAll("```", "").replace(/^ts\n/, "");
424 // Errors in running the val bubble up through this API, so ignore them.
425 await vt.vals.create({ name: tempValName, code: newCode, type: "httpnext" as any, privacy: "unlisted" }).catch(
426 (error) => {

subaudioREADME.md1 match

@kortina•Updated 10 months ago
3Speech-to-text and chapter summaries powered by [Substrate](https://substrate.run)
4
5🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits

subaudiomain.tsx2 matches

@kortina•Updated 10 months ago
23
24async function processAudio(audio_uri) {
25 const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
26 const opts = { cache_age: 60 * 60 * 24 * 7 };
27
103 <link rel="icon" href="https://www.substrate.run/favicon.ico" type="image/x-icon">
104 <link
105 href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap"
106 rel="stylesheet"
107 />

VALLEREADME.md3 matches

@tmcw•Updated 10 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

crypto_prices_infomain.tsx4 matches

@ghsaboias•Updated 10 months ago
1const TELEGRAM_CHAT_ID = Deno.env.get("TELEGRAM_CHAT_ID");
2const TELEGRAM_TOKEN = Deno.env.get("TELEGRAM_TOKEN");
3const COINGECKO_API_KEY = Deno.env.get("COINGECKO_API_KEY");
4
5const getCryptoPrices = async () => {
6 const response = await fetch(
7 "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin,ethereum,dogecoin,solana,binancecoin,ripple,pepe",
8 {
9 headers: {
10 "accept": "application/json",
11 "x-cg-demo-api-key": COINGECKO_API_KEY,
12 },
13 },
51const sendTextWithTelegram = async (text) => {
52 const telegramSendUrl =
53 `https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage?chat_id=${TELEGRAM_CHAT_ID}&parse_mode=HTML&disable_notification=true&text=${text}`;
54 await fetch(telegramSendUrl);
55};

sqliteExplorerAppREADME.md1 match

@nickgolden•Updated 10 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

RandomQuoteAPI

@Freelzy•Updated 18 hours ago

HAPI7 file matches

@dIgitalfulus•Updated 1 day ago
Kapil01
apiv1