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=397&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 7888 results for "fetch"(1183ms)

weatherForecastDashboardmain.tsx9 matches

@bhavana•Updated 4 months ago
28 }, []);
29
30 async function fetchLocationSuggestions(query) {
31 if (query.length < 2) {
32 setLocationSuggestions([]);
35
36 try {
37 const response = await fetch(
38 `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(query)}&count=5&language=en&format=json`
39 );
54 }
55 } catch (err) {
56 console.error('Failed to fetch location suggestions', err);
57 setLocationSuggestions([]);
58 setShowSuggestions(false);
63 const value = e.target.value;
64 setLocationInput(value);
65 fetchLocationSuggestions(value);
66 };
67
70 setLocation(selectedLocation);
71 setShowSuggestions(false);
72 await fetchWeatherData(selectedLocation);
73 }
74
75 async function fetchWeatherData(coords) {
76 try {
77 const response = await fetch(
78 `https://api.open-meteo.com/v1/forecast?latitude=${coords.latitude}&longitude=${coords.longitude}&current_weather=true&hourly=temperature_2m,precipitation_probability,weathercode&daily=weathercode,temperature_2m_max,temperature_2m_min&timezone=auto`
79 );
82 setError(null);
83 } catch (err) {
84 setError('Failed to fetch weather data');
85 }
86 }
94
95 useEffect(() => {
96 fetchWeatherData(location);
97 }, []);
98

npmProxymain.tsx1 match

@wilt•Updated 4 months ago
31 for (const url of possibleUrls) {
32 try {
33 sourceResp = await fetch(url);
34 if (sourceResp.status === 200) {
35 return sourceResp;

competentBlushPuffinmain.tsx1 match

@wilt•Updated 4 months ago
1import app from "https://wilt-npmproxy.web.val.run/cachebust4/raw.githubusercontent.com/wilt00/bskye/refs/heads/type-imports/src/index.ts";
2
3export default app.fetch;

cerebras_codermain.tsx1 match

@vunguyen9584•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@darkobodnaruk•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

isMyWebsiteDownmain.tsx2 matches

@d17e•Updated 4 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)`);

neatBlackSwiftmain.tsx1 match

@annathasan•Updated 4 months ago
183
184 try {
185 const response = await fetch("/", {
186 method: "POST",
187 body: JSON.stringify({

WeightTrackermain.tsx1 match

@flymaster•Updated 4 months ago
8 }
9
10 const response = await fetch(`https://ntfy.sh/${ntfyChannel}`, {
11 method: "POST",
12 body: `How much do you weigh?`,

sqliteExplorerAppmain.tsx4 matches

@serdans•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

sqliteExplorerAppmain.tsx4 matches

@wilt•Updated 4 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago