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=774&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 8061 results for "fetch"(1495ms)

starWarsmain.tsx2 matches

@rendall•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

boredActivitiesmain.tsx2 matches

@healeycodes•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity"
6);

fetchPelotonWorkoutsmain.tsx3 matches

@andreterron•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const fetchPelotonWorkouts = async (user_id, session_id) => {
4 const workouts = await fetch(
5 `https://api.onepeloton.com/api/user/${user_id}/workouts?=peloton.ride&limit=50&page=0&sort_by=-created`,
6 {

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({

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago