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=775&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 8061 results for "fetch"(1775ms)

nyChargingStationsmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const nyChargingStations = (async () => {
5 const { group } = await import("npm:d3-array");
6 const { micromark } = await import("npm:micromark");
7 const rows = await fetch(
8 "https://data.ny.gov/api/views/7rrd-248n/rows.csv?accessType=DOWNLOAD&sorting=true",
9 )

evalPost1main.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let evalPost1 = fetchJSON(
4 "https://api.val.town/v1/eval",
5 {

fetchCongressTradeReportsmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function fetchCongressTradeReports({ lastRunAt }) {
5 const res = await fetchJSON(
6 "https://bff.capitoltrades.com/trades?sortBy=-pubDate",
7 );

subredditExamplemain.tsx2 matches

@funkie•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Reddit recent posts from /r/aww (cute animals)
4export let subredditExample = fetchJSON(
5 "https://www.reddit.com/r/aww/.json"
6);

simpleSurfmain.tsx3 matches

@cjpais•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const simpleSurf = (async () => {
4 // fetch these from the surfline page
5 const spotIds = [
6 "5842041f4e65fad6a770883f",
11 ];
12 const spots = spotIds.join(",");
13 const surfForecast = await fetch(
14 `https://services.surfline.com/kbyg/spots/batch?units%5BswellHeight%5D=FT&units%5Btemperature%5D=F&units%5BtideHeight%5D=FT&units%5BwaveHeight%5D=FT&units%5BwindSpeed%5D=KTS&spotIds=${spots}`,
15 ).then((r) => r.json()).then((d) => d.data);

proxyFetch6main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch6 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};

githubFollowingmain.tsx2 matches

@cas•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);

scrapValuemain.tsx2 matches

@redking00•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const scrapValue = async (url, selector, attr) => {
5 "https://deno.land/x/deno_dom/deno-dom-wasm.ts"
6 );
7 let doc = await (await fetch(url)).text();
8 const document = new DOMParser().parseFromString(doc, "text/html");
9 return document.querySelector(selector).getAttribute(attr);

aqimain.tsx2 matches

@Exam6918•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({

cryptoFearAndGreedIndexmain.tsx2 matches

@chrispie•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const cryptoFearAndGreedIndex = async () => {
4 const { default: cheerio } = await import("npm:cheerio");
5 const html = await fetchText(
6 "https://alternative.me/crypto/fear-and-greed-index/",
7 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago