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/$1?q=api&page=1446&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 15445 results for "api"(4032ms)

trpcmain.tsx1 match

@stungeye•Updated 1 year ago
3export async function trpc(userHandle, valName) {
4 return await fetch(
5 `https://www.val.town/api/trpc/getValReferenceTypes?input={%22userHandle%22:%22${userHandle}%22,%22valName%22:%22${valName}%22}`,
6 ).then((data) => data.json());
7}

aqimain.tsx1 match

@shane98c•Updated 1 year ago
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
8 limit: "10",

myApimain.tsx1 match

@qaispalekar•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

valEvalmain.tsx1 match

@healeycodes•Updated 1 year ago
6 const encoded = encodeURIComponent(expr.toString());
7 try {
8 const res = await fetch(`https://api.val.town/eval/${encoded}`);
9 return (await res.json()).data;
10 } catch (e) {

arbitraryFileReadmain.tsx1 match

@mattx•Updated 1 year ago
1export let arbitraryFileRead = (req, res) => {
2 // A pretty simple arbitrary file read caused by the Express API
3 // discovered and patched on January 12th
4 res.sendFile("/etc/passwd");

untitled_greenPlanarianmain.tsx1 match

@andreterron•Updated 1 year ago
1export let untitled_greenPlanarian = (() => {
2 throw new Error("API Error");
3});

postWebhookTest5main.tsx1 match

@val•Updated 1 year ago
2
3export let postWebhookTest5 = fetchJSON(
4 "https://api.val.town/express/@val.postWebhook4",
5 {
6 method: "POST",

chatmain.tsx4 matches

@chatgpt•Updated 1 year ago
5 options = {},
6) => {
7 // Initialize OpenAI API stub
8 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
9 const configuration = new Configuration({
10 apiKey: process.env.OPENAI,
11 });
12 const openai = new OpenAIApi(configuration);
13 // Request chat completion
14 const messages = typeof prompt === "string"

vec_pracmain.tsx1 match

@valilo•Updated 1 year ago
19 a: a,
20 b: b,
21 ergebnis_link: `https://api.val.town/v1/eval/@valilo.eval_vec(${encodeURIComponent(
22 JSON.stringify(ret)
23 )})`,

myApimain.tsx1 match

@mluccone•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

HN-fetch-call2 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API

token-server1 file match

@kwhinnery_openai•Updated 3 days ago
Mint tokens to use with the OpenAI Realtime API for WebRTC
Kapil01
apiv1