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/$%7Bsuccess?q=fetch&page=4&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 14499 results for "fetch"(1260ms)

newvalmain.tsx3 matches

@wahobdâ€ĸUpdated 17 hours ago
5// Key-Value DB āĻĨ⧇āϕ⧇ āĻ­ā§āϝāĻžāϞ⧁ āĻĒāĻžāĻ“ā§ŸāĻžāϰ āĻĢāĻžāĻ‚āĻļāύ
6async function kvGet(key: string): Promise<number> {
7 const res = await fetch(`https://api.val.town/v1/kv/get?key=${key}`, {
8 headers: { "X-API-Key": API_KEY },
9 });
15// Key-Value DB āϤ⧇ āĻ­ā§āϝāĻžāϞ⧁ āϏ⧇āϟ āĻ•āϰāĻžāϰ āĻĢāĻžāĻ‚āĻļāύ
16async function kvSet(key: string, value: number) {
17 await fetch(`https://api.val.town/v1/kv/set`, {
18 method: "POST",
19 headers: {
49// āĻŽā§‡āϏ⧇āϜ āĻĒāĻžāĻ āĻžāύ⧋āϰ āĻĢāĻžāĻ‚āĻļāύ
50async function sendMessage(chat_id: number, text: string, reply_markup: any = null) {
51 await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
52 method: "POST",
53 headers: { "Content-Type": "application/json" },

reactHonoStarterindex.ts2 matches

@n4k0m3â€ĸUpdated 17 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;

saveImdbToDebridindex.ts7 matches

@larryhudsonâ€ĸUpdated 18 hours ago
39 : authHeader;
40
41 // Fetch streams from Torrentio
42 const torrentioUrl = `https://torrentio.strem.fun/realdebrid=${rdToken}/stream/movie/${imdbId}.json`;
43
44 console.log(`Fetching streams from: ${torrentioUrl}`);
45
46 const torrentioResponse = await fetch(torrentioUrl);
47 if (!torrentioResponse.ok) {
48 return new Response(`Error: Failed to fetch streams from Torrentio (${torrentioResponse.status}: ${torrentioResponse.statusText})`, {
49 status: 500,
50 headers: { 'Content-Type': 'text/plain' }
131 if (isCached) {
132 // Stream is already cached, just make the range request
133 const rangeResponse = await fetch(selectedStream.url, {
134 headers: {
135 'Range': 'bytes=0-0' // Request only the first byte
146
147 // First, make a request to initiate the download
148 const downloadResponse = await fetch(selectedStream.url, {
149 method: 'GET',
150 headers: {
162 } else {
163 // Fallback for streams that don't match our expected patterns
164 const rangeResponse = await fetch(selectedStream.url, {
165 headers: {
166 'Range': 'bytes=0-0'

wahoearnmain.tsx1 match

@wahobdâ€ĸUpdated 18 hours ago
132// ✅ āĻŽā§‡āϏ⧇āϜ āĻĒāĻžāĻ āĻžāύ⧋ āĻĢāĻžāĻ‚āĻļāύ
133async function sendMessage(chat_id: number, text: string, reply_markup: any = null) {
134 await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
135 method: "POST",
136 headers: { "Content-Type": "application/json" },

reactHonoStarterapo.tsx1 match

@Raazbhaiiâ€ĸUpdated 18 hours ago
58});
59
60export default app.fetch;

table-mountain-status-cronmain.tsx1 match

@spookyuserâ€ĸUpdated 18 hours ago
2
3async function main() {
4 const response = await fetch(
5 "https://cms.tablemountain.net/admin/actions/submissions/default/weather-api",
6 );

reactHonoStarterindex.ts1 match

@Raazbhaiiâ€ĸUpdated 19 hours ago
242});
243
244export default app.fetch;
245
246function getIcon(iconName: string): string {

reactHonoStarterApp.tsx1 match

@Raazbhaiiâ€ĸUpdated 19 hours ago
10
11 useEffect(() => {
12 fetch("https://Raazbhail-web.val.run/tools") // Replace with your Val Town URL
13 .then((res) => res.json())
14 .then((data) => setTools(data));

qkwen02_http.tsx1 match

@bishojoismâ€ĸUpdated 19 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 20 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: {

testWeatherFetcher1 file match

@sjaskeprutâ€ĸUpdated 2 days ago

weatherFetcher1 file match

@sjaskeprutâ€ĸUpdated 2 days ago