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=1418&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"(4082ms)

referencesmain.tsx1 match

@andreterron•Updated 1 year ago
24}[]> {
25 const res = await fetchJSON(
26 "https://api.val.town/v1/me/references?" +
27 searchParams({
28 since: since?.toISOString(),

graffitiWebsitemain.tsx1 match

@andreterron•Updated 1 year ago
38 await new Promise<void>((resolve) => setTimeout(() => resolve(), 150));
39 }
40 const code = `await api(
41 @andreterron.paintGraffitiPixel,
42 ${Math.min(Math.floor(Math.random() * 64), 64)}, // x

myApimain.tsx1 match

@wonday•Updated 1 year ago
1import { name as name2 } from "https://esm.town/v/wonday/name";
2
3export function myApi(name) {
4 return `hi ${name}! my name is ${name2}`;
5}

myApimain.tsx1 match

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

myApimain.tsx1 match

@mss•Updated 1 year ago
1export function myApi(name) {
2 console.email("hello " + name);
3 return "hello " + name;

customStatusCodemain.tsx1 match

@doga•Updated 1 year ago
1// Visit: https://api.val.town/v1/express/vtdocs.customStatusCode
2export const customStatusCode = (req: express.Request, res: express.Response) => {
3 // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418

myApimain.tsx1 match

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

quotemain.tsx1 match

@nfelger•Updated 1 year ago
3export let quote = (async () => {
4 const quotes = await fetchJSON(
5 "https://zenquotes.io/api/random/"
6 );
7 return `"${quotes[0].q}" – ${quotes[0].a}`;

initialCommitmain.tsx2 matches

@jshawl•Updated 1 year ago
3export let initialCommit = async (org, repo) => {
4 const repoData = await fetchJSON(
5 `https://api.github.com/repos/${org}/${repo}`
6 );
7 const { created_at } = repoData;
8 const until = new Date(Date.parse(created_at) + 600).toISOString();
9 const json = await fetchJSON(
10 `https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
11 );
12 return json;

getUrlContentmain.tsx1 match

@libo•Updated 1 year ago
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url
11 );

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