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=1395&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 17039 results for "api"(1711ms)

sqliteExplorerAppREADME.md1 match

@willthereaderUpdated 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

sqliteExplorerAppmain.tsx2 matches

@willthereaderUpdated 10 months ago
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />

pubmedmain.tsx3 matches

@yawnxyzUpdated 10 months ago
10// PubMed search function (modified to accept more parameters)
11async function pubmedSearch(query, userId, additionalParams = {}) {
12 const url = 'https://www.pubmedisearch.com/api/fetch_articles';
13 const options = {
14 method: 'POST',
56 return c.json(results);
57 } catch (error) {
58 console.error('API error:', error);
59 return c.json({ error: 'An error occurred while processing your request' }, 500);
60 }
74 return c.json(results);
75 } catch (error) {
76 console.error('API error:', error);
77 return c.json({ error: 'An error occurred while processing your request' }, 500);
78 }

ivoryGiraffemain.tsx2 matches

@eczajkUpdated 10 months ago
3
4export default async function(req: Request): Promise<Response> {
5 const url = `https://api.phish.net/v5/shows/artist/phish.json?order_by=showdate&direction=desc&apikey=${
6 Deno.env.get("PHISH_NET_API_KEY")
7 }`;
8 const { data } = await axios.get(url);

getValsContextWindowmain.tsx7 matches

@janpaul123Updated 10 months ago
13 const readmeVals: any = await blob.getJSON("readme-vals.json");
14
15 const API_URL = "https://api.val.town";
16
17 const sections = [
129 {
130 prompt: "Write a val that accesses environment variables",
131 code: `const res = await fetch("${API_URL}/v1/me", {
132 headers: {
133 Authorization: \`Bearer \${Deno.env.get("valtown")}\`,
141 code: `import process from "node:process";
142
143 const res = await fetch("${API_URL}/v1/me", {
144 headers: {
145 Authorization: \`Bearer \${process.env.valtown}\`,
310 You can attach files to your emails by using the \`attachments\` field.
311 Attachments need to be [Base64](https://en.wikipedia.org/wiki/Base64) encoded,
312 which is that the [btoa](https://developer.mozilla.org/en-US/docs/Web/API/btoa)
313 method is doing in this example:
314
412 \`\`\`
413
414 ### Lower-level API
415
416 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.
417
418 - \`async get(key: string)\`: Retrieves a blob for a given key.
419 - \`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).
420
421 ### Limitations
458 role: "assistant",
459 content:
460 "```ts\nexport default async function(req: Request): Promise<Response> {\n const apiKey = Deno.env.get(\"METEO_KEY\");\n const apiUrl = `https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m&current_weather=true&apikey=${apiKey}`;\n\n const response = await fetch(apiUrl);\n const weatherData = await response.json();\n\n return new Response(JSON.stringify(weatherData), { headers: { \"Content-Type\": \"application/json\" } });\n}\n```",
461 },
462 {

templatemain.tsx1 match

@liamUpdated 10 months ago
8
9 // Substrate graph
10 const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
11
12 const startup_name = new ComputeText({

shotclipmain.tsx1 match

@kousun12Updated 10 months ago
15async function getResults(q: string, n: number): Promise<ShotResult[]> {
16 const substrate = new Substrate({
17 apiKey: process.env.SUBSTRATE_API_KEY,
18 });
19 const collectionName = "shotclip";

IllustratedPrimerREADME.md1 match

@kousun12Updated 10 months ago
3ℹ️ Open the url and add a query parameter with a subject (click on titles to "delve"): https://substrate-illustratedprimer.web.val.run/?prompt=modernism
4
5🪩 If you fork, you can [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 in credits

IllustratedPrimermain.tsx3 matches

@kousun12Updated 10 months ago
9
10 // Substrate graph
11 const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
12 const Topic = z
13 .object({
83
84 // UI
85 const capitalize = s => s.replace(/^\w/, c => c.toUpperCase());
86 return new Response(
87 new ReadableStream({
100 <div style="margin:0 10px;">${pair.image}</div>
101 <div style="margin:0 10px;font-size:1.2rem;">
102 <a href="/?subject=${pair.title}"><b>${capitalize(pair.title)}</b></a><br/>${pair.caption}</div>
103</div>`,
104 ));

blob_adminREADME.md1 match

@janpaul123Updated 10 months ago
9[![](https://stevekrouse-button.express.val.run/Install)](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO

HAPI7 file matches

@dIgitalfulusUpdated 29 mins ago

HAPI-01

@dIgitalfulusUpdated 36 mins ago
Kapil01
apiv1