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=757&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 8318 results for "fetch"(1836ms)

githubEventsmain.tsx2 matches

@jamesdury•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const githubEvents = (username) =>
4 fetchJSON(
5 `https://api.github.com/users/${username}/events`
6 );

nasaAPODmain.tsx2 matches

@boisgera•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD

gitHubReleaseTrackermain.tsx2 matches

@ianvph•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 { postHogAPICapture } from "https://esm.town/v/ianvph/postHogAPICapture";
10 // gets newest release from github
11 const githubProject = "https://github.com/posthog/posthog";
12 const response = await fetch(`${githubProject}/releases.atom`);
13 const newestEntry =
14 (await parseXML(await response.text())).feed

dictmain.tsx2 matches

@suhas•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let dict = async (word: string) => {
4 const req = await fetch(
5 `https://api.dictionaryapi.dev/api/v2/entries/en/${word}`
6 );

nameNationalitymain.tsx2 matches

@axel_sb•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=axel",
6);

jsonmain.tsx2 matches

@u•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function json(url: string): Promise<any> {
4 return await (await fetch(url)).json();
5}

activitypubmain.tsx1 match

@tmcw•Updated 1 year ago
76 });
77 });
78 return app.fetch(req);
79};

visitMetabasemain.tsx2 matches

@jlast•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export function visitMetabase() {
4 const url = "https://metabase.jlast.repl.co/";
5 return fetch(url).then((res) => {
6 console.log(res);
7 // return "body" + res.body;

gpt3main.tsx3 matches

@yuval_dikerman•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gpt3 = async (prompt: string, openAiApiKey: string): Promise<string> => {
4 if (!prompt || !openAiApiKey) {
5 let cat = await fetch("https://catfact.ninja/fact");
6 let { fact } = await cat.json();
7 return Promise.reject(
9 );
10 }
11 const content = await fetch("https://api.openai.com/v1/chat/completions", {
12 method: "POST",
13 body: JSON.stringify({

redditAlertBackupmain.tsx3 matches

@bnorick•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import { redditNotifierState } from "https://esm.town/v/bnorick/redditNotifierState";
3
10 let last = state.last;
11 let matches = [];
12 let data = await fetchJSON(
13 `https://www.reddit.com/r/${subreddit}/new/.json?before=${last}`
14 );
37
38 last = data.data.children[0].data.name;
39 data = await fetchJSON(
40 `https://www.reddit.com/r/${subreddit}/new/.json?before=${last}`
41 );

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago