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/$%7Bsuccess?q=fetch&page=631&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 9263 results for "fetch"(2371ms)

blob_adminmain.tsx2 matches

@flymaster•Updated 7 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

btcPricemain.tsx2 matches

@panphora•Updated 7 months ago
2import { email } from "https://esm.town/v/std/email";
3import { formatAsCurrency } from "https://esm.town/v/panphora/formatAsCurrency";
4import { fetchJSON } from "https://esm.town/v/panphora/fetchJSON";
5
6export default async function(interval: Interval) {
7 const lastBtcPrice = await blob.getJSON("lastBtcPrice") || 0;
8
9 let btc = await fetchJSON(
10 `https://rest.coinapi.io/v1/quotes/COINBASE_SPOT_BTC_USD/current`,
11 {

vt_appmain.tsx1 match

@peterqliu•Updated 7 months ago
40app.route("/delete", deleteRoute);
41
42export default app.fetch;

distancemain.tsx2 matches

@panphora•Updated 7 months ago
9 }
10
11 const response = await fetch(
12 `https://maps.googleapis.com/maps/api/distancematrix/json?destinations=${destinationA}&origins=${destinationB}&units=imperial&key=${apiKey}`,
13 );
14
15 if (!response.ok) {
16 return new Response("Failed to fetch data from Google Maps API", { status: response.status });
17 }
18

sillifierSlangifiermain.tsx1 match

@yawnxyz•Updated 7 months ago
12 const updateHtml = async () => {
13 try {
14 const response = await fetch("/api/modify", {
15 method: "POST",
16 headers: { "Content-Type": "application/json" },

isMyWebsiteDownmain.tsx2 matches

@mateoclarke•Updated 7 months ago
14 start = performance.now();
15 try {
16 const res = await fetch(url);
17 end = performance.now();
18 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

GDI_AITranslatormain.tsx1 match

@rozek_at_hft•Updated 7 months ago
13
14 try {
15 const response = await fetch("https://rozek-gdi_aitranslatorservice.web.val.run", {
16 method: "POST",
17 body: germanText,

lovableVioletLandfowlmain.tsx13 matches

@eligosmlytics•Updated 7 months ago
10 setConverting(prev => ({ ...prev, [index]: true }));
11 try {
12 const response = await fetch(url);
13 const blob = await response.blob();
14 const img = await createImageBitmap(blob);
130 setHtmlContent('');
131 try {
132 const response = await fetch(`/api?url=${encodeURIComponent(url)}`);
133 if (!response.ok) {
134 throw new Error(`HTTP error! status: ${response.status}`);
141 const metrics = extractPerformanceMetrics(data);
142 setPerformanceMetrics(metrics);
143 await fetchHtmlContent(url);
144 } catch (error) {
145 console.error("Error fetching results:", error);
146 setResults({ error: error.message || "Failed to fetch results" });
147 }
148 setLoading(false);
149 };
150
151 const fetchHtmlContent = async (url) => {
152 try {
153 const response = await fetch(`/html?url=${encodeURIComponent(url)}`);
154 if (!response.ok) {
155 throw new Error(`HTTP error! status: ${response.status}`);
158 setHtmlContent(html);
159 } catch (error) {
160 console.error("Error fetching HTML content:", error);
161 setHtmlContent("Failed to fetch HTML content");
162 }
163 };
331
332 try {
333 const response = await fetch(apiUrl);
334 if (!response.ok) {
335 throw new Error(`HTTP error! status: ${response.status}`);
343 });
344 } catch (error) {
345 return new Response(JSON.stringify({ error: error.message || "Failed to fetch PageSpeed Insights" }), {
346 status: 500,
347 headers: {
360
361 try {
362 const response = await fetch(testUrl);
363 if (!response.ok) {
364 throw new Error(`HTTP error! status: ${response.status}`);
372 });
373 } catch (error) {
374 return new Response("Failed to fetch HTML content", { status: 500 });
375 }
376 }

genuineGrayWrenmain.tsx1 match

@stevekrouse•Updated 7 months ago
187
188 try {
189 const response = await fetch("/api/combine", {
190 method: "POST",
191 headers: {

ChatGPTTextDefinitionUserscriptmain.tsx2 matches

@willthereader•Updated 7 months ago
418 console.log(`Request body: ${body}`);
419
420 const response = await fetch(API_CONFIG.url, {
421 ...API_CONFIG,
422 body: body,
432 } catch (error) {
433 console.error(`Error in makeApiRequest: ${error.message}`);
434 throw new Error(`Failed to fetch definition from the server. Please try again. Error: ${error.message}`);
435 }
436 }

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago