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=7&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 14496 results for "fetch"(4024ms)

slimifymain.tsx1 match

@affan•Updated 1 day ago
66})
67
68export default app.fetch;

agatha-proxymain.tsx3 matches

@sammeltassen•Updated 1 day ago
10const manifestBaseUrl = "https://agatha.arch.be/data/json/";
11
12async function fetchJson(id: string) {
13 const headers = new Headers([
14 ["referer", "https://agatha.arch.be/"],
15 ]);
16 const url = new URL(manifestBaseUrl + id);
17 return fetch(url, { headers })
18 .then(resp => resp.json())
19 .catch((err) => ({ error: `Could not access item ${id}` }));
31 let resp;
32 if (requestType === "manifest") {
33 resp = await fetchJson(requestParams.join("/"));
34 }
35 if (resp.error) {
54
55 // Forward the request to Brave Search API
56 const braveResponse = await fetch(`${braveApiUrl}?${braveParams}`, {
57 method: 'GET',
58 headers: {

kaymain.tsx12 matches

@legal•Updated 1 day ago
564
565 try {
566 const response = await fetch(window.location.pathname + '?format=json', { method: 'POST', headers: { 'Accept': 'application/json'}, body: formData });
567 const data = await response.json();
568 if (!response.ok) { throw new Error(data?.error || data?.details || response.statusText || \`Server status: \${response.status}\`); }
615
616 } catch (error) {
617 console.error("Fetch Error:", error);
618 displayError('errorFetchFailed', { errorMessage: error.message });
619 setLoadingState(false);
620 }
652 // --- Dynamic Imports ---
653 const { OpenAI } = await import("https://esm.town/v/std/openai");
654 const { fetch } = await import("https://esm.town/v/std/fetch");
655 const { PDFExtract } = await import("npm:pdf.js-extract");
656
763 errorInvalidFile: "Invalid file type. Please upload a {{document_format_accepted | default('PDF')}}.",
764 errorFileSize: "File is too large (Max {{max_pdf_size_mb}}MB).",
765 errorFetchFailed: "Failed to perform analysis: {{errorMessage}}",
766 contactNamePlaceholder: APP_CONFIG.contact_form_placeholders_en.name,
767 contactEmailPlaceholder: APP_CONFIG.contact_form_placeholders_en.email,
803 errorInvalidFile: "Tipo de archivo inválido. Por favor, suba un {{document_format_accepted | default('PDF')}}.",
804 errorFileSize: "El archivo es demasiado grande (Máx {{max_pdf_size_mb}}MB).",
805 errorFetchFailed: "Falló la realización del análisis: {{errorMessage}}",
806 contactNamePlaceholder: APP_CONFIG.contact_form_placeholders_es.name,
807 contactEmailPlaceholder: APP_CONFIG.contact_form_placeholders_es.email,
872 }
873 try {
874 const response = await fetch(ref.potentialUrl, { method: "HEAD", redirect: "follow", timeout: 5000 });
875 ref.traversalStatus = response.ok ? "success" : "failed";
876 if (!response.ok) ref.error = `Status ${response.status}`;
877 } catch (e) {
878 ref.traversalStatus = "failed";
879 ref.error = e.name === "AbortError" || e.message.includes("timed out") ? "Timeout" : "Fetch Error";
880 }
881 return ref;
904 docText = await extractPdfTextNative(buffer, input.documentFile.name, log);
905 } else if (input.documentUrl) {
906 log.push({ agent: ingestAgent, type: "input", message: `Fetching content from URL: ${input.documentUrl}` });
907 try {
908 const response = await fetch(input.documentUrl);
909 if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
910 docText = await response.text();
911 log.push({ agent: ingestAgent, type: "result", message: `Fetched ${docText.length} characters.` });
912 } catch (e) {
913 log.push({ agent: ingestAgent, type: "error", message: `Failed to fetch URL: ${e.message}. Halting.` });
914 }
915 } else if (input.documentText) {

SON-GOKUindex.ts6 matches

@Itssongoku•Updated 1 day ago
241
242 // Use BinList.net free API (no API key required)
243 const response = await fetch(`https://lookup.binlist.net/${cleanBin}`);
244
245 if (!response.ok) {
294app.get("/api/marketplace/products", async c => {
295 try {
296 // In a real application, this would fetch from a database
297 const products = [
298 {
365 });
366 } catch (error) {
367 return c.json({ error: "Failed to fetch products" }, 500);
368 }
369});
373 const id = c.req.param("id");
374
375 // In a real application, this would fetch from a database
376 const products = [
377 {
418 });
419 } catch (error) {
420 return c.json({ error: "Failed to fetch product" }, 500);
421 }
422});
449});
450
451export default app.fetch;

shitty-leaderboardindex.ts10 matches

@jonbo•Updated 1 day ago
41 }, []);
42
43 // Fetch leaderboard data
44 const fetchLeaderboard = async () => {
45 if (!instanceId) return;
46
48 setIsLoading(true);
49
50 // Fetch chores and history in parallel with cache-busting
51 const timestamp = Date.now();
52 const [choresResponse, historyResponse] = await Promise.all([
53 fetch(`/api/${instanceId}/chores?_t=${timestamp}`),
54 fetch(`/api/${instanceId}/history?_t=${timestamp}`),
55 ]);
56
57 if (!choresResponse.ok || !historyResponse.ok) {
58 throw new Error("Failed to fetch data");
59 }
60
126 setIsLoading(false);
127 } catch (err) {
128 console.error("Error fetching leaderboard:", err);
129 setError("Failed to load leaderboard data");
130 setIsLoading(false);
132 };
133
134 // Initial fetch and polling
135 useEffect(() => {
136 if (!instanceId) return;
137
138 fetchLeaderboard();
139
140 // Poll every 30 seconds for real-time updates
141 const interval = setInterval(fetchLeaderboard, 30000);
142
143 return () => clearInterval(interval);

send-transcriptsmain.tsx1 match

@sunnyatlightswitch•Updated 1 day ago
176});
177
178export default app.fetch;
Plantfo

Plantfoindex.ts5 matches

@Llad•Updated 1 day ago
176 }
177
178 console.log(`Fetching fresh data from OpenAI for: "${plantName}"`);
179 // If not cached, fetch from OpenAI
180 const prompt =
181 `Please provide detailed information about the plant "${plantName}" in the following JSON format. Be specific and accurate:
261 }
262 } catch (error) {
263 console.error("Error fetching plant information:", error);
264 return c.json({
265 error: "Failed to fetch plant information",
266 details: error instanceof Error ? error.message : "Unknown error",
267 }, 500);
390});
391
392export default app.fetch; // This is the entry point for HTTP vals

orbiterHealthmonitor3 matches

@stevedylandev•Updated 2 days ago
10async function notifySlack(message: string) {
11 try {
12 await fetch(WEBHOOK_URL, {
13 method: "POST",
14 headers: {
29 const start = performance.now();
30 try {
31 const res = await fetch(url);
32 end = performance.now();
33 status = res.status;
40 } catch (e) {
41 end = performance.now();
42 reason = `couldn't fetch: ${e}`;
43 ok = false;
44 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

fiberplaneHonoTracingStartermain.tsx1 match

@hrev•Updated 2 days ago
57});
58
59export default instrument(app, { libraryDebugMode: true }).fetch;
60

testWeatherFetcher1 file match

@sjaskeprut•Updated 2 days ago

weatherFetcher1 file match

@sjaskeprut•Updated 2 days ago