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=1032&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 11282 results for "fetch"(4589ms)

fetchWikipediaContentmain.tsx4 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchWikipediaContent(url) {
4 try {
5 const title = url.split("/wiki/")[1];
6 const apiUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&format=json&origin=*&titles=${title}`;
7 const response = await fetch(apiUrl);
8 const data = await response.json();
9 const pageId = Object.keys(data.query.pages)[0];
11 return content;
12 } catch (error) {
13 console.error(`Error fetching Wikipedia content: ${error.message}`);
14 return "";
15 }

sendMessagemain.tsx2 matches

@ptn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function sendMessage(ptnKey: string, message: string) {
4 await fetch("https://app.phonetonote.com/hooks/zapier", {
5 body: JSON.stringify({
6 ptn_key: ptnKey,

getReiseauskunftDepsmain.tsx2 matches

@hanbzu•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { extractReiseauskunftDbStationCodeFromUrl } from "https://esm.town/v/hanbzu/extractReiseauskunftDbStationCodeFromUrl";
3
24 return matches;
25 }
26 return fetch(
27 `https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?${new URLSearchParams({
28 input: station,

cityLookupmain.tsx2 matches

@bikefixe•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);

getAvailableCoursesmain.tsx2 matches

@usefulthink•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseBlock } from "https://esm.town/v/usefulthink/parseBlock";
3
14 "phery[remote]": "get_kurse",
15 };
16 const res = await fetch(
17 "https://www.baederland-shop.de/schwimmschule?_=" + Date.now(),
18 {

nasaAPODmain.tsx2 matches

@laionazeredo•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD

githubNotificationsmain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
4export async function githubNotifications() {
5 const res = await fetch("https://api.github.com/notifications?all=true", {
6 headers: {
7 Authorization: `Bearer ${process.env.GH_TOKEN}`,

nearestOpenStationmain.tsx3 matches

@johnmuyskens•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const nearestOpenStation = async ({ lon, lat }) => {
13 const {
14 data: { stations: stationInfo },
15 } = await fetch(
16 `https://gbfs.${gbfsDomain}/gbfs/en/station_status.json`
17 ).then((r) => r.json());
23 const {
24 data: { stations },
25 } = await fetch(
26 `https://gbfs.${gbfsDomain}/gbfs/en/station_information.json`
27 ).then((r) => r.json());

alphaVantageSymbolSearchmain.tsx2 matches

@sean•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/sean/fetchJSON";
2import { toQueryString } from "https://esm.town/v/sean/toQueryString";
3
16
17 try {
18 const json = await fetchJSON(
19 `https://${API_HOST}/query?${queryString}`,
20 {

getEpicTvProductmain.tsx2 matches

@marksteve•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getEpicTvProduct = async (url) => {
4 const cheerio = await import("npm:cheerio@1.0.0-rc.12");
5 const html = await (await fetch(url)).text();
6 const $ = cheerio.load(html);
7 return {

fetch-socials4 file matches

@welson•Updated 22 hours ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago