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/$%7Burl%7D?q=fetch&page=784&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 8158 results for "fetch"(3505ms)

getMktpTotalsmain.tsx2 matches

@sourishkrout•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getMktpTotals() {
15 "Content-Type": "application/json",
16 };
17 const response = await fetch(
18 "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery",
19 {

internalStreamThesephistComRSSmain.tsx3 matches

@coofdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const internalStreamThesephistComRSS = (async () => {
7 const { default: he } = await import("npm:he");
8 async function getRss() {
9 return fetch("https://stream.thesephist.com/?n=25")
10 .then(function (response) {
11 return response.text();
45 })
46 .catch(function (err) {
47 return "Failed to fetch page: " + err;
48 });
49 }

fetchABirdmain.tsx3 matches

@crsven•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchABird = async () => {
4 const MAX_ID = 777905;
5 const baseUrl = "https://xeno-canto.org/api/2/recordings";
6 const minAnimalId = Math.floor(Math.random() * (MAX_ID + 10));
7 const query = `?query=nr:${minAnimalId}-${minAnimalId + 10}`;
8 const response = await fetch(`${baseUrl}${query}`);
9 const json = await response.json();
10 return json.recordings[Math.floor(Math.random() * 9)];

fourchan_catalogmain.tsx2 matches

@nukeop•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const fourchan_catalog = (board: string) =>
4 fetchJSON(`https://a.4cdn.org/${board}/catalog.json`);

isCloseToCitibikeStationmain.tsx2 matches

@philherbert•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const isCloseToCitibikeStation = async ({ lon, lat }) => {
7 const dist = (station) =>
8 Math.sqrt(Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2));
9 const { data } = await fetchJSON(
10 "https://gbfs.citibikenyc.com/gbfs/en/station_information.json",
11 );

githubReposmain.tsx2 matches

@grantcuster•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stevekrouse/repos"
6);

pugmain.tsx2 matches

@wilt•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pug(
14 const { default: genCode } = await pugCodegen;
15 const pugFnStr = genCode(parser.parse(), { inlineRuntimeFunctions: true });
16 const evalResp = await fetch("https://api.val.town/v1/eval", {
17 method: "POST",
18 body: JSON.stringify({

nyChargingStationsmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const nyChargingStations = (async () => {
5 const { group } = await import("npm:d3-array");
6 const { micromark } = await import("npm:micromark");
7 const rows = await fetch(
8 "https://data.ny.gov/api/views/7rrd-248n/rows.csv?accessType=DOWNLOAD&sorting=true",
9 )

evalPost1main.tsx2 matches

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

fetchCongressTradeReportsmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function fetchCongressTradeReports({ lastRunAt }) {
5 const res = await fetchJSON(
6 "https://bff.capitoltrades.com/trades?sortBy=-pubDate",
7 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago