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=436&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 8361 results for "fetch"(1891ms)

alluringAmethystMonkeymain.tsx2 matches

@charmaine•Updated 4 months ago
42
43 try {
44 const response = await fetch(`https://www.shovel.report/api/domains/${domain}`);
45 if (!response.ok) {
46 throw new Error(`HTTP error! status: ${response.status}`);
52 };
53 } catch (error) {
54 console.error("Error fetching technologies:", error);
55 return { services: [], social_media: {} };
56 }

cerebras_codermain.tsx1 match

@amenu4aie2•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

beamingBrownMonkeymain.tsx1 match

@smail1•Updated 4 months ago
1const res = await fetch("https://api.val.town/v1/me", {
2 headers: {
3 Authorization: `Bearer ${Deno.env.get("valtown")}`,

cerebras_codermain.tsx1 match

@shreyshahi•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

hardworkingPeachRoadrunnermain.tsx1 match

@magiclink•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@magiclink•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@osamaarslan•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

getOctopusEnergyRatesmain.tsx3 matches

@metart43•Updated 4 months ago
1import { renderTable } from "https://esm.town/v/metart43/copperMongoose";
2import { fetch } from "https://esm.town/v/std/fetch";
3import process from "node:process";
4
31 console.log({ decodedUrl });
32 try {
33 const response = await fetch(decodedUrl, {
34 headers: {
35 "Authorization": "Basic " + btoa(process.env.OCTOPUS_ENERGY_API_KEY || ""),
56 const graph = renderTable(processedData);
57
58 // Assuming Response is from a Fetch API context, like in service workers or Deno
59 return new Response(graph, {
60 headers: {

inventiveIvoryFoxmain.tsx8 matches

@Ankit285001•Updated 4 months ago
17 window.addEventListener('offline', handleOffline);
18
19 fetchBusinesses();
20
21 return () => {
28 const handleOffline = () => setIsOffline(true);
29
30 const fetchBusinesses = async () => {
31 try {
32 const response = await fetch("/businesses");
33 const data = await response.json();
34 setBusinesses(data);
35 } catch (error) {
36 console.error("Error fetching businesses:", error);
37 }
38 };
46
47 try {
48 const response = await fetch("/businesses", {
49 method: "POST",
50 headers: { "Content-Type": "application/json" },
53
54 if (response.ok) {
55 fetchBusinesses();
56 setNewBusiness({ name: "", revenue: "", employees: "" });
57 }
185 });
186
187 self.addEventListener('fetch', (event) => {
188 event.respondWith(
189 caches.match(event.request)
192 return response;
193 }
194 return fetch(event.request);
195 })
196 );

businessAppmain.tsx6 matches

@Ankit285001•Updated 4 months ago
12
13 useEffect(() => {
14 fetchBusinesses();
15 }, []);
16
17 const fetchBusinesses = async () => {
18 try {
19 const response = await fetch("/businesses");
20 const data = await response.json();
21 setBusinesses(data);
22 } catch (error) {
23 console.error("Error fetching businesses:", error);
24 }
25 };
28 e.preventDefault();
29 try {
30 const response = await fetch("/businesses", {
31 method: "POST",
32 headers: { "Content-Type": "application/json" },
35
36 if (response.ok) {
37 fetchBusinesses();
38 setNewBusiness({ name: "", revenue: "", employees: "" });
39 }

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago