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=1&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 14498 results for "fetch"(1307ms)

petitionmain.tsx1 match

@creativevoicesspeaking•Updated 53 mins ago
95
96 try {
97 const verifyResult = await fetch(verifyUrl, {
98 method: "POST",
99 body: verifyData,

untitled-1237main.ts1 match

@sethblanchard•Updated 1 hour ago
2// import * as fsp from 'fs/promises';
3// import fs from 'fs';
4import { fetch } from "npm:node-fetch";
5
6(async () => {

chan237index.tsx3 matches

@carshimoot•Updated 1 hour ago
4export default async function Index() {
5 const BASE = "https://val.town/v/carshimoot.chanmap";
6 const res = await fetch(`${BASE}.getPosts`);
7 const posts = await res.json() as { id: string; text: string; replies: string[] }[];
8
47
48 async function loadPosts() {
49 const res = await fetch(BASE + ".getPosts");
50 const posts = await res.json();
51 const container = document.getElementById("threads");
70 threadId: e.target.threadId.value || null
71 };
72 await fetch(BASE + ".post", {
73 method: "POST",
74 headers: { "Content-Type": "application/json" },

cardamomindex.ts1 match

@connnolly•Updated 1 hour ago
83});
84
85export default app.fetch;

cipherApp.tsx6 matches

@bao•Updated 1 hour ago
44
45 useEffect(() => {
46 async function fetchQuote() {
47 try {
48 const known = await getKnownTexts();
54 let waited = 0;
55 while (value === undefined && waited <= 10) {
56 const response = await fetch(`https://simplevalueapi.val.run/getValue?id=${uuid}`);
57 const responseData = await response.json();
58 if (responseData?.value?.cipher === undefined) {
95 });
96 }
97 console.log("new uuid, fetching new quote");
98 let keyword = "";
99 let quote = "";
100 let author = "";
101 while (quote === "") {
102 const response = await fetch(`/quote`);
103 const responseData = await response.json();
104 if ((responseData?.quote?.length ?? 0) >= 5) {
134 }
135 } catch (error) {
136 console.error("Failed to fetch quote:", error);
137 setLoadingError(`${error}`);
138 setIsLoading(false);
140 }
141
142 fetchQuote();
143 }, []);
144

diy-aimain.tsx1 match

@legal•Updated 2 hours ago
333 formData.append('imageBase64', currentAnalysisSession.imgBase64);
334
335 const res = await fetch(window.location.pathname + '?format=json', { method: 'POST', body: formData });
336 const data = await res.json().catch(() => { throw new Error(\`The server returned an unexpected response. Status: \${res.status}\`); });
337

ImgJocmain.tsx6 matches

@legal•Updated 2 hours ago
325 currentAnalysisSession.imgSource = \`File: \${currentAnalysisSession.imgName}\`;
326 currentAnalysisSession.step = 2;
327 fetchAndPopulateSuggestions();
328 }
329
419
420 if (suggestionsError) {
421 document.getElementById('retry-suggestions-btn').addEventListener('click', fetchAndPopulateSuggestions);
422 }
423
488 const formData = new FormData();
489 formData.append('imageFile', file, file.name);
490 const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
491 const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
492 if (!res.ok || data.error) throw new Error(data.error || \`Server error: \${res.status}\`);
509}
510
511async function fetchAndPopulateSuggestions() {
512 currentAnalysisSession.isProcessing = true;
513 currentAnalysisSession.suggestionsError = null;
518 // No need to send the whole file again if we have the base64 string
519 formData.append('imageBase64', currentAnalysisSession.imgBase64);
520 const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
521 const data = await res.json().catch(() => { throw new Error(\`Server returned non-JSON: \${res.status}\`); });
522 if (!res.ok || data.error) throw new Error(data.error || \`Server Error: \${res.status}\`);
664 formData.append('inputSourceDescription', currentAnalysisSession.imgSource);
665
666 const res = await fetch(window.location.pathname + '?format=json', { method: 'POST', body: formData });
667 const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
668 if (!res.ok || data.error) throw new Error(JSON.stringify(data.error || data.details) || \`Server error: \${res.status}\`);

luciaMagicLinkStarterUserProfile.tsx1 match

@shapedlines•Updated 3 hours ago
43
44 try {
45 const response = await fetch("/api/user/username", {
46 method: "POST",
47 headers: {

luciaMagicLinkStarterLoginForm.tsx1 match

@shapedlines•Updated 3 hours ago
22
23 try {
24 const response = await fetch("/auth/magic-link", {
25 method: "POST",
26 headers: {

luciaMagicLinkStarterindex.ts2 matches

@shapedlines•Updated 3 hours ago
77});
78
79// HTTP vals expect an exported "fetch handler"
80// This is how you "run the server" in Val Town with Hono
81export default app.fetch;

testWeatherFetcher1 file match

@sjaskeprut•Updated 2 days ago

weatherFetcher1 file match

@sjaskeprut•Updated 2 days ago