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=753&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 8446 results for "fetch"(939ms)

currencymain.tsx3 matches

@ernest•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let currency = async (base = "eur", desired, amount = 1) => {
4 let { rates } = await fetchJSON(
5 "https://open.er-api.com/v6/latest/eur"
6 );
8 return amount * rates[desired.toUpperCase()];
9 else {
10 let { rates } = await fetchJSON(
11 "https://api.coingecko.com/api/v3/exchange_rates"
12 );
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const webscrapeMinhaBibliotecaCatolicaBoxList = (async () => {
5 "https://assine.bibliotecacatolica.com.br/edicoes-anteriores";
6 const { default: cheerio } = await import("npm:cheerio");
7 const html = await fetchText(sourceUrl);
8 console.log(cheerio);
9 const $ = cheerio.load(html);

fetchWithJSONmain.tsx4 matches

@yuler•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchWithJSON = async <T = any>(url: string, options?: any): Promise<T> => {
4 try {
5 let response = await fetch(url, {
6 ...options,
7 headers: {
12 return await response.json();
13 } catch (error) {
14 throw new Error(`${error.message} in fetch ${url}."`);
15 }
16};

aqimain.tsx2 matches

@freyrva•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({

stableDiffusionGetmain.tsx2 matches

@calvinfo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let stableDiffusionGet = async (key, url) => {
6 "Content-Type": "application/json",
7 };
8 const res = await fetch(url, { headers });
9 return res.json();
10}

getFatCatListingsmain.tsx2 matches

@Ryan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getFatCatListings = async () => {
4 const meResult = await fetch(
5 "https://api-mainnet.magiceden.dev/v2/collections/degenfatcats/listings?offset=0&limit=20",
6 {

githubFollowingmain.tsx2 matches

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

githubFollowingmain.tsx2 matches

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

biliStreammain.tsx2 matches

@nishui•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { email } from "https://esm.town/v/std/email?v=9";
3import { set } from "https://esm.town/v/std/set?v=11";
24 for (let i = 0; i < idArray.length; i++) {
25 const id = idArray[i];
26 const request = fetch(
27 `https://api.live.bilibili.com/room/v1/Room/room_init?id=${id}`,
28 ).then((data) => data.json());

wttrJsonmain.tsx2 matches

@rwev•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrJson(location: string) {
4 // https://github.com/chubin/wttr.in#json-output
5 return (await fetch(`https://wttr.in/${location}?format=j1`)).json();
6}

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago