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/$%7Bsuccess?q=fetch&page=787&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 8131 results for "fetch"(2457ms)

githubGistsmain.tsx2 matches

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

TanaPasteExamplemain.tsx1 match

@bikefixe•Updated 1 year ago
5 // a search term might've been passed in
6 // const url = https://something@domain.com?searchterm=${req.query.arg}
7 // let response = await fetch(url);
8 // const theText = JSON.parse(await response.text());
9 // continue assuming theText had been filled with response text

discordGetMembersmain.tsx2 matches

@vtdocs•Updated 1 year ago
1import { discordFetch } from "https://esm.town/v/vtdocs/discordFetch";
2
3export const discordGetMembers = async (
9 let highestId = BigInt(0);
10 while (true) {
11 const result = await discordFetch(
12 botToken,
13 `/guilds/${serverId}/members?limit=1000&after=${highestId}`,

untitled_xqPioNn3main.tsx2 matches

@root•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const untitled_xqPioNn3 = await fetch("https://www.baidu.com");

getMemain.tsx2 matches

@neverstew•Updated 1 year ago
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let getMe = fetchJSON(`https://api.val.town/v1/me`, {
5 headers: {
6 Authorization: `Bearer ${process.env.valtownToken}`,

stockPriceVizmain.tsx2 matches

@joemccourt•Updated 1 year ago
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function stockPriceViz(req: Request) {
7 const symbol = params.get("symbol");
8 const d = params.get("d");
9 const resData = await fetchJSON(
10 `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=${d}min&apikey=${process.env.alphaVantage}`,
11 );

emailMeWhenBadAirQualitymain.tsx2 matches

@logan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { set } from "https://esm.town/v/std/set?v=11";
3import { lastRun } from "https://esm.town/v/logan/lastRun";
14 throw new Error("Must define WEATHER_BIT_API_KEY in secrets");
15 }
16 const res = await fetch(
17 `https://api.weatherbit.io/v2.0/current/airquality?lat=${lat}&lon=${long}&key=${apiKey}`,
18 );

getPocketmain.tsx2 matches

@jessmartin•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function getPocket(params) {
4 return fetchJSON("https://getpocket.com/v3/get", {
5 method: "POST",
6 body: JSON.stringify(params),

cityLookupmain.tsx2 matches

@christian•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);

trpcmain.tsx2 matches

@stungeye•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function trpc(userHandle, valName) {
4 return await fetch(
5 `https://www.val.town/api/trpc/getValReferenceTypes?input={%22userHandle%22:%22${userHandle}%22,%22valName%22:%22${valName}%22}`,
6 ).then((data) => data.json());

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago