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?q=fetch&page=752&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 8438 results for "fetch"(1155ms)

proxyJpegmain.tsx2 matches

@steven•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyJpeg = async (request: Request): Promise<Response> => {
4 const url = new URL(request.url).searchParams.get("url");
5 const response = await fetch(url);
6 const blob = await response.arrayBuffer();
7 return new Response(blob, {

getSeattleSubwayInstagramPostsmain.tsx2 matches

@steven•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getSeattleSubwayInstagramPosts = async (
4 request: Request,
5): Promise<Response> => {
6 let data = await fetch(
7 `https://api.apify.com/v2/acts/apify~instagram-post-scraper/runs/last/dataset/items?token=apify_api_wi6mnWH8aJ5yiwv3ePmYV7BI31yTE13ameye`,
8 );

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);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago