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%20%22Image%20title%22?q=fetch&page=786&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 8302 results for "fetch"(1706ms)

referencesmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function references({ token, since, until, offset, limit }: {
23 "referencedAt": string;
24}[]> {
25 const res = await fetchJSON(
26 "https://api.val.town/v1/me/references?" +
27 searchParams({

fetchJSONmain.tsx4 matches

@val•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL?v=3";
3
4export const fetchJSON = async (url: string, options?: any) => {
5 let f = await fetch(normalizeURL(url), {
6 redirect: "follow",
7 ...options,
15 return JSON.parse(t);
16 } catch (e) {
17 throw new Error(`fetchJSON error: ${e.message} in ${url}\n\n"${t}"`);
18 }
19};

umbrellaRemindermain.tsx2 matches

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

quotemain.tsx2 matches

@nfelger•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let quote = (async () => {
4 const quotes = await fetchJSON(
5 "https://zenquotes.io/api/random/"
6 );

initialCommitmain.tsx3 matches

@jshawl•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let initialCommit = async (org, repo) => {
4 const repoData = await fetchJSON(
5 `https://api.github.com/repos/${org}/${repo}`
6 );
7 const { created_at } = repoData;
8 const until = new Date(Date.parse(created_at) + 600).toISOString();
9 const json = await fetchJSON(
10 `https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
11 );

getUrlContentmain.tsx2 matches

@libo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getUrlContent = (async () => {
6 );
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url

getPoolTimesmain.tsx2 matches

@briscoe•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getPoolTimes = (async () => {
12 ];
13 const cheerio = await import("npm:cheerio");
14 const response = await fetch(
15 "https://www.swanleisure.ie/timetables?type=pool",
16 );

cityLookupmain.tsx2 matches

@rafter•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);

elysiaExamplemain.tsx1 match

@tmcw•Updated 1 year ago
3 const app = new Elysia()
4 .get("/", () => "Hello Elysia");
5 return app.fetch(req);
6};

runsmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export function runs({ token, error, source, since, until, offset, limit }: {
34 };
35}> {
36 return fetchJSON(
37 "https://api.val.town/v1/me/runs?" + searchParams({
38 error: error?.toString(),

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago