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/$%7Bsuccess?q=fetch&page=744&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 8415 results for "fetch"(968ms)

holidaysUSmain.tsx2 matches

@testhandle•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);

githubFollowersmain.tsx2 matches

@stungeye•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function githubFollowers() {
4 let followers = await fetchJSON(
5 "https://api.github.com/users/stungeye/followers",
6 );

harryPotterDatamain.tsx3 matches

@byzantine_emperor•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// when a request comes in fetch hpotter data
4export async function harryPotterData(req: express.Request, res) {
5 try {
6 const responseData = await fetch(
7 "https://hp-api.onrender.com/api/characters",
8 );

getHolidaysmain.tsx2 matches

@ptr•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const getHolidays = (country, year = new Date().getFullYear()) => {
4 try {
5 return fetchJSON(
6 `https://date.nager.at/api/v2/publicholidays/${year}/${country}`
7 );

posthogStatusTrackermain.tsx2 matches

@ianvph•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { set } from "https://esm.town/v/std/set?v=11";
3import { postHogAPICapture } from "https://esm.town/v/ianvph/postHogAPICapture";
10 // gets newest status update from rss feed
11 const statusRSSLink = "https://status.posthog.com/history.rss";
12 const response = await fetch(statusRSSLink);
13 const newestEntry =
14 (await parseXML(await response.text())).rss.channel

replitListmain.tsx2 matches

@claytn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let replitList = (REPLIT_DB_URL, prefix) =>
4 fetch(`${REPLIT_DB_URL}?prefix=${encodeURIComponent(prefix)}`);

replitSetmain.tsx2 matches

@claytn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let replitSet = (REPLIT_DB_URL, key, value) =>
4 fetch(`${REPLIT_DB_URL}/${key}=${encodeURIComponent(value)}`, {
5 method: "POST",
6 headers: { "Content-Type": "application/x-www-form-urlencoded" },

curveMinusServermain.tsx1 match

@ralfw•Updated 1 year ago
13 app.get("/ai-plugin.json", (c) => c.text(curveMinusManifest));
14 app.get("/openapi.yaml", (c) => c.text(curveMinusOpenAPI));
15 return app.fetch(req);
16};

fetchJSONmain.tsx2 matches

@_•Updated 1 year ago
1import { fetchJSON as fetchJSON2 } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let fetchJSON = fetchJSON2;

getYoutubeLinkFromPagemain.tsx2 matches

@wilt•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getYoutubeLinkFromPage(url: string) {
4 const resp = await fetch(url);
5 const htmlText = await resp.text();
6 const match = htmlText.match(/https:\/\/youtube.com\/[^"]+/);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago