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/$%7Burl%7D?q=fetch&page=3&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 14486 results for "fetch"(1812ms)

qkwen02_http.tsx1 match

@bishojoism•Updated 10 hours ago
7 forwardedHeaders.delete("host");
8
9 const res = await fetch(targetUrl, {
10 method: req.method,
11 headers: forwardedHeaders,

weather-aimain.tsx6 matches

@helge•Updated 11 hours ago
12
13async function getWeather(latitude: number, longitude: number): Promise<WeatherData> {
14 console.log(`[getWeather] Fetching weather for lat: ${latitude}, lon: ${longitude}`);
15 const url =
16 `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,wind_speed_10m&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m`;
17 console.log(`[getWeather] URL: ${url}`);
18
19 const response = await fetch(url);
20 console.log(`[getWeather] Response status: ${response.status}`);
21
37 console.log(`[getCoordinates] Using corsproxy.io`);
38
39 const response = await fetch(proxyUrl, {
40 headers: {
41 "User-Agent": "WeatherApp/1.0",
68 };
69 } catch (error) {
70 console.error(`[getCoordinates] Error fetching coordinates:`, error);
71 return {
72 latitude: 0,
80 const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
81
82 const response = await fetch("https://openrouter.ai/api/v1/chat/completions", {
83 method: "POST",
84 headers: {
307
308 try {
309 const response = await fetch('/api/weather', {
310 method: 'POST',
311 headers: {

tgbotbmain.tsx1 match

@wahobd•Updated 11 hours ago
36 }
37
38 await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
39 method: "POST",
40 headers: { "Content-Type": "application/json" },

email-attachment-handlerhandler.ts2 matches

@sorcoro•Updated 11 hours ago
154 formData.append('client_secret', clientSecret);
155
156 const response = await fetch(url, {
157 method: 'POST',
158 headers: {
195 };
196
197 const response = await fetch(url, {
198 method: 'POST',
199 headers,

basic_siteserver.tsx2 matches

@Koolala•Updated 20 hours ago
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;

amaheart.js2 matches

@Smithographic•Updated 21 hours ago
63 }
64 async getCount() {
65 const t = await fetch(this.href, {
66 headers: { Accept: "application/json" },
67 });
80 if (this.hasReacted()) return this.setReacted();
81 this.setAttribute("aria-busy", "true"),
82 await fetch(this.href, {
83 method: "post",
84 body: this.emoji,

amaama.tsx1 match

@Smithographic•Updated 21 hours ago
210});
211
212export default app.fetch;

untitled-2497main.tsx1 match

@fabricio•Updated 21 hours ago
52 setResults([]);
53 try {
54 const response = await fetch("http://localhost:3000/search", {
55 method: "POST",
56 headers: { "Content-Type": "application/json" },
13const app = new Hono();
14app.get("/", ObservationsEnjoyExisting);
15export default app.fetch;

stardewCloneindex.ts1 match

@dcm31•Updated 22 hours ago
314
315 try {
316 const response = await fetch(window.location.origin, {
317 method: 'POST',
318 headers: { 'Content-Type': 'application/json' },

testWeatherFetcher1 file match

@sjaskeprut•Updated 2 days ago

weatherFetcher1 file match

@sjaskeprut•Updated 2 days ago