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/image-url.jpg%20%22Image%20title%22?q=fetch&page=781&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 8348 results for "fetch"(2253ms)

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 {

githubKeysmain.tsx2 matches

@kyle•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function githubKeys(username: string): Promise<string> {
4 const res = await fetch(`https://github.com/${username}.keys`);
5 return res.text();
6}

getmain.tsx2 matches

@dmuth0•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/dmuth/fetchJSON";
2
3export let get = () => {
4 retval = fetchJSON("https://httpbin.dmuth.org/get");
5 return retval;
6};

githubFollowersmain.tsx2 matches

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

githubFollowersmain.tsx2 matches

@rld•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github followers
4export let githubFollowers = fetchJSON(
5 "https://api.github.com/users/roskideluge/followers",
6);

getCNNNewsShortmain.tsx2 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getCNNNewsShort() {
4 const response = await fetch(
5 "https://saurav.tech/NewsAPI/everything/cnn.json"
6 );

forbudmain.tsx4 matches

@antonnyman•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const forbud = async (req: Request) => {
1256 const app = new Hono();
1257 async function getURL() {
1258 const htmlResponse = await fetch("https://datawrapper.dwcdn.net/4iRku");
1259 const htmlData = await htmlResponse.text();
1260 const url = htmlData.split("0; url=")[1].split('">')[0];
1264 async function getDataset() {
1265 let url = await getURL();
1266 const response = await fetch(url, {
1267 headers: {
1268 "Content-Type": "text/csv",
1313 }
1314 app.get("/", async (c) => c.json(await csvToCounties()));
1315 return app.fetch(req);
1316};

boredActivitiesmain.tsx2 matches

@emcfarlane•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago