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/%22https:/unpkg.com/@alenaksu/json-viewer@2.1.0/dist/json-viewer.bundle.js//%22?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 19104 results for "fetch"(1903ms)

krazyy-cam-configmain.ts3 matches

@krazyykrunalUpdated 53 mins ago
71
72 // ---- Exchange JWT for access token ----
73 const tokenRes = await fetch("https://oauth2.googleapis.com/token", {
74 method: "POST",
75 headers: { "Content-Type": "application/x-www-form-urlencoded" },
89
90 // ---- Query Firestore publicLenses ----
91 const pubDocRes = await fetch(
92 `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/publicLenses/${id}`,
93 { headers: { Authorization: `Bearer ${access_token}` } },
105
106 // ---- Query Firestore private user doc ----
107 const privDocRes = await fetch(
108 `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents/users/${owner}/lenses/${id}`,
109 { headers: { Authorization: `Bearer ${access_token}` } },

Gemini-2-5-Pro-O-02main.tsx3 matches

@aibotcommanderUpdated 57 mins ago
262async function imageToBase64(imageUrl: string): Promise<{ data: string; mimeType: string }> {
263 try {
264 const response = await fetch(imageUrl, { timeout: 8000 });
265 if (!response.ok) {
266 throw new Error(`Failed to fetch image: ${response.status}`);
267 }
268 const arrayBuffer = await response.arrayBuffer();
309
310 const url = `${config.endpoint}?key=${process.env.GEMINI_API_KEY}`;
311 const response = await fetch(url, {
312 method: "POST",
313 headers: config.headers,
bible

bibleREADME.md2 matches

@cameronpakUpdated 1 hour ago
2
3The simplest way to embed a Bible reader in your website or app using an iframe,
4made freely available by [fetch(bible)](https://fetch.bible/access/app/)
5
6fetch(bible) reader was created by Jon at [Gracious.Tech](https://Gracious.Tech)
bible

biblemain.ts2 matches

@cameronpakUpdated 1 hour ago
5app.get("/", (c) => {
6 return c.html(
7 `<iframe src="https://app.fetch.bible" style="position:fixed;width:100vw;height:100vh;top:0;left:0;border:none;"></iframe>`,
8 );
9});
10
11export default app.fetch;
Gemini-2-5-Pro-O-01

Gemini-2-5-Pro-O-01main.tsx6 matches

@aibotcommanderUpdated 1 hour ago
166async function imageToBase64(imageUrl: string): Promise<{ data: string; mimeType: string }> {
167 try {
168 const response = await fetch(imageUrl, { timeout: 10000 });
169 if (!response.ok) {
170 throw new Error(`Failed to fetch image: ${response.status}`);
171 }
172
220
221 const url = `${GEMINI_PRO_CONFIG.endpoint}?key=${process.env.GEMINI_API_KEY}`;
222 const response = await fetch(url, {
223 method: "POST",
224 headers: GEMINI_PRO_CONFIG.headers,
283
284 const url = `${GEMINI_VISION_CONFIG.endpoint}?key=${process.env.GEMINI_API_KEY}`;
285 const response = await fetch(url, {
286 method: "POST",
287 headers: GEMINI_VISION_CONFIG.headers,
335
336 const url = `${GEMINI_FALLBACK.endpoint}?key=${process.env.GEMINI_API_KEY}`;
337 const response = await fetch(url, {
338 method: "POST",
339 headers: GEMINI_FALLBACK.headers,
387
388 const url = `${GEMINI_FALLBACK.endpoint}?key=${process.env.GEMINI_API_KEY}`;
389 const response = await fetch(url, {
390 method: "POST",
391 headers: GEMINI_FALLBACK.headers,

last-login-demo-1index.tsx12 matches

@stevekrouseUpdated 1 hour ago
33 const [messageInput, setMessageInput] = useState('');
34
35 // Fetch threads when user is logged in
36 useEffect(() => {
37 if (email && threads.length === 0) {
38 fetchThreads();
39 }
40 }, [email]);
41
42 // Fetch messages when thread is selected
43 useEffect(() => {
44 if (selectedThreadId) {
45 fetchMessages(selectedThreadId);
46 } else {
47 setMessages([]);
49 }, [selectedThreadId]);
50
51 const fetchThreads = async () => {
52 try {
53 setLoading(true);
54 const response = await fetch('/api/threads');
55 if (response.ok) {
56 const data = await response.json();
58 }
59 } catch (error) {
60 console.error('Failed to fetch threads:', error);
61 } finally {
62 setLoading(false);
64 };
65
66 const fetchMessages = async (threadId: number) => {
67 try {
68 const response = await fetch(`/api/threads/${threadId}/messages`);
69 if (response.ok) {
70 const data = await response.json();
72 }
73 } catch (error) {
74 console.error('Failed to fetch messages:', error);
75 }
76 };
84
85 try {
86 const response = await fetch(`/api/threads/${selectedThreadId}/messages`, {
87 method: 'POST',
88 headers: {
121 try {
122 setLoading(true);
123 const response = await fetch('/api/threads', {
124 method: 'POST',
125 headers: {

last-login-demo-1index.ts3 matches

@stevekrouseUpdated 1 hour ago
54
55 if (email) {
56 // Fetch user's threads for initial load
57 try {
58 const { rows } = await sqlite.execute(
62 initialData.threads = rows;
63 } catch (error) {
64 console.error('Failed to fetch initial threads:', error);
65 initialData.threads = [];
66 }
270});
271
272export default lastlogin(app.fetch);

nightbottimermain.ts3 matches

@jaydenUpdated 2 hours ago
80}
81
82async function fetchForOwner(owner: Owner) {
83 const r = await sqlite.execute({
84 sql: `
131 // /checktimer
132 if (pathname.endsWith("/checktimer") || pathname.endsWith("/status")) {
133 const timer = await fetchForOwner(nbUser);
134 if (!timer || timer.started_at == null || timer.stopped_at != null) {
135 return send("ℹ️ No running timer.");
142 // /stoptimer
143 if (pathname.endsWith("/stoptimer") || pathname.endsWith("/stop")) {
144 const timer = await fetchForOwner(nbUser);
145 if (!timer || timer.started_at == null || timer.stopped_at != null) {
146 return send("ℹ️ No running timer.");

Hono-playgroundmain.ts1 match

@vyatkaUpdated 3 hours ago
17 return new Response("Made by " + Deno.env.get("Developer"));
18});
19export default app.fetch;

campanhapsdalcoframain.ts1 match

@nmsilvaUpdated 3 hours ago
50 try {
51 // Replace 'YOUR_FORM_ID' with your actual Formspree form ID
52 const response = await fetch("https://formspree.io/f/mpwjgjol", {
53 method: "POST",
54 headers: {
bible

bible2 file matches

@cameronpakUpdated 1 hour ago
fetch(bible) - one-liner Bible reader

FetchBasic2 file matches

@bengoldUpdated 2 weeks ago