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/%7Bresult.originalUrl%7D?q=fetch&page=11&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 19093 results for "fetch"(865ms)

eventsCalendarserver.ts3 matches

@roop•Updated 10 hours ago
16import { html, raw } from "npm:hono@4/html";
17import process from "node:process";
18import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
19import { EventParser } from "./lib/event-parser.ts";
20import { EventInserter } from "./lib/event-inserter.ts";
63 step = "convert";
64 await update(stream, { step, state: "started" });
65 const markdown = await fetchText(`https://r.jina.ai/${requestedUrl}`);
66 result.status = "converted";
67 await update(stream, {
245}
246
247export default app.fetch;

TopTenVideosoutput-generator.js1 match

@pmapower•Updated 11 hours ago
345 js += `
346 // Load custom header
347 fetch('${data.headerUrl}')
348 .then(response => response.text())
349 .then(html => {

TopTenVideosindex.html1 match

@pmapower•Updated 11 hours ago
707 `;
708
709 const response = await fetch(headerUrl);
710 if (response.ok) {
711 const headerHtml = await response.text();

TopTenVideosindex.html3 matches

@pmapower•Updated 11 hours ago
202
203 try {
204 const response = await fetch('/api/test-key', {
205 method: 'POST',
206 headers: { 'Content-Type': 'application/json' },
250
251 try {
252 const response = await fetch(`/api/videos?niche=${encodeURIComponent(niche)}`);
253 const data = await response.json();
254
255 if (!response.ok) {
256 this.showError(data.error || 'Failed to fetch videos', data.details);
257 return;
258 }

TopTenVideosapp.js3 matches

@pmapower•Updated 11 hours ago
36
37 try {
38 const response = await fetch('/api/test-key', {
39 method: 'POST',
40 headers: { 'Content-Type': 'application/json' },
84
85 try {
86 const response = await fetch(`/api/videos?niche=${encodeURIComponent(niche)}`);
87 const data = await response.json();
88
89 if (!response.ok) {
90 this.showError(data.error || 'Failed to fetch videos', data.details);
91 return;
92 }

TopTenVideosindex.ts7 matches

@pmapower•Updated 11 hours ago
84 try {
85 const testUrl = `https://www.googleapis.com/youtube/v3/search?part=snippet&q=test&maxResults=1&key=${testKey}`;
86 const testResponse = await fetch(testUrl);
87 const responseData = await testResponse.json();
88
124 try {
125 const testUrl = `https://www.googleapis.com/youtube/v3/search?part=snippet&q=test&maxResults=1&key=${apiKey}`;
126 const testResponse = await fetch(testUrl);
127 const responseText = await testResponse.text();
128
162 const searchUrl = `https://www.googleapis.com/youtube/v3/search?part=snippet&q=${encodeURIComponent(niche)}&type=video&order=relevance&maxResults=10&key=${apiKey}`;
163
164 const searchResponse = await fetch(searchUrl);
165 if (!searchResponse.ok) {
166 const errorText = await searchResponse.text();
202 const detailsUrl = `https://www.googleapis.com/youtube/v3/videos?part=statistics,contentDetails&id=${videoIds}&key=${apiKey}`;
203
204 const detailsResponse = await fetch(detailsUrl);
205 const detailsData: YouTubeVideoDetailsResponse = await detailsResponse.json();
206
222 return c.json({ videos });
223 } catch (error) {
224 console.error("Error fetching YouTube videos:", error);
225 return c.json({ error: "Failed to fetch videos" }, 500);
226 }
227});
228
229export default app.fetch;

untitled-2035main.ts5 matches

@chatgot•Updated 12 hours ago
48 );
49
50 // Parallel fetch NFL and Fantasy data
51 const [nflResponse, fantasyResponse] = await Promise.all([
52 fetch(
53 "http://site.api.espn.com/apis/site/v3/sports/football/nfl/scoreboard",
54 ),
55 fetch(
56 `https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/${YEAR}/segments/0/leagues/${LEAGUE_ID}?view=mMatchup&view=mMatchupScore&view=mTeam&view=mRoster&view=mLiveScoring&scoringPeriodId=${currentWeek}`,
57 {
313 `https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/${YEAR}/segments/0/leagues/${LEAGUE_ID}?view=kona_player_info&scoringPeriodId=${week}`;
314
315 const allPlayersResponse = await fetch(allPlayersUrl, {
316 headers: {
317 "Cookie": `espn_s2=${ESPN_S2}; SWID=${SWID}`,
688 } catch (error) {
689 return Response.json({
690 error: "Failed to fetch game context",
691 details: error.message,
692 });

epic-games-free-gamesmain.ts1 match

@gmcabrita•Updated 12 hours ago
13 });
14
15 const response = await fetch(
16 "https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions?locale=en-US&country=PT&allowCountries=PT",
17 );

prime-gaming-free-gamesmain.ts5 matches

@gmcabrita•Updated 12 hours ago
13 });
14
15 const initialResponse = await fetch("https://gaming.amazon.com/home");
16 const cookie = initialResponse.headers.get("set-cookie").split("Secure, ")
17 .map((
24 .getAttribute("value");
25
26 const response = await fetch("https://gaming.amazon.com/graphql", {
27 "headers": {
28 "accept": "*/*",
41 "sec-ch-ua-mobile": "?0",
42 "sec-ch-ua-platform": '"macOS"',
43 "sec-fetch-dest": "empty",
44 "sec-fetch-mode": "cors",
45 "sec-fetch-site": "same-origin",
46 },
47 "referrer": "https://gaming.amazon.com/home",

epic-games-android-free-gamesmain.ts1 match

@gmcabrita•Updated 12 hours ago
13 });
14
15 const response = await fetch(
16 "https://http-proxy.val.run/?finalUrl=https%3A%2F%2Fegs-platform-service.store.epicgames.com%2Fapi%2Fv2%2Fpublic%2Fdiscover%2Fhome%3Fcount%3D10%26country%3DPT%26locale%3Den%26platform%3Dandroid%26start%3D0%26store%3DEGS",
17 );

FetchBasic2 file matches

@bengold•Updated 2 weeks ago

fetch1 file match

@raify•Updated 2 weeks ago