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=730&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 8085 results for "fetch"(1427ms)

likesmain.tsx2 matches

@neverstew•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 function likes({ token, offset, limit }: {
25 };
26}> {
27 return fetchJSON(
28 "https://api.val.town/v1/me/likes?" + searchParams({
29 offset: offset?.toString(),

subredditExamplemain.tsx2 matches

@park•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Reddit recent posts from /r/aww (cute animals)
4export let subredditExample = fetchJSON(
5 "https://www.reddit.com/r/aww/.json"
6);

aqimain.tsx2 matches

@axelav•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let res = await fetchJSON(
5 "https://api.openaq.org/v2/latest?" +
6 new URLSearchParams({

filemain.tsx2 matches

@easrng•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const file = async (req: Request): Promise<Response> =>
4 new Response((await fetch("file:" + new URL(req.url).pathname)).body, {
5 headers: { "Content-Type": "text/plain" },
6 });

milmain.tsx2 matches

@insanity54•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const mil = async () => {
4 const json = await fetchJSON(
5 "https://www.coingecko.com/nft/milady-maker/chart.json?currency=eth&days=1",
6 );

aqimain.tsx2 matches

@cfab•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({

TV_SHOW_NEW_EPISODE_NOTIFIERmain.tsx2 matches

@andreterron•Updated 1 year ago
2import { TV_SHOWS_WATCHED } from "https://esm.town/v/U9G/TV_SHOWS_WATCHED?v=2";
3let { LAST_TV_HASHES } = await import("https://esm.town/v/U9G/LAST_TV_HASHES?v=1");
4import { fetchJSON } from "https://esm.town/v/U9G/fetchJSON?v=1";
5
6export let TV_SHOW_NEW_EPISODE_NOTIFIER = async () => {
7 const makeReqTo = (url) =>
8 fetchJSON(url, {
9 headers: {
10 "trakt-api-key": "Mock",

sortedPostsmain.tsx3 matches

@andreterron•Updated 1 year ago
1import { fetchTwitterUser } from "https://esm.town/v/andreterron/fetchTwitterUser";
2
3export async function sortedPosts({ accessToken, posts }: {
16 posts.slice(0, 4).map(async (post) => {
17 try {
18 const author = await fetchTwitterUser({
19 id: post.author_id,
20 accessToken,
27 }
28 catch (e) {
29 console.log("Failed to fetch user", post.author_id, q);
30 console.error(e);
31 return undefined;

wee1main.tsx2 matches

@val•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/val/fetchJSON";
2
3export let wee1 = fetchJSON(
4 "https://api.val.town/express/@val.wee2",
5 {

untitled_pinkDamselflymain.tsx2 matches

@dpetrouk•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/dpetrouk/fetchJSON";
2
3export let untitled_pinkDamselfly = async () => {
4 return await fetchJSON(
5 "https://twitter.com/__drewface/status/1664273547764830208?s=20",
6 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago