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=689&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 8667 results for "fetch"(2412ms)

isMyWebsiteDownmain.tsx2 matches

@moonbe77•Updated 1 year ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

libsqlstudio_drivermain.tsx2 matches

@pomdtr•Updated 1 year ago
61
62 async transaction(stmts: InStatement[]): Promise<DatabaseResultSet[]> {
63 const r = await fetch(`/api/batch`, {
64 method: "POST",
65 headers: {
81
82 async query(stmt: InStatement): Promise<DatabaseResultSet> {
83 const r = await fetch(`/api/execute`, {
84 method: "POST",
85 headers: {

sapphireManateemain.tsx1 match

@thecurryman•Updated 1 year ago
4
5export let isBoeing = async (airline, number) => {
6 const response = await fetch("https://www.flightstats.com/v2/flight-tracker/" + airline + "/" + number);
7 const body = await response.text();
8 const $ = cheerio.load(body);

ismyplaneaboeingmain.tsx1 match

@thecurryman•Updated 1 year ago
4
5export let isBoeing = async (airline, number) => {
6 const response = await fetch("https://www.flightstats.com/v2/flight-tracker/" + airline + "/" + number);
7 const body = await response.text();
8 const $ = cheerio.load(body);

testingmain.tsx4 matches

@samhashemi•Updated 1 year ago
1// import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// export let comments = ["hello world!"];
4
5// export let twitterJSON = ({ url, bearerToken }) =>
6// fetchJSON(
7// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
8// { headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` } },
10
11// export function handler(request: Request) {
12// let elements = fetchJSON(
13// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
14// { headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` } },
19
20export default async function(req: Request): Promise<Response> {
21 return fetch(
22 "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
23 // headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` }

btcPriceAlertmain.tsx3 matches

@omaismoe•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob?v=11";
3import { email } from "https://esm.town/v/std/email?v=9";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
5
6let currency = async (desired, base = "usd", amount = 1) => {
7 // let { rates } = await fetchJSON(`https://open.er-api.com/v6/latest/${base}`);
8 // if (rates && rates[desired.toUpperCase()]) return amount * (rates[desired.toUpperCase()]);
9 // else {
10 let { rates } = await fetchJSON("https://api.coingecko.com/api/v3/exchange_rates");
11 return amount * rates[desired.toLowerCase()]?.value / rates[base.toLowerCase()]?.value;
12};

umbrellaRemindermain.tsx2 matches

@ayush37•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );

NintendoSydmain.tsx1 match

@lirenxn•Updated 1 year ago
2
3export default async function(interval: Interval) {
4 const resp = await fetch("https://www.nintendo.com/au/nintendo-live-2024-sydney");
5 const html = await resp.text();
6 if (resp.ok) {

passkey_scriptmain.tsx1 match

@stevekrouse•Updated 1 year ago
35
36async function postJson(url, body?) {
37 return await fetch(url, {
38 method: "POST",
39 headers: { "Content-Type": "application/json" },

passkeys_demomain.tsx1 match

@stevekrouse•Updated 1 year ago
298 return c.json("success");
299});
300export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago