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/$%7Burl%7D?q=fetch&page=1244&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 13430 results for "fetch"(2110ms)

YoutubeTranscriptmain.tsx1 match

@park•Updated 1 year ago
1export let YoutubeTranscript = async (videoId) => {
2 const { YoutubeTranscript } = await import("npm:youtube-transcript");
3 return YoutubeTranscript.fetchTranscript(videoId);
4};

fetchFilemain.tsx3 matches

@Llad•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchFile = async (url: string, options?: any) => {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";
6 const blob = await fetch(fileUrl).then((r) => r.blob());
7 return blob;
8};

EmailNotifIfDidntCodemain.tsx2 matches

@Davidkim•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function EmailNotifIfDidntCode() {
14 org?: any;
15 }
16 const githubEvents = await fetchJSON(
17 "https://api.github.com/users/daviddkkim/events",
18 ) as Data;

holidaysUSmain.tsx2 matches

@testhandle•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://date.nager.at/api/v2/publicholidays/2023/US"
6);

githubFollowersmain.tsx2 matches

@stungeye•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function githubFollowers() {
4 let followers = await fetchJSON(
5 "https://api.github.com/users/stungeye/followers",
6 );

harryPotterDatamain.tsx3 matches

@byzantine_emperor•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// when a request comes in fetch hpotter data
4export async function harryPotterData(req: express.Request, res) {
5 try {
6 const responseData = await fetch(
7 "https://hp-api.onrender.com/api/characters",
8 );

getHolidaysmain.tsx2 matches

@ptr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const getHolidays = (country, year = new Date().getFullYear()) => {
4 try {
5 return fetchJSON(
6 `https://date.nager.at/api/v2/publicholidays/${year}/${country}`
7 );

posthogStatusTrackermain.tsx2 matches

@ianvph•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { set } from "https://esm.town/v/std/set?v=11";
3import { postHogAPICapture } from "https://esm.town/v/ianvph/postHogAPICapture";
10 // gets newest status update from rss feed
11 const statusRSSLink = "https://status.posthog.com/history.rss";
12 const response = await fetch(statusRSSLink);
13 const newestEntry =
14 (await parseXML(await response.text())).rss.channel

replitListmain.tsx2 matches

@claytn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let replitList = (REPLIT_DB_URL, prefix) =>
4 fetch(`${REPLIT_DB_URL}?prefix=${encodeURIComponent(prefix)}`);

replitSetmain.tsx2 matches

@claytn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let replitSet = (REPLIT_DB_URL, key, value) =>
4 fetch(`${REPLIT_DB_URL}/${key}=${encodeURIComponent(value)}`, {
5 method: "POST",
6 headers: { "Content-Type": "application/x-www-form-urlencoded" },

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago