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=628&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 9269 results for "fetch"(1437ms)

flutteringVioletBirdmain.tsx1 match

@stevekrouse•Updated 7 months ago
12 setIsLoading(true);
13 try {
14 const response = await fetch("https://esm.town/v/stevekrouse/openai", {
15 method: "POST",
16 headers: { "Content-Type": "application/json" },

Vixmain.tsx3 matches

@aquapi•Updated 7 months ago
13}
14
15const fetch = composeResponse({})(uwu.unwrap());
16console.timeEnd("Startup 500 routes");
17
18console.log(fetch.toString());
19
20export default fetch;

studenthousemain.tsx2 matches

@jacobhthomas•Updated 7 months ago
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { form } from "https://esm.town/v/stevekrouse/date_me_form";
3import browse from "https://esm.town/v/stevekrouse/dateme_browse";
13app.get("/faq", faq);
14app.get("/rss.xml", c => dateMeRSS(c.req as unknown as Request));
15export default modifyFetchHandler(app.fetch, {
16 style: `@media (max-width: 500px) {
17 .github-fork-ribbon {

runescapeWoodCuttingmain.tsx5 matches

@charmaine•Updated 7 months ago
44
45 useEffect(() => {
46 fetchLeaderboard();
47 }, []);
48
49 const fetchLeaderboard = async () => {
50 const response = await fetch("?action=leaderboard");
51 const data = await response.json();
52 setLeaderboard(data);
66 }
67
68 await fetch("?action=update", {
69 method: "POST",
70 body: JSON.stringify({ name: playerName, xp: newXp, level: newLevel }),
71 });
72
73 fetchLeaderboard();
74 };
75

denoGameHTMLmain.tsx3 matches

@jongreer•Updated 7 months ago
121 "https://api.val.town/v1/run/rodrigotello.updateDinoScoreboard";
122
123 fetch(apiUrl, {
124 method: "POST",
125 headers: {
139 .then((result) => {
140 console.log("Scoreboard updated:", result);
141 // Update the scoreboard variable with the fetched data
142 scoreboard = result;
143 })
157 text("Press SPACE to play again", width / 2, height / 2 + 10);
158
159 // Fetch the latest scoreboard data
160 const apiUrl =
161 "https://api.val.town/v1/run/rodrigotello.dinoGameScoreboard";

createAllHighLlightJsLanguagesmain.tsx2 matches

@mikaello•Updated 7 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { waterCSS } from "https://esm.town/v/stevekrouse/waterCSS?v=1";
3import { html as html2 } from "https://esm.town/v/stevekrouse/html?v=5";
6export let createAllHighLlightJsLanguages = async (req: Request) => {
7 if (req.method === "POST") {
8 const response = await fetch("https://highlightjs.org/demo");
9 const html = await response.text();
10 const { DOMParser } = await import(

groceriesmain.tsx9 matches

@efoley•Updated 7 months ago
8
9 useEffect(() => {
10 fetchItems();
11 }, []);
12
13 const fetchItems = async () => {
14 const response = await fetch("/items");
15 const data = await response.json();
16 setItems(data);
19 const handleAddItem = async () => {
20 if (newItem.trim() === "") return;
21 await fetch("/items", {
22 method: "POST",
23 headers: { "Content-Type": "application/json" },
25 });
26 setNewItem("");
27 fetchItems();
28 };
29
35
36 const removeItem = async (id) => {
37 await fetch(`/items/${id}`, { method: "DELETE" });
38 fetchItems();
39 };
40
41 const clearList = async () => {
42 await fetch("/items", { method: "DELETE" });
43 fetchItems();
44 };
45

createFlashcardsValmain.tsx5 matches

@reginafoley•Updated 7 months ago
16
17 useEffect(() => {
18 fetchCSV();
19 }, []);
20
25 }, [flashcards]);
26
27 const fetchCSV = async () => {
28 const response = await fetch("/csv");
29 const csvText = await response.text();
30 const result = Papa.parse(csvText, { header: false });
57 const formData = new FormData();
58 formData.append("csv", file);
59 const response = await fetch("/upload", {
60 method: "POST",
61 body: formData,
63 if (response.ok) {
64 alert("File uploaded successfully!");
65 fetchCSV();
66 } else {
67 alert("Error uploading file.");

generateDailyTwitterEmailmain.tsx3 matches

@Joelsrubin•Updated 7 months ago
1import { email } from "https://esm.town/v/std/email";
2
3async function fetchTweets(listId: string): Promise<any[]> {
4 const url = `https://news.ycombinator.com/`;
5 const response = await fetch(url);
6 const html = await response.text();
7 console.log(html);
27export default async function(interval: Interval) {
28 const listId = "1359390628841480192";
29 const tweets = await fetchTweets(listId);
30
31 // Sort tweets by likes and get top 10

randomTextGeneratormain.tsx1 match

@aleaf•Updated 7 months ago
11 const generateText = async () => {
12 setLoading(true);
13 const response = await fetch(`?paragraphs=${paragraphs}`);
14 const result = await response.text();
15 setText(result);

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago