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/$%7Bart_info.art.src%7D?q=fetch&page=698&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 8476 results for "fetch"(2637ms)

json_viewerREADME.md2 matches

@vladimyr•Updated 1 year ago
8
9```ts
10import { fetch } from "https://esm.town/v/std/fetch";
11import { json_viewer } from "https://esm.town/v/stevekrouse/json_viewer";
12
13export const weatherDescription = async (params: string[]): Promise<unknown> => {
14 let data = await fetch(`https://wttr.in/${params["city"]}?format=j1`);
15 let jsonData = await data.json();
16 return json_viewer(jsonData);

playgroundmain.tsx3 matches

@easrng•Updated 1 year ago
718 if (load) {
719 try {
720 code = await (await fetch(new URL(load, "https://esm.town/v/"))).text();
721 } catch (e) {
722 code = `/*\nFailed to load '${load}': ${e}\n*/`;
754 );
755 } else {
756 const res = await fetch(API_URL + "/v1/eval", {
757 method: "POST",
758 body: JSON.stringify({
801 }
802});
803export default app.fetch;
804type Log = {
805 type: string;

newRSSItemsmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
2
3export let newRSSItems = ({ url, lastRunAt }) =>
4 fetchRSS(url)
5 .then(({ channel: { item } }) =>
6 (Array.isArray(item) ? item : [item]).filter(

newRSSItemsmain.tsx2 matches

@andrewn•Updated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
2
3export let newRSSItems = ({ url, lastRunAt }) =>
4 fetchRSS(url)
5 .then(({ channel: { item } }) =>
6 (Array.isArray(item) ? item : [item]).filter(

umbrellaRemindermain.tsx2 matches

@mojombo•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );

viewSourcemain.tsx2 matches

@reecer•Updated 1 year ago
1import { prettifyHtml } from "https://esm.town/v/neverstew/prettifyHtml";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3import { escape } from "npm:html-sloppy-escaper";
4
5export default async function viewSource(req: Request) {
6 const pathname = new URL(req.url).pathname;
7 const html = await fetchText(pathname === "/" ? "example.com" : pathname); // .then(prettifyHtml);
8 const body = `<html>
9 <head>

weatherGPTmain.tsx1 match

@dantaeyoung•Updated 1 year ago
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

sqliteExplorerAppmain.tsx3 matches

@parkerdavis•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
3import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
4import { sqlToCSV, sqlToJSON } from "https://esm.town/v/nbbaier/sqliteExportHelpers";
147});
148
149export const handler = app.fetch;
150
151export default modifyFetchHandler(passwordAuth(handler));

stevekrouse_minimalmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/react */
2import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=46";
3import { email } from "https://esm.town/v/std/email?v=11";
4import { sqlite } from "https://esm.town/v/std/sqlite";
19}
20
21export const reactExample = modifyFetchHandler(async (request: Request) => {
22 const url = new URL(request.url);
23 if (url.pathname === "/favicon.ico") return new Response(null, { status: 404 });

subscribe_to_a_substackmain.tsx1 match

@bensu•Updated 1 year ago
18};
19
20const result = await fetch("https://blog.edgeesmeralda.com/api/v1/free", {
21 "headers": {
22 "content-type": "application/json",

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago