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=1&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 4127 results for "api"(661ms)

MyStevensREADME.md1 match

@billogiovanni•Updated 18 mins ago
53You'll need to set up some environment variables to make it run.
54
55- `ANTHROPIC_API_KEY` for LLM calls
56- You'll need to follow [these instructions](https://docs.val.town/integrations/telegram/) to make a telegram bot, and set `TELEGRAM_TOKEN`. You'll also need to get a `TELEGRAM_CHAT_ID` in order to have the bot remember chat contents.
57- For the Google Calendar integration you'll need `GOOGLE_CALENDAR_ACCOUNT_ID` and `GOOGLE_CALENDAR_CALENDAR_ID`. See [these instuctions](https://www.val.town/v/stevekrouse/pipedream) for details.

myNewWebsiteindex.ts2 matches

@billogiovanni•Updated 50 mins ago
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
13
14// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
16
17// Unwrap and rethrow Hono errors as the original error

JimeluStevenssendDailyBrief.ts8 matches

@luke_f•Updated 2 hours ago
91
92export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
93 // Get API keys from environment
94 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
95 const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
96
100 }
101
102 if (!apiKey) {
103 console.error("Anthropic API key is not configured.");
104 return;
105 }
116
117 // Initialize Anthropic client
118 const anthropic = new Anthropic({ apiKey });
119
120 // Initialize Telegram bot
156
157 // disabled title for now, it seemes unnecessary...
158 // await bot.api.sendMessage(chatId, `*${title}*`, { parse_mode: "Markdown" });
159
160 // Then send the main content
163
164 if (content.length <= MAX_LENGTH) {
165 await bot.api.sendMessage(chatId, content, { parse_mode: "Markdown" });
166 // Store the briefing in chat history
167 await storeChatMessage(
192 // Send each chunk as a separate message and store in chat history
193 for (const chunk of chunks) {
194 await bot.api.sendMessage(chatId, chunk, { parse_mode: "Markdown" });
195 // Store each chunk in chat history
196 await storeChatMessage(

JimeluStevenshandleUSPSEmail.ts5 matches

@luke_f•Updated 2 hours ago
86 console.log(e.text);
87
88 // Get Anthropic API key from environment
89 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
90 if (!apiKey) {
91 console.error("Anthropic API key is not configured for this val.");
92 return;
93 }
94
95 // Initialize Anthropic client
96 const anthropic = new Anthropic({ apiKey });
97
98 // Process each image attachment serially

CTGBreakerindex.tsx2 matches

@horsefacts•Updated 4 hours ago
19 }));
20
21app.get("/api/counter/get", async c => c.json(await db.get("counter")));
22app.get("/api/counter/increment", async c => c.json(await db.set("counter", (await db.get("counter") || 0) + 1)));
23
24app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));

my-first-valtest4 matches

@bugraipek•Updated 5 hours ago
27 }}
28 >
29 <h1>🎲 Rastgele Cümle API'si</h1>
30 <p>Bu API her çağrıda farklı bir cümle döndürür.</p>
31 <a
32 href={import.meta.url.replace("esm.town", "val.town")}
57 <html>
58 <head>
59 <title>Rastgele Cümle API'si</title>
60 <meta charset="UTF-8" />
61 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
88 headers: {
89 "content-type": "application/json",
90 "Access-Control-Allow-Origin": "*", // Enable CORS for broad API access
91 },
92 },

CTGBreakerimage.tsx3 matches

@horsefacts•Updated 5 hours ago
75
76const loadEmoji = (code) => {
77 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
78 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`;
79 return fetch(api).then((r) => r.text());
80};
81

JimeluStevensgetWeather.ts5 matches

@luke_f•Updated 5 hours ago
23async function generateConciseWeatherSummary(weatherDay) {
24 try {
25 // Get API key from environment
26 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
27 if (!apiKey) {
28 console.error("Anthropic API key is not configured.");
29 return null;
30 }
31
32 // Initialize Anthropic client
33 const anthropic = new Anthropic({ apiKey });
34
35 const response = await anthropic.messages.create({

JimeluStevensgenerateFunFacts.ts5 matches

@luke_f•Updated 5 hours ago
77async function generateFunFacts(previousFacts) {
78 try {
79 // Get API key from environment
80 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
81 if (!apiKey) {
82 console.error("Anthropic API key is not configured.");
83 return null;
84 }
85
86 // Initialize Anthropic client
87 const anthropic = new Anthropic({ apiKey });
88
89 // Format previous facts for the prompt

gotonightapi0 matches

@rosald•Updated 5 hours ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

openapi2 file matches

@stevekrouse•Updated 1 day ago

dbToAPI_backup4 file matches

@nbbaier•Updated 3 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)