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=744&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 7887 results for "fetch"(1073ms)

boredActivitiesmain.tsx2 matches

@hetzelhouse•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);

untitled_magentaBaboonmain.tsx1 match

@jora_cody•Updated 1 year ago
1export let untitled_magentaBaboon = async () => {
2 // const cheerio = await import("npm:cheerio");
3 // const request = await fetch("https://woolworths.com.au");
4 // const $ = cheerio.load(request.body);
5 return new Response(`<h1>Hi!</h1>`, {

runPostSaveMessagemain.tsx2 matches

@chris_symbiote•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const runPostSaveMessage = (async () => {
4 const response = await fetch(
5 "https://chris_symbiote-postSaveMessage.express.val.run",
6 {

tidbytDeviceInstallationsmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function tidbytDeviceInstallations({ deviceId, apiKey }: {
5 apiKey: string;
6}) {
7 return fetchJSON(
8 `https://api.tidbyt.com/v0/devices/${deviceId}/installations`,
9 {

referencesmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function references({ token, since, until, offset, limit }: {
23 "referencedAt": string;
24}[]> {
25 const res = await fetchJSON(
26 "https://api.val.town/v1/me/references?" +
27 searchParams({

fetchJSONmain.tsx4 matches

@val•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL?v=3";
3
4export const fetchJSON = async (url: string, options?: any) => {
5 let f = await fetch(normalizeURL(url), {
6 redirect: "follow",
7 ...options,
15 return JSON.parse(t);
16 } catch (e) {
17 throw new Error(`fetchJSON error: ${e.message} in ${url}\n\n"${t}"`);
18 }
19};

umbrellaRemindermain.tsx2 matches

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

quotemain.tsx2 matches

@nfelger•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let quote = (async () => {
4 const quotes = await fetchJSON(
5 "https://zenquotes.io/api/random/"
6 );

initialCommitmain.tsx3 matches

@jshawl•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let initialCommit = async (org, repo) => {
4 const repoData = await fetchJSON(
5 `https://api.github.com/repos/${org}/${repo}`
6 );
7 const { created_at } = repoData;
8 const until = new Date(Date.parse(created_at) + 600).toISOString();
9 const json = await fetchJSON(
10 `https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
11 );

getUrlContentmain.tsx2 matches

@libo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getUrlContent = (async () => {
6 );
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago