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%22Optional%20title%22?q=fetch&page=787&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 8481 results for "fetch"(1021ms)

getLinkAggregatorUserCountsmain.tsx2 matches

@tao_oat•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getLinkAggregatorUserCounts = (async () => {
4 const response = await fetch("https://api.fedidb.org/v1/software?limit=40");
5 const json = await response.json();
6 const lemmy = json.data.find((software) =>

untitled_jbL1ikZSmain.tsx2 matches

@pdubroy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const untitled_jbL1ikZS = (async () => {
4 const untitled_9k2u9UCG = (async () => {
5 const resp = await fetch(
6 "https://termin.samedi.de/b/kardiologie-neuhausen-nymphenburg/1/dr-med-jung-philip/erstkontakt-im-quartal--24?insuranceId=public"
7 );

lichessPgnmain.tsx2 matches

@jdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const lichessPgn = async (gameId: string) => {
4 const game = await fetch(`https://lichess.org/game/export/${gameId}`, {
5 headers: {
6 // Doesn't seem to actually want to do JSON :(

fetchTweetmain.tsx3 matches

@dpetrouk•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 async function fetchTweet(url) {
5 const tweetId = url.match(/(\d{19})/)[1];
6 const tweetUrl =
7 `https://cdn.syndication.twimg.com/tweet-result?id=${tweetId}&lang=en`;
8 const res = await fetch(normalizeURL(tweetUrl), {
9 redirect: "follow",
10 });

fetchHTMLmain.tsx3 matches

@beneskildsen•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchHTML = (async () => {
4 let f = await fetch("https://api.val.town/express/@beneskildsen.serveHTML", {
5 method: "GET",
6 headers: {

subredditExamplemain.tsx2 matches

@tfiers•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);

spellCheckTestmain.tsx3 matches

@steveb1313•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function spellCheckTest(
5 res: express.Response,
6) {
7 let response = await fetch("https://www.dnd5eapi.co/api/spells");
8 let data = await response.json();
9 let countOfSpells = data["count"];
10 let randomSpellNumber = Math.floor(Math.random() * countOfSpells);
11 let randomSpell = data["results"][randomSpellNumber];
12 let response2 = await fetch(
13 `https://www.dnd5eapi.co/api/spells/${randomSpell["index"]}`,
14 );

wikitxtmain.tsx3 matches

@sdan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wikitxt(article: string) {
4 try {
5 const wiki = await fetch(
6 `https://en.wikipedia.org/w/api.php?action=query&format=json&titles=${article}&prop=extracts&explaintext`,
7 ).then((res) => res.json());
14 }
15 catch (error) {
16 throw new Error(`Wiki fetch failed: ${error}`);
17 }
18}

noProxyExmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3export const noProxyEx = fetchText(
4 "https://www.schools.nyc.gov/docs/default-source/school-menus/2022-2023/june/pre-k---8-lunch-menu",
5 {

dateMeProfilesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { dateMeURL } from "https://esm.town/v/stevekrouse/dateMeURL";
2import { fetchTable } from "https://esm.town/v/stevekrouse/fetchTable";
3
4export const dateMeProfiles = fetchTable(
5 dateMeURL,
6);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago