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/$%7Bart_info.art.src%7D?q=fetch&page=759&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 8136 results for "fetch"(2901ms)

testApimain.tsx2 matches

@andreterron•Updated 1 year ago
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3import process from "node:process";
4
12 },
13 };
14 const me = await fetchJSON(
15 "https://api.val.town/v1/me",
16 opts,

citiBikeSpotCheckermain.tsx4 matches

@ggarnhart•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const citiBikeSpotChecker = async (req, res) => {
5 const { data } = await fetch(
6 "https://gbfs.citibikenyc.com/gbfs/en/station_status.json"
7 ).then((r) => r.json());
17 const {
18 data: { stations: stationInfo },
19 } = await fetchJSON(
20 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json"
21 );

githubReposmain.tsx2 matches

@jshawl•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stevekrouse/repos"
6);

dailyCatmain.tsx2 matches

@cole•Updated 1 year ago
1import { fetchCat } from "https://esm.town/v/cole/fetchCat";
2
3export let dailyCat = async () => {
4 const url = fetchCat();
5 const html = `Here's a random cat: <img src="${url}">`;
6 console.email({ html }, "random cat");

blocksmain.tsx3 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let blocks = async (req, res) => {
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");

nominatimSearchmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function nominatimSearch(params: Search): Promise<Place[]> {
4 return fetchJSON(
5 "https://nominatim.openstreetmap.org/search?" +
6 new URLSearchParams({

valOutputmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function valOutput(req: Request) {
10 const author = match[1];
11 const name = match[2];
12 const val = await fetchJSON(
13 `https://api.val.town/v1/alias/${author}/${name}`,
14 );

planesAboveMemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { round } from "https://esm.town/v/stevekrouse/round";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
16 console.log({ lat, lon, display_name });
17 let url = `https://opensky-network.org/api/states/all?${query}`;
18 let data = await fetchJSON(url);
19 return data?.states?.map((f) => ({
20 icao24: f[0],

aqiLocationmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { msDay } from "https://esm.town/v/stevekrouse/msDay";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4// deprecated in favor of @stevekrouse.openAQLocation
5export let aqiLocation = async ({ lat, lon }: { lat: number; lon: number }) => {
6 const { results } = fetchJSON(
7 "https://api.openaq.org/v2/locations?" +
8 new URLSearchParams({

keepCloudClassifierWarmV4main.tsx2 matches

@cathy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const keepCloudClassifierWarmV4 = async () => {
4 const imgDataUrl =
5 "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
6 const response = await fetch(
7 "https://kaicathy-cloudid.hf.space/run/predict",
8 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago