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/?q=fetch&page=229&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 2383 results for "fetch"(749ms)

InstantQuerygetSystemPrompt9 matches

@vawogbemi•Updated 2 months ago
5 Here is an example instantdb query (the examples use an unrelated database):
6
7 Fetch namespace
8 One of the simplest queries you can write is to simply get all entities of a namespace:
9 const query = { goals: {} };
10
11 Fetch multiple namespaces
12 You can fetch multiple namespaces at once:
13 const query = { goals: {}, todos: {} };
14
27 }
28
29 Fetch a specific entity
30 If you want to filter entities, you can use the where keyword. Here we fetch a specific goal:
31 const query = {
32 goals: {
55 }
56
57 Fetch associations
58 We can fetch goals and their related todos:
59
60 const query = {
74 }
75
76 Fetch associations for filtered namespace
77 We can fetch a specific entity in a namespace as well as it's related associations.
78
79 const query = {

statusmonitor2 matches

@roramigator•Updated 2 months ago
12 const start = performance.now();
13 try {
14 const res = await fetch(url);
15 end = performance.now();
16 status = res.status;
23 } catch (e) {
24 end = performance.now();
25 reason = `couldn't fetch: ${e}`;
26 ok = false;
27 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

InstantQuerygetInstantSchema1 match

@vawogbemi•Updated 2 months ago
1async function getInstantSchema(instantAppId: string, instantAdminToken: string) {
2 const response = await fetch("https://api.instantdb.com/admin/schema", {
3 method: "GET",
4 headers: {

hardballcityabout1 match

@flymaster•Updated 2 months ago
4 const app = await getApp();
5
6 return app.fetch(req);
7}
8

statusmonitor2 matches

@scatmanoleg•Updated 2 months ago
12 const start = performance.now();
13 try {
14 const res = await fetch(url);
15 end = performance.now();
16 status = res.status;
23 } catch (e) {
24 end = performance.now();
25 reason = `couldn't fetch: ${e}`;
26 ok = false;
27 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

boldWhiteDinosaurartisticScarletScorpion6 matches

@Vicodin•Updated 2 months ago
12
13 useEffect(() => {
14 fetchChatHistory();
15 }, []);
16
17 const fetchChatHistory = async () => {
18 try {
19 const response = await fetch("/history");
20 const history = await response.json();
21 setMessages(history);
87
88 try {
89 const response = await fetch("/chat", {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },
144 const resetConversation = async () => {
145 try {
146 await fetch("/reset", { method: "POST" });
147 setMessages([]);
148 // Stop any ongoing speech
236 `);
237
238 // Fetch chat history
239 if (request.method === "GET" && new URL(request.url).pathname === "/history") {
240 const result = await sqlite.execute(`

Clone_CHATGPTbubblyGreenBat6 matches

@Custodia•Updated 2 months ago
10
11 useEffect(() => {
12 fetchChatHistory();
13 }, []);
14
15 const fetchChatHistory = async () => {
16 try {
17 const response = await fetch("/history");
18 const history = await response.json();
19 setMessages(history);
46
47 try {
48 const response = await fetch("/chat", {
49 method: "POST",
50 headers: { "Content-Type": "application/json" },
103 const resetConversation = async () => {
104 try {
105 await fetch("/reset", { method: "POST" });
106 setMessages([]);
107 } catch (error) {
180 `);
181
182 // Fetch chat history
183 if (request.method === "GET" && new URL(request.url).pathname === "/history") {
184 const result = await sqlite.execute(`

LlmDashboardmodel-management4 matches

@prashamtrivedi•Updated 2 months ago
170 setTheme("dark");
171 }
172 fetchModels();
173 }, []);
174
181 };
182
183 const fetchModels = async () => {
184 setLoading(true);
185 setProgress(0);
191
192 try {
193 const response = await fetch("/api/models");
194 if (!response.ok) throw new Error("Failed to fetch models");
195 const data = await response.json();
196 setModels(data);

LlmDashboardllm-provider-gemini1 match

@prashamtrivedi•Updated 2 months ago
124 // Note: This is a placeholder as Val Town doesn't have a native Google AI client
125 // Would need to implement actual API call here
126 const response = await fetch(
127 "https://generativelanguage.googleapis.com/v1beta/models/" + model.id + ":generateContent",
128 {

LlmDashboardllm-provider-anthropic1 match

@prashamtrivedi•Updated 2 months ago
112 // Note: This is a placeholder as Val Town doesn't have a native Anthropic client
113 // Would need to implement actual API call here
114 const response = await fetch("https://api.anthropic.com/v1/messages", {
115 method: "POST",
116 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 4 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago