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?q=fetch&page=760&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 8419 results for "fetch"(955ms)

tradestationMarginsmain.tsx2 matches

@simoneUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let { tradestationMarginsState } = await import("https://esm.town/v/simone/tradestationMarginsState");
13 async function loadTradestationData() {
14 const cheerio = await import("npm:cheerio");
15 const response = await fetch(
16 "https://www.tradestation.com/pricing/futures-margin-requirements/"
17 );

timemain.tsx2 matches

@vsUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function time() {
4 return await fetchJSON(
5 "https://api.openaq.org/v2/latest?" +
6 new URLSearchParams({

githubFollowersmain.tsx2 matches

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

getTangleCommentsmain.tsx3 matches

@willthereaderUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { email } from "https://esm.town/v/std/email?v=9";
3
4export async function getTangleComments({ lastRunAt }) {
5 let response = await fetch(
6 "https://www.readtangle.com/members/api/comments/?limit=5&order=created_at%20DESC%2C%20id%20DESC&filter=post_id%3A6525827c68f969000134e052%2Bcreated_at%3A%3C%3D2023-10-13T20%3A55%3A23.163Z&page=2",
7 );
8 let commentsData = await response.json();
9 console.log("Fetched Data:", commentsData);
10 console.log(commentsData);
11 const newComments = commentsData.comments.filter((comment) =>

webhook1main.tsx2 matches

@csshshUpdated 1 year ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS?v=12";
2
3export let webhook1 = async (a) => {
4 const response = await fetchRSS(a);
5 return "asd";
6};

chatmain.tsx1 match

@marioUpdated 1 year ago
27 li.innerHTML = '<span class="font-semibold text-gray-900">' + sender + '</span>: ' + message;
28 ul.appendChild(li)
29 fetch("https://api.val.town/eval/@nimalu.sendChatMessage('" + message + "','"+ sender + "')")
30 }
31
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
6 res: express.Response,
7) {
8 let response = await fetch("https://api.onepeloton.com/auth/login", {
9 method: "POST",
10 mode: "no-cors",
20 });
21 const session = await response.json();
22 let workoutResponse = await fetch(
23 `https://api.onepeloton.com/api/user/${session["user_id"]}/workouts`,
24 {

fetchCongressTradeReportsmain.tsx4 matches

@claytnUpdated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3/**
5 Receive daily emails of reported congress trades by scheduling a call to
6
7 @claytn.fetchCongressTradeReports((reports) => console.email(reports))
8*/
9
10
11export async function fetchCongressTradeReports(callback) {
12 const res = await fetchJSON(
13 "https://bff.capitoltrades.com/trades?sortBy=-pubDate"
14 );

checkBPPRequirementmain.tsx3 matches

@lbb00Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function checkBPPRequirement(imageUrl, minWidth, minHeight) {
4 try {
5 const response = await fetch(imageUrl);
6 const buffer = await response.arrayBuffer();
7 const totalPixels = minWidth * minHeight;
23 }
24 catch (error) {
25 console.error("❌ Error fetching image:", error.message);
26 }
27}

getTrainsmain.tsx3 matches

@briscoeUpdated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getTrains = (async () => {
4 const skerries = await fetch(
5 "https://irish-rail-rest-api.fly.dev/stations/SKRES/timetable",
6 ).then((res) => res.json());
7 const connolly = await fetch(
8 "https://irish-rail-rest-api.fly.dev/stations/CNLLY/timetable",
9 ).then((res) => res.json());

fetchPaginatedData2 file matches

@nbbaierUpdated 2 weeks ago

FetchBasic1 file match

@fredmoonUpdated 2 weeks ago