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=419&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 4574 results for "api"(525ms)

LlmDashboardllm-provider-gemini3 matches

@prashamtrivedi•Updated 2 months ago
123
124 // Note: This is a placeholder as Val Town doesn't have a native Google AI client
125 // Would need to implement actual API call here
126 const response = await fetch(
127 "https://generativelanguage.googleapis.com/v1beta/models/" + model.id + ":generateContent",
128 {
129 method: "POST",
130 headers: {
131 "Content-Type": "application/json",
132 "x-goog-api-key": Deno.env.get("GOOGLE_API_KEY") || "",
133 },
134 body: JSON.stringify({

LlmDashboardllm-provider-anthropic3 matches

@prashamtrivedi•Updated 2 months ago
111
112 // Note: This is a placeholder as Val Town doesn't have a native Anthropic client
113 // Would need to implement actual API call here
114 const response = await fetch("https://api.anthropic.com/v1/messages", {
115 method: "POST",
116 headers: {
117 "Content-Type": "application/json",
118 "x-api-key": Deno.env.get("ANTHROPIC_API_KEY") || "",
119 "anthropic-version": "2023-06-01",
120 },

LlmDashboardllm-provider-openai3 matches

@prashamtrivedi•Updated 2 months ago
167 };
168 } catch (error) {
169 throw new Error(`OpenAI API error: ${error.message}`);
170 }
171 }
223 };
224 } catch (error) {
225 throw new Error(`OpenAI API error: ${error.message}`);
226 }
227 }
282 }
283 } catch (error) {
284 throw new Error(`OpenAI API error: ${error.message}`);
285 }
286 }

valentines_day_card_generatorfrontend_card4 matches

@shouser•Updated 2 months ago
43 if (valentineName.trim()) {
44 const fullText = `happy valentine's day ${valentineName.trim()}`;
45 // Convert to array of characters, then randomly capitalize ~1/3
46 const chars = fullText.toLowerCase().split('');
47 const numToCapitalize = Math.floor(chars.length / 3);
48 const positions = new Set();
49
50 while (positions.size < numToCapitalize) {
51 positions.add(Math.floor(Math.random() * chars.length));
52 }
76 height: "100vh",
77 width: "100vw",
78 backgroundImage: "url('https://shouser-blob_admin.web.val.run/api/public/pink_gradient_background.jpg')",
79 backgroundSize: "cover",
80 backgroundPosition: "center",
22 height: 100vh;
23 width: 100vw;
24 background-image: url('https://shouser-blob_admin.web.val.run/api/public/pink_gradient_background.jpg');
25 background-size: cover;
26 background-position: center;

valentines_day_card_generatorimage_uploader1 match

@shouser•Updated 2 months ago
199
200 // Construct a public URL
201 const publicUrl = `https://shouser-blob_admin.web.val.run/api/public/${filename}`;
202
203 // Save metadata to SQLite

spectacularBlackParrotREADME.md3 matches

@charmaine•Updated 2 months ago
21To run it:
22
231. Get your free Steel API key at https://app.steel.dev/settings/api-keys
242. Add it to your [Val Town Environment Variables](https://www.val.town/settings/environment-variables) as `STEEL_API_KEY`
253. Click `Fork` on this val
264. Click `Run` on this val
72
73- [Steel Documentation](https://docs.steel.dev)
74- [API Reference](https://docs.steel.dev/api-reference)
75- [Discord Community](https://discord.gg/gPpvhNvc5R)

spectacularBlackParrotmain.tsx4 matches

@charmaine•Updated 2 months ago
6});
7
8const STEEL_API_KEY = process.env.STEEL_API_KEY;
9// Initialize Steel client with the API key from environment variables
10const client = new Steel({
11 steelAPIKey: STEEL_API_KEY,
12});
13
36 // Connect Puppeteer to the Steel session
37 browser = await puppeteer.connect({
38 browserWSEndpoint: `wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
39 });
40

utilitiesreadme.md2 matches

@nbbaier•Updated 2 months ago
3## Fetch Paginated Data
4
5This val exports a function that loops through paginated API responses and returns the combined data as an array. It expects pagination with `next` and there to be a `data` property in the API response. This conforms to the Val Town API, so this function is useful when fetching paginated Val Town API responses for creating custom folders in [pomdtr's vscode extension](https://github.com/pomdtr/valtown-vscode).
6
7Usage:
9```ts
10const id = <vt user id>
11await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
12 headers: { Authorization: `Bearer ${Deno.env.get("valtown")}` },
13});

SideProjectSaturdayemail.ts1 match

@zeko•Updated 2 months ago
1import { Resend } from "resend";
2
3const resend = new Resend(Deno.env.get("RESEND_API_KEY"));
4
5// resend.emails.send({

PassphraseAPI2 file matches

@wolf•Updated 1 day ago

openapi2 file matches

@stevekrouse•Updated 4 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)