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/$%7Burl%7D?q=api&page=955&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 12915 results for "api"(2980ms)

linkInBioTemplatemain.tsx1 match

@OliveUpdated 8 months ago
174 <title>Side School Seminar</title>
175 <meta name="viewport" content="width=device-width, initial-scale=1">
176 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
177 <style>${css}</style>
178 </head>

weeksummarymain.tsx3 matches

@ejfoxUpdated 8 months ago
37 prev => [...prev, `Fetching scraps and generating summary for week of ${weekStart.toDateString()}...`],
38 );
39 const response = await fetch(`/api/summary?week=${weekStart.toISOString()}`);
40 const data = await response.json();
41
120 <footer className="mt-8 text-center text-sm">
121 <h3>curl</h3>
122 <pre class="bg-black text-white text-sm font-mono">curl 'https://ejfox-weeksummary.web.val.run/api/summary?week=2024-06-16T00:00:00.000Z'</pre>
123
124 <a
146 const url = new URL(request.url);
147
148 if (url.pathname === "/api/summary") {
149 const { OpenAI } = await import("https://esm.town/v/std/openai");
150 const openai = new OpenAI();

VALLErunmain.tsx11 matches

@ejfoxUpdated 8 months ago
211 Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
212 Start your response with a comment explaining how your approach will work, what libraries or
213 API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
214 the simplest way to achieve the goal, though you can add some inline comments to explain your
215 reasoning (not for every line, but for major groups of lines). Don't use any environment variables
216 unless strictly necessary, for example use APIs that don't require a key, prefer internal function
217 imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
218 functions where possible. Unless specified, don't add error handling,
219 make sure that errors bubble up to the caller.
220 Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
221 not practical for the user's request (e.g. if they ask for a particular animated gif).
222 If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
223 explicitly specified otherwise. Use the current val name for the storage key, which you can get
224 using the "pomdtr/extractValInfo" val, which you can call like this:
273Make an HTTP val (other vals are currently not supported to run, even though we have examples for them).
274Add comments at the top of the file explaining how your approach works, what libraries or
275API calls you will use, and any tradeoffs you're making. Then write the code in a consise way,
276the simplest way to achieve the goal, though you can add some inline comments to explain your
277reasoning (not for every line, but for major groups of lines). Don't use any environment variables
278unless strictly necessary, for example use APIs that don't require a key, prefer internal function
279imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno
280functions where possible. Unless specified, don't add error handling,
281make sure that errors bubble up to the caller.
282Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's
283not practical for the user's request (e.g. if they ask for a particular animated gif).
284If the user asks for something that requires persistence, use the Val Town Blob storage API, unless
285explicitly specified otherwise. Use the current val name for the storage key, which you can get
286using the "pomdtr/extractValInfo" val, which you can call like this:
389 \`\`\`
390
391 ### Lower-level API
392
393 We do provide access to the lower-level getter and setters, which are useful if you are storing non-JSON or binary data, need to stream in your response or request data, or do anything else lower-level.
394
395 - \`async get(key: string)\`: Retrieves a blob for a given key.
396 - \`async set(key: string, value: string | BodyInit)\`: Sets the blob value for a given key. See [BodyInit](https://deno.land/api@v1.38.1?s=BodyInit).
397
398 ### Limitations
1204
1205 const tempValName = `valle_tmp_${Math.random() * 10}`.replaceAll(".", "");
1206 // Errors in running the val bubble up through this API, so ignore them.
1207 await vt.vals.create({ name: tempValName, code: newCode, type: "http" as any, privacy: "unlisted" }).catch(
1208 (error) => {

slackScoutREADME.md4 matches

@sarahxcUpdated 8 months ago
7## Getting Started
8To run Slack Scout, you’ll need a
9- Browserbase API key
10- Slack Webhook URL: setup [here](https://docs.val.town/integrations/slack/send-messages-to-slack/)
11- Twitter Developer API key
12
13### Browserbase
19### Twitter
20
21We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. _If you decide to use Browserbase, we can lend our token. Comment below for access._
22
23Once you have the `SLACK_WEBHOOK_URL`, `BROWSERBASE_API_KEY`, and `TWITTER_BEARER_TOKEN`, input all of these as [Val Town Environment Variables](https://www.val.town/settings/environment-variables).
24
25---

githubGistsmain.tsx1 match

@scottUpdated 8 months ago
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists",
6);
7

nasaImageDetailsmain.tsx1 match

@kcoreyUpdated 8 months ago
2
3export const nasaImageDetails = async () => {
4 const nasaAPOD = await fetchJSON("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY");
5 let nasaImageHtml = nasaAPOD.hdurl
6 ? `<img width="100%" src="${nasaAPOD.hdurl}"/>`

townGenmain.tsx15 matches

@cofsanaUpdated 8 months ago
1/**
2 * This val creates a website called TownGen that generates optimized prompts for Hono and Deno based on user input.
3 * It uses a simulated API for Hono and Deno features and incorporates a loading animation.
4 * The prompt is tested and debugged using a simulated API before presenting to the user.
5 * It includes a pill box multi-select for enhanced features from npm packages, organized into categories.
6 * A large submit button and a 10-second animation are added when generating the prompt.
16import { createRoot } from "https://esm.sh/react-dom/client";
17
18// Simulated API for Hono and Deno features
19const features = {
20 hono: [
34 "Built-in testing",
35 "Permissions system",
36 "Web standard APIs",
37 ],
38};
45 backend: {
46 icon: "🖧",
47 items: ["GraphQL", "RESTful API", "WebSockets", "gRPC", "Microservices", "Serverless", "Event-driven"],
48 },
49 database: {
201 content: [
202 "contentful",
203 "strapi",
204 "ghost",
205 "markdown-it",
262 "Add splash page",
263 "Add excessive emojis",
264 "Use Web Storage API for local data",
265 "Add a cookie consent banner",
266 "Implement a progress bar for long forms",
3043. Leverage Deno capabilities:
305 ${features.deno.map(feature => `- ${feature}`).join("\n ")}
3064. Implement RESTful API endpoints
3075. Add error handling and logging
3086. Include unit tests using Deno's built-in testing framework
318Please generate TypeScript code for a Hono application running on Deno that implements these features.`;
319
320 // Simulated API call for testing and debugging
321 const debuggedPrompt = await simulateDebugAPI(generatedPrompt);
322
323 setPrompt(debuggedPrompt);
333 "Add database integration",
334 "Implement authentication system",
335 "Set up API endpoints",
336 "Add error handling and logging",
337 "Implement unit tests",
347 "User authentication and authorization",
348 "Data persistence and retrieval",
349 "API integration",
350 "Error handling and logging",
351 "Performance optimization",
359 };
360
361 const simulateDebugAPI = async (prompt: string) => {
362 // Simulated API call for testing and debugging
363 await new Promise(resolve => setTimeout(resolve, 2000));
364 return prompt + "\n\nNote: This prompt has been tested and debugged for Hono and Deno compatibility.";
533 <meta name="viewport" content="width=device-width, initial-scale=1.0">
534 <title>TownGen - Val Generator</title>
535 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
536 <style>${css}</style>
537 </head>

townGenmain.tsx15 matches

@allUpdated 8 months ago
1/**
2 * This val creates a website called TownGen that generates optimized prompts for Hono and Deno based on user input.
3 * It uses a simulated API for Hono and Deno features and incorporates a loading animation.
4 * The prompt is tested and debugged using a simulated API before presenting to the user.
5 * It includes a pill box multi-select for enhanced features from npm packages, organized into categories.
6 * A large submit button and a 10-second animation are added when generating the prompt.
16import { createRoot } from "https://esm.sh/react-dom/client";
17
18// Simulated API for Hono and Deno features
19const features = {
20 hono: [
34 "Built-in testing",
35 "Permissions system",
36 "Web standard APIs",
37 ],
38};
45 backend: {
46 icon: "🖧",
47 items: ["GraphQL", "RESTful API", "WebSockets", "gRPC", "Microservices", "Serverless", "Event-driven"],
48 },
49 database: {
201 content: [
202 "contentful",
203 "strapi",
204 "ghost",
205 "markdown-it",
262 "Add splash page",
263 "Add excessive emojis",
264 "Use Web Storage API for local data",
265 "Add a cookie consent banner",
266 "Implement a progress bar for long forms",
3043. Leverage Deno capabilities:
305 ${features.deno.map(feature => `- ${feature}`).join("\n ")}
3064. Implement RESTful API endpoints
3075. Add error handling and logging
3086. Include unit tests using Deno's built-in testing framework
318Please generate TypeScript code for a Hono application running on Deno that implements these features.`;
319
320 // Simulated API call for testing and debugging
321 const debuggedPrompt = await simulateDebugAPI(generatedPrompt);
322
323 setPrompt(debuggedPrompt);
333 "Add database integration",
334 "Implement authentication system",
335 "Set up API endpoints",
336 "Add error handling and logging",
337 "Implement unit tests",
347 "User authentication and authorization",
348 "Data persistence and retrieval",
349 "API integration",
350 "Error handling and logging",
351 "Performance optimization",
359 };
360
361 const simulateDebugAPI = async (prompt: string) => {
362 // Simulated API call for testing and debugging
363 await new Promise(resolve => setTimeout(resolve, 2000));
364 return prompt + "\n\nNote: This prompt has been tested and debugged for Hono and Deno compatibility.";
533 <meta name="viewport" content="width=device-width, initial-scale=1.0">
534 <title>TownGen - Val Generator</title>
535 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
536 <style>${css}</style>
537 </head>

promptGenmain.tsx2 matches

@allUpdated 8 months ago
1/**
2 * This val creates a website that generates optimized prompts for Val Town based on user input.
3 * It uses the OpenAI API to generate prompts and incorporates a loading animation.
4 * The generated prompt is tailored to Val Town's specific features and best practices.
5 */
18 "TypeScript support",
19 "Deno runtime",
20 "Web APIs",
21];
22

valleBlogV0README.md1 match

@roadlabsUpdated 8 months ago
1* Fork this val to your own profile.
2* 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.
3

vapi-minutes-db1 file match

@henrywilliamsUpdated 1 day ago

vapi-minutes-db2 file matches

@henrywilliamsUpdated 1 day ago
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