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=719&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 8148 results for "fetch"(1672ms)

postsmain.tsx2 matches

@jorrdang•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const posts = async () => {
4 const data = await fetch("https://jsonplaceholder.typicode.com/posts");
5
6 return data;

fetchJSONmain.tsx4 matches

@joey•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,
16 return JSON.parse(t);
17 } catch (e) {
18 throw new Error(`fetchJSON error: ${e.message} in ${url}\n\n"${t}"`);
19 }
20};

stopDeparturesmain.tsx2 matches

@kognise•Updated 1 year ago
1import { set } from "https://esm.town/v/std/set?v=11";
2import process from "node:process";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4import { transitCacheExpiry } from "https://esm.town/v/kognise/transitCacheExpiry";
5import { stopDeparturesCache } from "https://esm.town/v/kognise/stopDeparturesCache";
14 encodeURIComponent(globalStopId)
15 }`;
16 const json = await fetchJSON(url, {
17 headers: {
18 apiKey: process.env.transit,

githubUsermain.tsx2 matches

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

textToImageDallemain.tsx2 matches

@hootz•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const textToImageDalle = async (
12 url: string;
13 }[];
14 } = await fetchJSON(
15 "https://api.openai.com/v1/images/generations",
16 {

fetchWikipediaContentmain.tsx4 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchWikipediaContent(url) {
4 try {
5 const title = url.split("/wiki/")[1];
6 const apiUrl = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts&exintro&explaintext&format=json&origin=*&titles=${title}`;
7 const response = await fetch(apiUrl);
8 const data = await response.json();
9 const pageId = Object.keys(data.query.pages)[0];
11 return content;
12 } catch (error) {
13 console.error(`Error fetching Wikipedia content: ${error.message}`);
14 return "";
15 }

sendMessagemain.tsx2 matches

@ptn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function sendMessage(ptnKey: string, message: string) {
4 await fetch("https://app.phonetonote.com/hooks/zapier", {
5 body: JSON.stringify({
6 ptn_key: ptnKey,

getReiseauskunftDepsmain.tsx2 matches

@hanbzu•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { extractReiseauskunftDbStationCodeFromUrl } from "https://esm.town/v/hanbzu/extractReiseauskunftDbStationCodeFromUrl";
3
24 return matches;
25 }
26 return fetch(
27 `https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?${new URLSearchParams({
28 input: station,

cityLookupmain.tsx2 matches

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

getAvailableCoursesmain.tsx2 matches

@usefulthink•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseBlock } from "https://esm.town/v/usefulthink/parseBlock";
3
14 "phery[remote]": "get_kurse",
15 };
16 const res = await fetch(
17 "https://www.baederland-shop.de/schwimmschule?_=" + Date.now(),
18 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago