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/$%7Burl%7D?q=fetch&page=775&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 8300 results for "fetch"(1209ms)

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 {

callIftttMakerWebhookmain.tsx2 matches

@xkonti•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const callIftttMakerWebhook = async (event: string, key: string) => {
4 await fetch(`https://maker.ifttt.com/trigger/${event}/json/with/key/${key}`);
5};

sendNtfymain.tsx2 matches

@spuckydaslama•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const sendNtfy = async (topic: string, data: {
7 isMarkdown: boolean;
8}) => {
9 const response = await fetch(`https://ntfy.sh/${topic}`, {
10 method: "POST",
11 body: data.body,

updateTicketCoordinatormain.tsx3 matches

@ytf•Updated 1 year ago
26 // InitializeSlack API client
27 const client = new WebClient(slackAccessToken, { logLevel: LogLevel.WARN });
28 // Fetch all users
29 const result = await client.users.list({ team_id: teamId });
30 let users = result.members;
35 );
36 console.log(`Found ${users.length} users in team ${teamId}`);
37 // Fetch extended user profiles with custom fields and filter only coordinators
38 const profiles = await Promise.all(users.map(async (user) => {
39 const result = await client.users.profile.get({ user: user.id });
45 };
46 }));
47 console.log(`Fetched ${profiles.length} profiles in team ${teamId}`);
48 const ticketsCoordinators = profiles.filter((profile) =>
49 profile.ticketsCoordinator

testApimain.tsx2 matches

@andreterron•Updated 1 year ago
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3import process from "node:process";
4
12 },
13 };
14 const me = await fetchJSON(
15 "https://api.val.town/v1/me",
16 opts,

citiBikeSpotCheckermain.tsx4 matches

@ggarnhart•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const citiBikeSpotChecker = async (req, res) => {
5 const { data } = await fetch(
6 "https://gbfs.citibikenyc.com/gbfs/en/station_status.json"
7 ).then((r) => r.json());
17 const {
18 data: { stations: stationInfo },
19 } = await fetchJSON(
20 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json"
21 );

githubReposmain.tsx2 matches

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

dailyCatmain.tsx2 matches

@cole•Updated 1 year ago
1import { fetchCat } from "https://esm.town/v/cole/fetchCat";
2
3export let dailyCat = async () => {
4 const url = fetchCat();
5 const html = `Here's a random cat: <img src="${url}">`;
6 console.email({ html }, "random cat");

blocksmain.tsx3 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let blocks = async (req, res) => {
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago