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/$2?q=api&page=1420&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 15466 results for "api"(2825ms)

tidbytDeviceInstallationsmain.tsx4 matches

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function tidbytDeviceInstallations({ deviceId, apiKey }: {
4 deviceId: string;
5 apiKey: string;
6}) {
7 return fetchJSON(
8 `https://api.tidbyt.com/v0/devices/${deviceId}/installations`,
9 {
10 headers: {
11 Authorization: `Bearer ${apiKey}`,
12 },
13 },

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;

HN-fetch-call2 file matches

@ImGqb•Updated 2 days 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