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=758&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 8139 results for "fetch"(1200ms)

test_concurrencyDoesntWorkmain.tsx17 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const test_concurrencyDoesntWork = (async () => {
4 const fetchDelayedResponse = async (index: number) => {
5 const start = Date.now();
6 const response = await fetch(
7 "https://api.val.town/v1/express/alp.proxyFetch1",
8 {
9 method: "POST",
19 );
20 };
21 const fetchDelayedResponseWithLoadBalancer = async (index: number) => {
22 const start = Date.now();
23 const response = await fetch(
24 `https://api.val.town/v1/express/alp.proxyFetch${index}`,
25 {
26 method: "POST",
38 console.log("w/o load balancer");
39 await Promise.all([
40 fetchDelayedResponse(1),
41 fetchDelayedResponse(2),
42 fetchDelayedResponse(3),
43 fetchDelayedResponse(4),
44 fetchDelayedResponse(5),
45 ]);
46 console.log("w/ load balancer");
47 await Promise.all([
48 fetchDelayedResponseWithLoadBalancer(1),
49 fetchDelayedResponseWithLoadBalancer(2),
50 fetchDelayedResponseWithLoadBalancer(3),
51 fetchDelayedResponseWithLoadBalancer(4),
52 fetchDelayedResponseWithLoadBalancer(5),
53 ]);
54})();

peelSessionArtistmain.tsx2 matches

@aeaton•Updated 1 year ago
1import { fetchHtmlDom } from "https://esm.town/v/aeaton/fetchHtmlDom";
2
3export async function peelSessionArtist(url) {
4 const dom = await fetchHtmlDom(url);
5 const title = dom.querySelector("h3")?.textContent.trim();
6 const bio = dom.querySelector("#bio1")?.textContent.trim();

githubEventsmain.tsx2 matches

@larsr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);

mathFactmain.tsx2 matches

@potherca•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);

fetchValTownAPImain.tsx3 matches

@pomdtr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function fetchValTownAPI(
4 apiToken: string,
5 path: string,
12 path = "/v1" + path;
13 }
14 return fetchJSON(`https://api.val.town${path}`, {
15 ...options,
16 headers: {

elevenlabsTTSmain.tsx2 matches

@ale_annini•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
14 };
15 const voiceId = "21m00Tcm4TlvDq8ikWAM"; // https://api.elevenlabs.io/v1/voices
16 const audio = await fetch(
17 `https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`,
18 {

dighimapperMultipleMapsmain.tsx2 matches

@bert•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const dighimapperMultipleMaps = (async () => {
4 const url =
5 "https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6 const reponse = await fetch(url);
7 const annotations = await reponse.json();
8 let imageIds = new Set();

getMunichSwimCapacitmain.tsx7 matches

@fgeierst•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getMunichSwimCapacit() {
21 { id: 30200, name: "Dantebad Sauna" },
22 ];
23 async function fetchCount(id) {
24 const endpoint =
25 `https://functions.api.ticos-systems.cloud/api/gates/counter?organizationUnitIds=${id}`;
26 const response = await fetch(endpoint, {
27 headers: {
28 "abp-tenantid": "69",
34 "sec-ch-ua-mobile": "?0",
35 "sec-ch-ua-platform": '"macOS"',
36 "sec-fetch-dest": "empty",
37 "sec-fetch-mode": "cors",
38 "sec-fetch-site": "cross-site",
39 },
40 referrer: "https://www.swm.de/",
51 async function populateUnits() {
52 for (let unit of organizationUnitIds) {
53 const populatedUnit = await fetchCount(unit.id);
54 unit.personCount = populatedUnit.personCount;
55 unit.maxPersonCount = populatedUnit.maxPersonCount;

loginmain.tsx2 matches

@mangadex•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
27 password: string,
28): Promise<LoginResponse> => {
29 const response = await fetch(
30 `${API_BASE_URL}/auth/login`,
31 {

listFeedmain.tsx2 matches

@mangadex•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_BASE_URL } from "https://esm.town/v/mangadex/API_BASE_URL";
3
26 return "The provided login credentials are incorrect.";
27 }
28 const response = await fetch(
29 `${API_BASE_URL}/list/${listId}/feed`,
30 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago