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=506&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 8234 results for "fetch"(975ms)

setsignsmain.tsx1 match

@kora•Updated 5 months ago
32 return c.json(result);
33});
34export default app.fetch;

ambitiousBronzeBandicootmain.tsx10 matches

@stanley•Updated 5 months ago
23}
24
25async function fetchAndCacheData() {
26 try {
27 console.log("Fetching URL:", url);
28 const response = await fetch(url, {
29 headers: {
30 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
56 return bootstrapData;
57 } catch (error) {
58 console.error("Error fetching and caching data:", error);
59 const cachedData = await blob.getJSON(cacheKey);
60 if (cachedData) {
61 console.log("Using cached data from:", cachedData.timestamp);
62 return { ...cachedData.data, _cachedAt: cachedData.timestamp, _cacheNotice: "This is cached data. Live fetching failed." };
63 }
64 throw error;
67
68async function getFullData() {
69 const data = await fetchAndCacheData();
70 return Response.json(data);
71}
72
73async function getDonationProgress() {
74 const data = await fetchAndCacheData();
75 const donationGoal = data.checkoutLink.checkout_link_data.donation_goal;
76 return Response.json({
86
87async function getCheckoutDetails() {
88 const data = await fetchAndCacheData();
89 return Response.json({
90 checkoutTitle: data.checkoutTitle,
95
96async function getCampaignInfo() {
97 const data = await fetchAndCacheData();
98 const linkData = data.checkoutLink.checkout_link_data;
99 return Response.json({
106
107async function getHtmlView() {
108 const data = await fetchAndCacheData();
109 const linkData = data.checkoutLink.checkout_link_data;
110 const donationGoal = linkData.donation_goal;

prompt_to_code_auto_refresh_codebedmain.tsx1 match

@trob•Updated 5 months ago
30 setIsLoading(true);
31 try {
32 const response = await fetch("/generate", {
33 method: "POST",
34 headers: { "Content-Type": "application/json" },

gptmemorymain.tsx1 match

@toowired•Updated 5 months ago
919 });
920
921 return app.fetch(req);
922};

professionalFuchsiaSmeltmain.tsx4 matches

@yuxuan•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

fetchXMLmain.tsx3 matches

@g000m•Updated 5 months ago
1import { parseXML } from "https://esm.town/v/g000m/parseXML";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL";
4
5export let fetchXML = (url: string) =>
6 fetchText(normalizeURL(url))
7 .then(parseXML);

blob_adminmain.tsx2 matches

@jasonleefrench•Updated 5 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));

DadJokesmain.tsx4 matches

@ryanchoi100•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

show_keyword_cloudmain.tsx1 match

@vip•Updated 5 months ago
7
8 useEffect(() => {
9 fetch("/keywords")
10 .then(response => response.json())
11 .then(data => setKeywords(data));

searchArXiVmain.tsx1 match

@aleaf•Updated 5 months ago
5 url.searchParams.set("start", String(start))
6 url.searchParams.set("max_results", String(max_results))
7 const response = await fetch(url)
8 const text = await response.text()
9 if (!response.ok) {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago