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/$1?q=fetch&page=14&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 11254 results for "fetch"(3099ms)

pineconenew-file-6541.tsx14 matches

@mees•Updated 1 day ago
45
46 // Create a quick thread for parsing
47 const threadResponse = await fetch("https://api.openai.com/v1/threads", {
48 method: "POST",
49 headers: {
58
59 // Add the query
60 await fetch(`https://api.openai.com/v1/threads/${thread.id}/messages`, {
61 method: "POST",
62 headers: {
72
73 // Run the parser assistant
74 const runResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/runs`, {
75 method: "POST",
76 headers: {
99 await new Promise(resolve => setTimeout(resolve, 500));
100
101 const statusResponse = await fetch(
102 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}`,
103 {
113
114 // Get the response
115 const messagesResponse = await fetch(
116 `https://api.openai.com/v1/threads/${thread.id}/messages?order=desc&limit=1`,
117 {
591 }
592
593 // Create or retrieve thread using raw fetch with v2 headers
594 let thread;
595 if (threadId) {
596 const threadResponse = await fetch(`https://api.openai.com/v1/threads/${threadId}`, {
597 headers: baseHeaders,
598 });
602 thread = await threadResponse.json();
603 } else {
604 const threadResponse = await fetch("https://api.openai.com/v1/threads", {
605 method: "POST",
606 headers: baseHeaders,
627
628 // Add message to thread with v2 headers
629 const messageResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/messages`, {
630 method: "POST",
631 headers: baseHeaders,
641
642 // Run the assistant with v2 headers
643 const runResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/runs`, {
644 method: "POST",
645 headers: baseHeaders,
862 };
863
864 // Poll for completion using raw fetch with v2 headers
865 let runStatus = run;
866 let allMediaDisplays = [];
875 await new Promise(resolve => setTimeout(resolve, 2000));
876
877 const statusResponse = await fetch(
878 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}`,
879 { headers: baseHeaders },
904
905 // Submit tool outputs with v2 headers
906 const toolOutputResponse = await fetch(
907 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}/submit_tool_outputs`,
908 {
928
929 // Get the assistant's response with v2 headers
930 const messagesResponse = await fetch(
931 `https://api.openai.com/v1/threads/${thread.id}/messages?order=desc&limit=20`,
932 { headers: baseHeaders },

Contextualindex.ts1 match

@c15r•Updated 1 day ago
369});
370
371export default app.fetch;

townie-testingtest-randomuser.ts2 matches

@chadparker•Updated 1 day ago
26 }
27
28 const response = await fetch(apiUrl);
29
30 if (!response.ok) {
38
39 } catch (error) {
40 return new Response(`Fetch Error: ${error.message}`, { status: 500 });
41 }
42}

ChatSettings.tsx1 match

@c15r•Updated 1 day ago
81
82 try {
83 const response = await fetch('/api/test-mcp', {
84 method: 'POST',
85 headers: {

Chatindex.ts2 matches

@c15r•Updated 1 day ago
29 // Try to make a basic request to the MCP server
30 // Most MCP servers should respond to a simple GET or POST request
31 const response = await fetch(url, {
32 method: "POST",
33 headers,
96});
97
98export default app.fetch;
76const app = new Hono();
77app.get("/", HTTP101);
78export default app.fetch;

dialogmain.tsx3 matches

@jdan•Updated 1 day ago
268 {
269 name: "MS Sans Serif",
270 data: await fetch("https://esm.sh/98.css@0.1.20/fonts/converted/ms_sans_serif.woff").then(res =>
271 res.arrayBuffer()
272 ),
276 {
277 name: "MS Sans Serif",
278 data: await fetch("https://esm.sh/98.css@0.1.20/fonts/converted/ms_sans_serif_bold.woff").then(res =>
279 res.arrayBuffer()
280 ),
291});
292
293export default app.fetch;

Contextualskills.ts1 match

@c15r•Updated 1 day ago
204 const setTimeout = undefined;
205 const setInterval = undefined;
206 const fetch = undefined;
207 const XMLHttpRequest = undefined;
208

brainstormingindex.ts2 matches

@diegoivo•Updated 1 day ago
307 async function clearUsers() {
308 if (confirm('Are you sure you want to clear all users?')) {
309 const response = await fetch('/debug/clear-users', { method: 'POST' });
310 if (response.ok) {
311 alert('Users cleared');
637}
638
639export default app.fetch;

aiTodoAppmain.tsx1 match

@dukky•Updated 1 day ago
1import app from "./backend/index.ts";
2
3export default app.fetch // This is the entry point for HTTP vals

fetch-socials4 file matches

@welson•Updated 20 hours ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago