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=479&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 8214 results for "fetch"(1042ms)

socialDataSearchmain.tsx2 matches

@stevekrouse•Updated 5 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
4 const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
5 url.searchParams.set("query", query);
6 return await fetchJSON(url.toString(), {
7 bearer: Deno.env.get("valtown"),
8 });

visionaryPeachAspmain.tsx3 matches

@stevekrouse•Updated 5 months ago
171 // Existing API proxy logic
172 const { API_URL } = await import("https://esm.town/v/std/API_URL?v=5");
173 const { fetchJSON } = await import("https://esm.town/v/stevekrouse/fetchJSON");
174 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
175 const Authorization = req.headers.get("Authorization") as string;
176 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization } });
177 if (!meRes.ok) {
178 return new Response("Unauthorized", { status: 401 });
234 const socialDataURL = new URL("https://api.socialdata.tools/twitter/search");
235 socialDataURL.searchParams.set("query", query);
236 const socialDataResults = await fetchJSON(socialDataURL.toString(), {
237 bearer: Deno.env.get("SOCIAL_DATA_API_KEY"),
238 });

spectacularAzureAngelfishmain.tsx6 matches

@stevekrouse•Updated 5 months ago
6
7import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
8import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
9import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
10
19
20 useEffect(() => {
21 async function fetchUsageData() {
22 const response = await fetch('/usage-data');
23 const data = await response.json();
24 setUsageData(data);
25 }
26 fetchUsageData();
27 }, []);
28
132 // Existing social data proxy logic remains unchanged
133 const Authorization = req.headers.get("Authorization") as string;
134 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization } });
135 if (!meRes.ok) {
136 return new Response("Unauthorized", { status: 401 });
192 const socialDataURL = new URL("https://api.socialdata.tools/twitter/search");
193 socialDataURL.searchParams.set("query", query);
194 const socialDataResults = await fetchJSON(socialDataURL.toString(), {
195 bearer: Deno.env.get("SOCIAL_DATA_API_KEY"),
196 });

renderHTMLWithHonomain.tsx1 match

@tristanmagne•Updated 5 months ago
61
62export default async function server(req: Request): Promise<Response> {
63 return app.fetch(req);
64}

sqliteExplorerAppmain.tsx4 matches

@mparker•Updated 5 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

sharpCoralCoyotemain.tsx1 match

@tompatiger•Updated 5 months ago
5
6def get_quotes():
7 """Fetches quotes from Wikiquote."""
8
9 url = "https://en.wikiquote.org/wiki/Main_Page"

petunia_chatmain.tsx6 matches

@robertmccallnz•Updated 5 months ago
137
138 try {
139 const response = await fetch('/chat', {
140 method: 'POST',
141 headers: {
260 }
261
262 async function fetchMarketInsights() {
263 try {
264 const response = await fetch('/market-data', {
265 method: 'GET',
266 headers: { 'Accept': 'application/json' }
268
269 if (!response.ok) {
270 throw new Error('Failed to fetch market data');
271 }
272
298 }
299
300 refreshButton.addEventListener('click', fetchMarketInsights);
301 </script>
302 <footer>
368});
369
370export default app.fetch;

forEmulated1main.tsx1 match

@manyone•Updated 5 months ago
46 setIsRefining(isInitial ? false : true);
47 try {
48 const response = await fetch('/generate-landing-page', {
49 method: 'POST',
50 headers: {

LotecaV2main.tsx1 match

@maxm•Updated 5 months ago
62
63 try {
64 const resposta = await fetch(url);
65
66 if (!resposta.ok) {

md_links_resolvermain.tsx7 matches

@argimko•Updated 5 months ago
19 try {
20 isAutoProcessing.value = true;
21 const response = await fetch("/resolve-links", {
22 method: "POST",
23 headers: { "Content-Type": "application/json" },
350
351async function resolveRedirect(url: string): Promise<string> {
352 const fetchOptions = {
353 headers: {
354 "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",
357
358 try {
359 // Method 1: Fetch with manual redirect handling
360 try {
361 const response = await fetch(url, {
362 ...fetchOptions,
363 method: "HEAD",
364 redirect: "manual"
373 // Method 2: Full GET request for stubborn redirects
374 try {
375 const fullResponse = await fetch(url, {
376 ...fetchOptions,
377 method: "GET",
378 redirect: "follow"

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago