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=773&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 8357 results for "fetch"(3205ms)

holidaysUSmain.tsx2 matches

@paperee•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://bed.paperee.repl.co/detail"
6);

hnTopTenStoriesmain.tsx4 matches

@iakovos•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4// Get the title of the top story on Hacker News
5export async function hnTopTenStories() {
6 const topStories: Number[] = await fetch(
7 "https://hacker-news.firebaseio.com/v0/beststories.json?print=pretty",
8 ).then((res) => res.json());
9 const top10Stories = await Promise.all(
10 topStories.slice(0, 10).map(async (id) => {
11 return await fetchJSON(
12 `https://hacker-news.firebaseio.com/v0/item/${id}.json`,
13 );

proxyFetch3main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch3 = 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};

nasaAPODmain.tsx2 matches

@iBrokeit•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON(
5 "api.nasa.gov/planetary/apod?api_key=DEMO_KEY",
6);

TodayForAnnalisamain.tsx2 matches

@mttlws•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function TodayForAnnalisa(req: express.Request, res: express.Response) {
4 const { activity } = await fetchJSON(
5 "https://www.boredapi.com/api/activity",
6 );

convertPcmCovid19Listmain.tsx1 match

@aeaton•Updated 1 year ago
1export const convertPcmCovid19List = async () => {
2 const { csv } = await import("https://cdn.skypack.dev/d3-fetch@3");
3 const data = await csv(
4 "https://www.ncbi.nlm.nih.gov/core/assets/pmc/files/removed_phe_articles_oa_subset.csv",

apimain.tsx1 match

@ayrtonlacerda•Updated 1 year ago
23 });
24 });
25 return app.fetch(req);
26};

gitHubStarsmain.tsx3 matches

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

girafemain.tsx2 matches

@dot•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function girafe() {
8 let party_size = "2";
9
10 let response = await fetch(
11 `https://www.sevenrooms.com/api-yoa/availability/widget/range?venue=${venue}&time_slot=${time_slot}&party_size=${party_size}&halo_size_interval=5&start_date=${start_date}&num_days=1&channel=SEVENROOMS_WIDGET`
12 );

getRSSmain.tsx2 matches

@ianv•Updated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS?v=12";
2
3export let getRSS = fetchRSS("https://milkyeggs.com/feed/");

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago