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=826&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 11714 results for "api"(900ms)

hackerNewsDigestmain.tsx1 match

@aslemammadβ€’Updated 8 months ago
1// This cron emails Hacker News stories from its API every 3 days.
2
3import { email } from "https://esm.town/v/std/email";

hackerNewsDigestmain.tsx1 match

@stevekrouseβ€’Updated 8 months ago
1// This cron emails Hacker News stories from its API every 3 days.
2
3import { email } from "https://esm.town/v/std/email";

valcontributionchartmain.tsx1 match

@iamseeleyβ€’Updated 8 months ago
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
4

valcontributionchartmain.tsx1 match

@ejfoxβ€’Updated 8 months ago
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
4

pushmain.tsx6 matches

@yawnxyzβ€’Updated 8 months ago
16const app = new Hono();
17
18const vapidDetails = {
19 url: thisWebURL(),
20 pubKey: Deno.env.get("qushVapidPublicKey"),
21 privKey: Deno.env.get("qushVapidPrivateKey"),
22};
23
57});
58
59app.get("/vapidPublicKey", (c) => c.text(vapidDetails.pubKey));
60
61app.get("/", async (c) => {
103 await storage.set(subscription);
104 if (subscription !== null) {
105 await pushSendNotification(vapidDetails, subscription, "πŸ‘‹");
106 return c.text("Subscribed!");
107 }
112 const subscription = await storage.get();
113 if (subscription === null) return false;
114 await pushSendNotification(vapidDetails, subscription, ...params);
115 return true;
116};

knowledgeExplorermain.tsx3 matches

@sharanbabuβ€’Updated 8 months ago
1/**
2 * This val creates a modern, stylish knowledge explorer using the Cerebras LLM API.
3 * It allows users to enter a topic or select from suggestions, displays information in a centered card,
4 * and enables exploration of related topics or deeper dives using arrow keys or buttons.
148 const Cerebras = (await import("https://esm.sh/@cerebras/cerebras_cloud_sdk")).default;
149 const client = new Cerebras({
150 apiKey: Deno.env.get("CEREBRAS_API_KEY"),
151 });
152
165 });
166 } catch (error) {
167 console.error("Error calling Cerebras API:", error);
168 return new Response(JSON.stringify({ error: "Failed to generate content" }), {
169 status: 500,

pushmain.tsx6 matches

@stevekrouseβ€’Updated 8 months ago
16const app = new Hono();
17
18const vapidDetails = {
19 url: thisWebURL(),
20 pubKey: Deno.env.get("qushVapidPublicKey"),
21 privKey: Deno.env.get("qushVapidPrivateKey"),
22};
23
57});
58
59app.get("/vapidPublicKey", (c) => c.text(vapidDetails.pubKey));
60
61app.get("/", async (c) => {
103 await storage.set(subscription);
104 if (subscription !== null) {
105 await pushSendNotification(vapidDetails, subscription, "πŸ‘‹");
106 return c.text("Subscribed!");
107 }
112 const subscription = await storage.get();
113 if (subscription === null) return false;
114 await pushSendNotification(vapidDetails, subscription, ...params);
115 return true;
116};

emperorOfJapanCrawlermain.tsx1 match

@jdanβ€’Updated 8 months ago
1// This program crawls Wikipedia pages starting from an initial URL,
2// following links in the infobox and collecting page titles.
3// It uses the fetch API to make HTTP requests and cheerio for HTML parsing.
4
5import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";

animemain.tsx9 matches

@tempdevβ€’Updated 8 months ago
11 const results = [];
12 const metaResponse = await fetch(
13 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
14 );
15 const metaData = await metaResponse.json();
22 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
23 return [
24 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
25 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
26 ];
27 }
67 <title>${metaData.title}</title>
68 <style>
69 @import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;700&display=swap');
70
71 html,
159 const results = [];
160 const metaResponse = await fetch(
161 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
162 );
163 const metaData = await metaResponse.json();
169 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
170 return [
171 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
172 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
173 ];
174 }
217 <body style="background:#111;color:#DDD;">
218 <h1>Tempguy-Anime</h1>
219 <pre>https://tempguy-anime.web.val.run/api/MAL_ID/EPISODE/(sub/dub)</pre>
220 <pre>https://tempguy-anime.web.val.run/api/21/1/dub</pre>
221 </body>,
222 );

textSummarizationComparisonToolmain.tsx4 matches

@sharanbabuβ€’Updated 8 months ago
1/**
2 * This val creates a text summarization comparison tool using the Cerebras LLM API.
3 * It provides a text area with default text, a summarize button, and displays two different summarization results:
4 * 1. Direct summarization
5 * 2. Extractive summarization followed by cohesive rewriting
6 *
7 * The server handles API calls to Cerebras, while the client manages the UI and user interactions.
8 */
9
265
266 const Cerebras = (await import("https://esm.sh/@cerebras/cerebras_cloud_sdk")).default;
267 const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
268
269 // Direct summarization
341
342const css = `
343@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');
344
345body {

gpt-image-test

@CaptainJackβ€’Updated 20 mins ago
ζ΅‹θ―• gpt image ηš„δΈεŒ api θƒ½ε¦ζ»‘θΆ³ε›Ύη‰‡η”Ÿζˆθ¦ζ±‚

new-val-api-21 file match

@shouserβ€’Updated 1 day ago
This is an example of using the API to create a val.
papimark21
socialdata
Affordable & reliable alternative to Twitter API: ➑️ Access user profiles, tweets, followers & timeline data in real-time ➑️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates ➑️ Simple integration