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=632&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 9244 results for "fetch"(1667ms)

GDI_FileUploadmain.tsx1 match

@all•Updated 7 months ago
57
58 try {
59 const response = await fetch("https://rozek-gdi_fileuploadservice.web.val.run/", {
60 method: "POST",
61 body: formData,

GDI_FileUploadmain.tsx1 match

@rozek•Updated 7 months ago
57
58 try {
59 const response = await fetch("https://rozek-gdi_fileuploadservice.web.val.run/", {
60 method: "POST",
61 body: formData,

blob_adminmain.tsx2 matches

@thesolarmonk•Updated 7 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

dependency_graphmain.tsx1 match

@peterqliu•Updated 7 months ago
81 }
82});
83export default app.fetch;

blob_adminmain.tsx2 matches

@akilangh•Updated 7 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

twitterRecentMentionsmain.tsx3 matches

@charmaine•Updated 7 months ago
1// This val fetches recent tweets about @SnapAR or Lens Studio
2// Updated to use Social Data instead of Twitter API
3
12 return retResponse(data.tweets);
13 } catch (error) {
14 console.error("Error fetching posts:", error);
15 return new Response(JSON.stringify({ error: "Failed to fetch posts", details: error.message }), {
16 status: 500,
17 headers: { "Content-Type": "application/json" },

socialDataUpdatemain.tsx4 matches

@charmaine•Updated 7 months ago
1// This val fetches recent tweets about @SnapAR or Lens Studio, removes duplicates,
2// and displays them as embedded tweets with preview images on a dark background.
3// Updated to use Social Data instead of Twitter API
5import { socialDataSearch } from "https://esm.town/v/stevekrouse/socialDataSearch?v=5";
6
7// This val fetches recent social media posts about @SnapAR or Lens Studio using socialDataSearch,
8// and displays them as embedded posts with preview images on a dark background.
9
15 return retResponse(data.tweets);
16 } catch (error) {
17 console.error("Error fetching posts:", error);
18 return new Response(JSON.stringify({ error: "Failed to fetch posts", details: error.message }), {
19 status: 500,
20 headers: { "Content-Type": "application/json" },

youtubeSearchResultsmain.tsx3 matches

@trob•Updated 7 months ago
14 setLoading(true);
15 try {
16 const response = await fetch(`/search?q=${encodeURIComponent(query)}`);
17 if (!response.ok) {
18 throw new Error(`HTTP error! status: ${response.status}`);
88 try {
89 const searchUrl = `https://www.youtube.com/results?search_query=${encodeURIComponent(query)}`;
90 const response = await fetch(searchUrl);
91 if (!response.ok) {
92 throw new Error(`YouTube search failed: ${response.statusText}`);
123 } catch (error) {
124 console.error("Search error:", error);
125 return new Response(JSON.stringify({ error: "An error occurred while fetching search results." }), {
126 headers: { "Content-Type": "application/json" },
127 status: 500,

weekly_mortgage_ratesmain.tsx4 matches

@bleikamp•Updated 7 months ago
12const FRED_API_KEY = process.env.FRED_API_KEY;
13
14// Function to fetch rate data from FRED API
15async function getRateData(seriesId: string): Promise<RateData> {
16 const url =
17 `https://api.stlouisfed.org/fred/series/observations?series_id=${seriesId}&api_key=${FRED_API_KEY}&file_type=json&sort_order=desc&limit=2`;
18
19 const response = await fetch(url);
20 const data = await response.json();
21
34 };
35 } else {
36 throw new Error(`Failed to fetch data for series ${seriesId}`);
37 }
38}
39
40// Function to fetch all rate data
41async function getAllRateData(): Promise<RateData[]> {
42 const seriesIds = ["MORTGAGE30US", "SOFR30DAYAVG"];

smoothBluePanthermain.tsx1 match

@stevekrouse•Updated 7 months ago
12 const updateHtml = async () => {
13 try {
14 const response = await fetch("/api/modify", {
15 method: "POST",
16 headers: { "Content-Type": "application/json" },

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago