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/?q=fetch&page=741&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 7895 results for "fetch"(1642ms)

untitled_coffeeElkmain.tsx6 matches

@WilcoAJ•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const untitled_coffeeElk = (async () => {
7 return `https://repository.overheid.nl/sru?query=dt.title="exploitatievergunning horecabedrijf" AND dt.title="Besluit (Nieuw)" AND dt.title="Nieuw" AND dt.creator=Amsterdam AND dt.modified=${dateString}&maximumRecords=100`;
8 }
9 async function doFetch(date: Date): any {
10 const url = makeUrl(date);
11 const fetchResponse = await fetch(url.toString());
12 const text = await fetchResponse.text();
13 if (!fetchResponse.ok) {
14 throw new Error(text);
15 }
53 });
54 }
55 const resp = await doFetch(new Date("2023-08-31"));
56 const data = parseResponse(resp);
57 return data;

mathFactmain.tsx2 matches

@steveruizok•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);

starWarsmain.tsx2 matches

@hepuffin•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

textmain.tsx2 matches

@andrewn•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const text = (async () => {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",
6 );

homemain.tsx4 matches

@axelav•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/axelav/fetchJSON";
2import process from "node:process";
3
83 results: DiscogsRelease[];
84 }> =>
85 fetchJSON(
86 `https://api.discogs.com/database/search?token=${token}&q=${query}${
87 isMaster ? "&type=master" : ""
89 );
90 const getMasterRelease = async (id: string): Promise<DiscogsRelease> =>
91 fetchJSON(
92 `https://api.discogs.com/masters/${id}?token=${token}`
93 );
94 const getMainRelease = async (id: string): Promise<DiscogsRelease> =>
95 fetchJSON(
96 `https://api.discogs.com/releases/${id}?token=${token}`
97 );

fetchTextWithEncodingmain.tsx4 matches

@stu43005•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL?v=3";
3
4export const fetchTextWithEncoding = async (
5 url: string,
6 options?: RequestInit & {
11 },
12) => {
13 const f = await fetch(normalizeURL(url), {
14 redirect: "follow",
15 ...options,
20 }
21 catch (e) {
22 throw new Error(`fetchTextWithEncoding error: ${e.message} in ${url}`);
23 }
24};

resultmain.tsx2 matches

@aria•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let result = (await fetch('https://swapi.dev/api/people/1/')).json()

fetchRedditTokenmain.tsx1 match

@mschleske•Updated 1 year ago
1import { authenticateReddit } from "https://esm.town/v/mschleske/authenticateReddit";
2
3export const fetchRedditToken = async (
4 CLIENT_ID,
5 CLIENT_SECRET,

getAaveV2Liquidationsmain.tsx5 matches

@alexandre•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { subtractFromDate } from "https://esm.town/v/alexandre/subtractFromDate";
3
7 1000,
8 );
9 const result = await fetch(
10 "https://gateway.thegraph.com/api/6e951d2948be69a241891fb15ec9cefb/deployments/id/QmYN4ofRb5CUg1WdpLhhNTVCuiiAt29hBKGjTnnxYh9zYt",
11 {
18 "sec-ch-ua-mobile": "?0",
19 "sec-ch-ua-platform": '"macOS"',
20 "sec-fetch-dest": "empty",
21 "sec-fetch-mode": "cors",
22 "sec-fetch-site": "same-site",
23 },
24 "referrer": "https://thegraph.com/",

hasValTownStyleGuideUpdatedmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import process from "node:process";
2import { basicAuthorization } from "https://esm.town/v/stevekrouse/basicAuthorization";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
4
5export let hasValTownStyleGuideUpdated = async (since: Date) => {
6 let commits = await fetchJSON(
7 "https://api.github.com/repos/val-town/val.town/commits?path=/src/style.tsx&since=" +
8 since.toISOString(),

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago