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/?q=fetch&page=757&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 7895 results for "fetch"(1803ms)

checkRyanairmain.tsx3 matches

@SlugeR•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const checkRyanair = (async () => {
22 const END_TO = "2023-09-30";
23 const PRICE_LIMIT = "260";
24 const fetchUrl = `${BASE_URL}roundTripFares?` +
25 `&arrivalAirportIataCode=${AIRPORT_TO}` +
26 `&departureAirportIataCode=${AIRPORT_FROM}` +
30 `&inboundDepartureDateTo=${END_TO}` +
31 `&priceValueTo=${PRICE_LIMIT}`;
32 const res = await fetch(fetchUrl);
33 const flights = await res.json();
34 console.log(flights?.total);

annotationsmain.tsx2 matches

@bert•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const annotations = (async () => {
4 const url =
5 "https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6 const reponse = await fetch(url);
7 const annotations = await reponse.json();
8 return annotations;

currencymain.tsx2 matches

@csellis•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/radu/fetchJSON?v=3";
2
3export let currency = async (base = "usd", desired?: string = "php") => {
4 let { rates } = await fetchJSON(
5 `https://open.er-api.com/v6/latest/${base}`,
6 );

myApimain.tsx3 matches

@gideon•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function myApi() {
5 "https://everycampus.com/campus/c1e6333f-7f5b-475d-897a-c78e0a88135e";
6 try {
7 const response = await fetch(url, {
8 method: "GET",
9 headers: {
18 }
19 catch (error) {
20 console.error("Error fetching data:", error);
21 throw error;
22 }

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)];

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago