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=482&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 5056 results for "api"(419ms)

myIPmain.tsx1 match

@stevekrouse•Updated 1 year ago
2
3export const myIP = () =>
4 fetchJSON("https://api.ipify.org?format=json");

panphoraDistanceTimedmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { runValAPI } from "https://esm.town/v/stevekrouse/runValAPI";
2import { timed } from "https://esm.town/v/stevekrouse/timed";
3import { panphoraDistanceTimes } from "https://esm.town/v/stevekrouse/panphoraDistanceTimes";
6 panphoraDistanceTimes.push(
7 await timed(() =>
8 runValAPI(
9 "@panphora.distance",
10 "barclay center",

nyChargingStationsmain.tsx1 match

@tmcw•Updated 1 year ago
6 const { micromark } = await import("npm:micromark");
7 const rows = await fetch(
8 "https://data.ny.gov/api/views/7rrd-248n/rows.csv?accessType=DOWNLOAD&sorting=true",
9 )
10 .then((r) => r.text())

evalPost1main.tsx1 match

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

autoGPT_Testmain.tsx3 matches

@stevekrouse•Updated 1 year ago
4
5export let autoGPT_Test = (async () => {
6 const { Configuration, OpenAIApi } = await import("npm:openai@3.2.1");
7 const configuration = new Configuration({
8 apiKey: process.env.openai,
9 });
10 const openai = new OpenAIApi(configuration);
11 const completion = await openai.createChatCompletion({
12 model: "gpt-4",

myExpressApimain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { set } from "https://esm.town/v/std/set?v=11";
3
4export async function myExpressApi(req: express.Request, res: express.Response) {
5 res.json({
6 count: await set(
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api: "localhost:3001",
7 expected: (old, next) => next.n2 !== next.n,
8 mutator: (now) => `(() => {

verifySecretAPImain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { runValAPI } from "https://esm.town/v/stevekrouse/runValAPI";
2
3export let verifySecretAPI = (handle, key, value) => {
4 return runValAPI(handle + ".verifySecret", key, value);
5};

fetchCongressTradeReportsmain.tsx1 match

@stevekrouse•Updated 1 year ago
4export async function fetchCongressTradeReports({ lastRunAt }) {
5 const res = await fetchJSON(
6 "https://bff.capitoltrades.com/trades?sortBy=-pubDate",
7 );
8 const stockTradesReportedToday = res.data.filter((trade) => {

authenticatedCantMutateAnothermain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const authenticatedCantMutateAnother = (api) =>
4 testMutateSemantics({
5 stateName: "@steveVT.myTestState",
6 api,
7 mutateExpected: false,
8 mutator: (now) => `export let @stevekrouse.myTestState = ${now}`,

runValAPIEx2 file matches

@charmaine•Updated 10 hours ago

PassphraseAPI2 file matches

@wolf•Updated 3 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)