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=783&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 8318 results for "fetch"(2318ms)

aqimain.tsx2 matches

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

telegramSendMessagemain.tsx2 matches

@vtdocs•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramSendMessage = async (botToken: string, options: {
14 reply_markup?: any[];
15}) =>
16 fetchJSON(
17 `https://api.telegram.org/bot${botToken}/sendMessage`,
18 {

getGithubStarsmain.tsx3 matches

@vtdocs•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const getGithubStars = async (username: string) => {
4 const user = await fetchJSON(
5 `https://api.github.com/users/${username}`,
6 );
10 while (pages--) {
11 for (
12 const repo of await fetchJSON(
13 `https://api.github.com/users/${username}/repos?per_page=100&page=${
14 pages + 1

fetchestoomuchmain.tsx1 match

@bitbloxhub•Updated 1 year ago
1import { hnTopStory } from "https://esm.town/v/stevekrouse/hnTopStory?v=3";
2
3export let fetchestoomuch = async () => {
4 await Promise.all(async (): Array<Promise<string>> => {
5 return Array(20).fill().map(hnTopStory());

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago