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=761&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 8302 results for "fetch"(1148ms)

fetchGiphymain.tsx3 matches

@simply_say_m•Updated 1 year ago
1import process from "node:process";
2
3export const fetchGiphy = (async (searchTerm) => {
4 const { GiphyFetch } = await import("npm:@giphy/js-fetch-api");
5 const gf = new GiphyFetch(process.env.giphyApiKey);
6 const { data: gifs } = await gf.search(searchTerm, { limit: 10 });
7 return gifs;

proxyFetch10main.tsx5 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch10 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};

nameNationalitymain.tsx2 matches

@feep•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=michael"
6);

pingReplitmain.tsx2 matches

@dr0•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pingReplit() {
4 fetch("https://lookup.icxk.top/imgs/36x36.png");
5}

redirectmain.tsx2 matches

@thomasatflexos•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
19 const token = process.env.OAUTH_CLIENT_ID + ":" +
20 process.env.OAUTH_CLIENT_SECRET;
21 const response = await fetch("https://api.notion.com/v1/oauth/token", {
22 method: "POST",
23 headers: {

githubReposmain.tsx2 matches

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

aqimain.tsx2 matches

@lavallee•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({

FigmaFileObjectAsyncmain.tsx2 matches

@rodrigotello•Updated 1 year ago
1import { fetchFigmaFile } from "https://esm.town/v/rodrigotello/fetchFigmaFile";
2import { FigmaURLJSONexample } from "https://esm.town/v/rodrigotello/FigmaURLJSONexample";
3import process from "node:process";
6 const apiToken = process.env.myFigmaAPIToken;
7 const fileKey = FigmaURLJSONexample.key;
8 return fetchFigmaFile(apiToken, fileKey);
9})();

imBoredmain.tsx2 matches

@valbee•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2let { boredActivities } = await import("https://esm.town/v/valbee/boredActivities");
3
4export const imBored = async () => {
5 return (boredActivities = fetchJSON(
6 "https://www.boredapi.com/api/activity"
7 ));

githubFollowersmain.tsx2 matches

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

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago