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=444&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 4574 results for "api"(459ms)

evaluationFromValExamplemain.tsx1 match

@tmcw•Updated 1 year ago
2
3export let evaluationFromValExample = (async () => {
4 const response = await fetch(`https://api.val.town/v1/eval`, {
5 method: "post",
6 body: JSON.stringify({ code: "1 + 1" }),

openstreetmapAPIexamplemain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const openstreetmapAPIexample = (async () => {
4 return (await fetch("https://api.openstreetmap.org/api/0.6/node/1", {
5 headers: { accept: "application/json" },
6 })).json();

valTownApiExampleSearchmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleSearch = (async () => {
4 const query = new URLSearchParams({ query: "lodash", limit: "4" });
5 const response = await fetch(`https://api.val.town/v1/search/vals?${query}`);
6 const json = await response.json();
7 return json;

blocks_innermain.tsx1 match

@tmcw•Updated 1 year ago
3export let blocks_inner = async (req, res) => {
4 const [_, user, id, ...file] = req.path.split("/");
5 const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) =>
6 r.json()
7 );

activitypubmain.tsx1 match

@tmcw•Updated 1 year ago
48 preferredUsername: `bot`,
49 summary: `Photos from ${DOMAIN}.com`,
50 inbox: `https://${DOMAIN}/api/inbox`,
51 followers: `https://${DOMAIN}/u/bot/followers`,
52 icon: {

californiaBusinessNotificationsmain.tsx1 match

@tmcw•Updated 1 year ago
6 const { parse } = await import("https://deno.land/x/xml/mod.ts");
7 const res: any = await fetch(
8 "https://bizfileonline.sos.ca.gov/api/FilingDetail/business/4603/false",
9 {
10 headers: {

measureValTownE2emain.tsx2 matches

@tmcw•Updated 1 year ago
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }

githubFollowingmain.tsx1 match

@tmcw•Updated 1 year ago
5 throw new Error(`${fetchJSON.impl.toString()}`);
6 return fetchJSON(
7 "https://api.github.com/users/stevekrouse/following"
8 );
9})();

jsYAMLExamplemain.tsx1 match

@tmcw•Updated 1 year ago
6 // Fetch a YAML file
7 const yaml = await fetch(
8 "https://raw.githubusercontent.com/docker/engine/8955d8da8951695a98eb7e15bead19d402c6eb27/api/swagger.yaml",
9 ).then((r) => r.text());
10 // parse the fetched file
5 const response =
6 (await fetch(
7 "https://api.val.town/v1/run/politelyinvinciblepointer.handleForm",
8 {
9 method: "POST",

PassphraseAPI2 file matches

@wolf•Updated 2 days ago

openapi2 file matches

@stevekrouse•Updated 4 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)