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/image-url.jpg%20%22Image%20title%22?q=api&page=1131&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 14407 results for "api"(1411ms)

VALLEREADME.md3 matches

@janpaul123•Updated 10 months ago
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* 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.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>

hackerNewsRAGmain.tsx3 matches

@paulhoule•Updated 10 months ago
5import { zodToJsonSchema } from "npm:zod-to-json-schema";
6
7const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
8
9// search for HN comments using https://hn.algolia.com/api
10const query = "rust";
11const searchResults = await hnSearch({
32 new ComputeJSON({
33 prompt: `Summarize this comment and how it relates to the topic: ${query}
34 Use "negative" sentiment for posts about API, abstraction, documentation, tutorial, general quality, slowness, or performance issues.
35 COMMENT: ${JSON.stringify(hit)}`,
36 json_schema: zodToJsonSchema(commentInfo),

hackerNewsRAGREADME.md2 matches

@paulhoule•Updated 10 months ago
1Find comments on HN (powered by [Algolia](https://hn.algolia.com/api)), extract content and return a streaming markdown summary (powered by [Substrate](https://substrate.run)).
2
3The RAG portion of this is 34 lines of Substrate code. Twitter thread walkthrough: https://x.com/vprtwn/status/1812844236401762513
4
5🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits.

valTownChatGPT2main.tsx1 match

@janpaul123•Updated 10 months ago
147 role: "system",
148 content:
149 `Act as an expert software engineer. Always use best practices. Your response should start with \`\`\`ts and end with \`\`\`. Start your response with a comment explaining how your approach will work, what libraries or API calls you will use, and any tradeoffs you're making. Then write the code in a consise way, the simplest way to achieve the goal, though you can add some inline comments to explain your reasoning (not for every line, but for major groups of lines). Don't use any environment variables unless strictly necessary, for example use APIs that don't require a key, prefer internal function imports (using esm.town), and prefer putting API keys as inline variables. Use built-in Deno functions where possible. The val should create a "export default async function main() {" which is the main function that gets executed, without any arguments. Don't return a Response object, just return a plain Javascript object, array, or string. Unless specified, don't add error handling, make sure that errors bubble up to the caller.`,
150 },
151 {

valwriter_outputmain.tsx3 matches

@stevekrouse•Updated 10 months ago
4const app = new Hono();
5
6const WEATHER_API_KEY = Deno.env.get('WEATHER_API_KEY'); // Replace with your actual weather API key
7const BASE_URL = "https://api.openweathermap.org/data/2.5/weather";
8
9app.get("/", async (c) => {
10 const response = await fetch(
11 `${BASE_URL}?q=Brooklyn&units=metric&appid=${WEATHER_API_KEY}`
12 );
13 const weatherData = await response.json();

sqliteExplorerAppREADME.md1 match

@samwho•Updated 10 months ago
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans

valwriter_outputmain.tsx2 matches

@janpaul123•Updated 10 months ago
1// This approach fetches weather data for Brooklyn, NY from the Open Meteo API
2
3// It then parses the response to extract the current temperature
9
10 const response = await axios.get(
11 "https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m&current_weather=true",
12 );
13

valTownChatGPT2README.md1 match

@janpaul123•Updated 10 months ago
1https://x.com/JanPaul123/status/1811801305066651997
2
3Fork it and authenticate with your Val Town API token as the password.
4
5Migrated from folder: IteratingGPT/valTownChatGPT2

citiesmain.tsx2 matches

@mxdvl•Updated 10 months ago
27 ].map(two_decimals).join(","),
28 language: "native",
29 key: Deno.env.get("OPENCAGE_API_KEY"),
30 });
31
32 const { results: [first] } = await fetch(`https://api.opencagedata.com/geocode/v1/json?${searchParams}`)
33 .then(response => response.json())
34 .then(json => parse(schema, json))

websimREADME.md1 match

@cofsana•Updated 10 months ago
1[WebSim](https://x.com/websim_ai) on Val with Substrate
2
3🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits

createemailapiv22 file matches

@souravvmishra•Updated 15 hours ago

waec_api6 file matches

@seyistry•Updated 21 hours ago
snartapi
mux
Your friendly, neighborhood video API.