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/?q=api&page=815&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 10974 results for "api"(1507ms)

dailyDadJokemain.tsx1 match

@zhanziyang•Updated 11 months ago
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

dubLinkMakerREADME.md1 match

@mux•Updated 11 months ago
81. Set up a Slack bot/app and have the webhooks point at your forked Val
91. Add the following environment variables to Val.town:
10 - `DUB_API_KEY` your [Dub](https://dub.co) API key
11 - `DUB_WORKSPACE_ID` your Dub workspace ID
12 - `SLACK_MUX_LINK_SIGNING_SECRET` Signing secret for the app you created

translatormain.tsx4 matches

@stevekrouse•Updated 11 months ago
6
7const app = new Hono();
8const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
9
10class TranscriptionService {
19 return transcription;
20 } catch (error) {
21 console.error("OpenAI API error:", error);
22 throw error;
23 }
423 return c.text(translation);
424 } catch (error) {
425 console.error("OpenAI API error:", error);
426 return c.text("Error occurred during translation", 500);
427 }
450 });
451 } catch (error) {
452 console.error("OpenAI API error:", error);
453 return c.text("Error occurred during speech generation", 500);
454 }

translatorREADME.md1 match

@stevekrouse•Updated 11 months ago
3The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk.
4
5Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
6
7Migrated from folder: Archive/translator

homelessmain.tsx3 matches

@cameronpak•Updated 11 months ago
16 "protocol": "https", // For Typesense Cloud use https
17 }],
18 "apiKey": Deno.env.get("TYPESENSE_API_KEY") || "",
19 "connectionTimeoutSeconds": 10,
20 "retryIntervalSeconds": 0.1,
136 "q": query,
137 "query_by": queryBy || "*",
138 "per_page": 250, // The max number of resources to return is 250 — https://typesense.org/docs/0.25.1/api/search.html#ranking-and-sorting-parameters
139 "filter_by": filterBy || filterByRadius,
140 "sort_by": `location(${lat}, ${lng}):asc`,
215);
216
217app.get("/", (c) => c.text("Welcome to the Homeless Services API"));
218app.get("/resources", async (c) => {
219 console.log(c.req.header);

valwritermain.tsx1 match

@stevekrouse•Updated 11 months ago
106 console.log(result.rows[0]);
107
108 // Blob storage API
109 import { blob } from "https://esm.town/v/std/blob";
110 const key = "blob_test";

blob_adminREADME.md1 match

@iamseeley•Updated 11 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

createValmain.tsx1 match

@stevekrouse•Updated 11 months ago
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),
34 method: "PUT",

lastFmNowPlayingmain.tsx1 match

@fossforlife•Updated 11 months ago
1import LastFm from "npm:lastfm-node-client";
2
3const lastFm = new LastFm(Deno.env.get("LASTFM_API_KEY"));
4const data = await lastFm.userGetRecentTracks({
5 user: "elias-jackson2",

frontmattermain.tsx2 matches

@pomdtr•Updated 11 months ago
1import { api } from "https://esm.town/v/pomdtr/api";
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3import { parse } from "jsr:@std/yaml";
24
25export async function extractValFrontmatter(val: { author: string; name: string }) {
26 const { readme } = await api<{ readme: string }>(`/v1/alias/${val.author}/${val.name}`);
27 return extractFrontmatter(readme);
28}

daily-advice-app1 file match

@dcm31•Updated 2 days ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 3 days ago
apiv1
papimark21