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/image-url.jpg?q=fetch&page=135&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 9764 results for "fetch"(516ms)

MiniAppStarterindex.tsx2 matches

@payton•Updated 1 week ago
63});
64
65// HTTP vals expect an exported "fetch handler"
66// This is how you "run the server" in Val Town with Hono
67export default app.fetch;

MiniAppStarterimage.tsx2 matches

@payton•Updated 1 week ago
75 const fontPromises = fontsConfig.map(async (font) => {
76 const fontUrl = "https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/" + font.fontFile;
77 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer());
78 return { name: font.name, data: fontArrayBuf, weight: font.weight };
79 });
86 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
87 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`;
88 return fetch(api).then((r) => r.text());
89};
90

MiniAppStarterHome.tsx1 match

@payton•Updated 1 week ago
7
8import { Button, Input, Section } from "../components/ui.tsx";
9import { fetchUsersById } from "../util/neynar.ts";
10
11export function Home() {

MiniAppStarterfarcaster-notifications.ts1 match

@payton•Updated 1 week ago
41
42async function sendNotification(notificationDetails: any, payload: any) {
43 return await fetch(notificationDetails.url, {
44 method: "POST",
45 headers: { "Content-Type": "application/json" },

MiniAppStarterApp.tsx5 matches

@payton•Updated 1 week ago
8import { FarcasterMiniApp } from "./components/FarcasterMiniApp.tsx";
9import { Button, Section } from "./components/ui.tsx";
10import { fetchNeynarGet } from "./util/neynar.ts";
11
12export function App() {
67
68function Database() {
69 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
70 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
71 return (
72 <Section className="flex flex-col items-start gap-3 m-5">
73 {/* <h2 className="font-semibold">Database Example</h2> */}
74 <div className="">Counter value: {data}</div>
75 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>
76 Increment
77 </Button>
82function Neynar() {
83 useEffect(() => {
84 fetchNeynarGet("user/by_username?username=moe").then(console.log).catch(console.error);
85 }, []);
86

helloWorldmain.tsx2 matches

@walz•Updated 1 week ago
10 const proxiedPath = pathname.replace("/proxy/", "");
11 const targetUrl = `${BASE_URL}/${proxiedPath}`;
12 const response = await fetch(targetUrl);
13 const contentType = response.headers.get("Content-Type") ?? "application/octet-stream";
14 return new Response(response.body, { headers: { "Content-Type": contentType } });
18 `${BASE_URL}/playlist.m3u8?t=PSVsWCb29%2Bfg%2B4kxWyBn6YsMXgufL1Zc7sUKdLx2dwA2QjxDimBtuEvD8TpN1k%2F4&td=202505111141`;
19
20 const response = await fetch(url, {
21 headers: {
22 "Accept": "*/*",

test-proto-redirecttest-proto-redirect.tsx1 match

@g•Updated 1 week ago
30});
31
32export default app.fetch;

statusmonitor2 matches

@dirkviester•Updated 1 week ago
17 const start = performance.now();
18 try {
19 res = await fetch(url);
20 end = performance.now();
21 status = res.status;
27 } catch (e) {
28 end = performance.now();
29 reason = `couldn't fetch: ${e}`;
30 ok = false;
31 }

untitled-1240riecotitanMonitor.tsx5 matches

@dirkviester•Updated 1 week ago
62 try {
63 // Set a reasonable timeout
64 const response = await fetch("https://riecotitan.com", {
65 method: "GET",
66 headers: { "User-Agent": "Val.Town-UptimeMonitor/1.0" },
67 // Note: fetch in Val.Town might not support the timeout option
68 });
69
146 // In Val.Town, email might be accessed differently
147 // Using standard email send function in Val.Town
148 await fetch("https://api.val.town/v1/emails", {
149 method: "POST",
150 headers: {
168 // Create the scheduled check for website monitoring
169 // Using Val.Town's cron API
170 return await fetch("https://api.val.town/v1/me/schedules", {
171 method: "POST",
172 headers: {
212 // Note: You'll need to store the schedule ID from initScheduler to update it
213 // For now, we'll create a new schedule and let Val.Town handle duplicates
214 const response = await fetch("https://api.val.town/v1/me/schedules", {
215 method: "POST",
216 headers: {

StarterPackFeeds.cursorrules3 matches

@moe•Updated 1 week ago
239
240 // Inject data to avoid extra round-trips
241 const initialData = await fetchInitialData();
242 const dataScript = `<script>
243 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
286
2875. **API Design:**
288 - `fetch` handler is the entry point for HTTP vals
289 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
290
291

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 1 day ago

proxyFetch2 file matches

@vidar•Updated 3 days ago