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/$%7Bart_info.art.src%7D?q=fetch&page=739&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 8186 results for "fetch"(1440ms)

openstreetmapAPIexamplemain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const openstreetmapAPIexample = (async () => {
4 return (await fetch("https://api.openstreetmap.org/api/0.6/node/1", {
5 headers: { accept: "application/json" },
6 })).json();

notionValLinkTweetmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchTweet } from "https://esm.town/v/dpetrouk/fetchTweet?v=35";
2
3export let notionValLinkTweet =
4 (await fetchTweet(
5 "https://twitter.com/stevekrouse/status/1686075940076449792",
6 )).text;

pollVulkanRSSFeedBugmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
3
4export const pollVulkanRSSFeedBug = (async () => {
5 const githubProject = "https://github.com/KhronosGroup/Vulkan-Docs";
6 const response = await fetch(`${githubProject}/commits.atom`);
7 const feed =
8 (await parseXML(await response.text())).feed;

getDiscordMessagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordFetch } from "https://esm.town/v/stevekrouse/discordFetch";
2
3export let getDiscordMessages = (token, channelId) => discordFetch(
4 token,
5 `channels/${channelId}/messages`,

fetchXMLmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
2import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
4
5export let fetchXML = (url: string) =>
6 fetchText(normalizeURL(url))
7 .then(parseXML);

runValmain.tsx2 matches

@std•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_URL } from "https://esm.town/v/std/API_URL";
3
4export function runVal(name, ...args) {
5 return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
6 method: "POST",
7 body: JSON.stringify({

proxyFetch9main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch9 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};

hnFollowPollJobmain.tsx2 matches

@sunkid•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function hnFollowPollJob({ lastRunAt }) {
4 untitled6313446 = fetch(
5 "https://market-backend.api.2gis.ru/5.0/product/items?q=water&point1=37.87550034485333,51.32652258650344&point2=37.94900977933917,51.293266520365684&locale=ru_RU&page=1&page_size=12&feature_config=categories_without_fake_first_level,range_price_type_supported,from_price_type_supported"
6 );

emailNowcastPMAqimain.tsx2 matches

@russbiggs•Updated 1 year ago
1import { nowcastPMAqi } from "https://esm.town/v/russbiggs/nowcastPMAqi";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let emailNowcastPMAqi = async () => {
6 const dateTo = new Date();
7
8 let res = await fetchJSON(
9 "https://api.openaq.org/v2/measurements?" +
10 new URLSearchParams({

rrpmain.tsx2 matches

@dharmatech•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let rrp = fetchJSON(
4 "https://markets.newyorkfed.org/api/rp/reverserepo/propositions/search.json?startDate=2022-05-01"
5);

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago