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/$%7Bart_info.art.src%7D?q=fetch&page=742&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 8163 results for "fetch"(3700ms)

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 );

githubStarredmain.tsx2 matches

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

starWarsmain.tsx2 matches

@kallev•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

isUpmain.tsx2 matches

@brenton•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
7 options?: any
8) => {
9 let f = await fetch(normalizeURL(url), {
10 redirect: "follow",
11 ...(options || {}),

bookReservationOnResymain.tsx7 matches

@alp•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const bookReservationOnResy = async ({
143 params.email
144 )}&password=${encodeURIComponent(params.password)}`;
145 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
146 method: "POST",
147 body: body,
165 }) => {
166 const url = `${RESY_API_URL}/3/details`;
167 const response = await fetch(url.toString(), {
168 method: "POST",
169 headers: RESY_DEFAULT_HEADERS,
190 searchParams.set("party_size", params.seats.toString());
191 searchParams.set("venue_id", params.venueId);
192 const response = await fetch(`${url}?${searchParams}`, {
193 method: "GET",
194 headers: RESY_DEFAULT_HEADERS,
210 searchParams.set("url_slug", params.slug);
211 searchParams.set("location", params.city);
212 const response = await fetch(`${url}?${searchParams}`, {
213 method: "GET",
214 headers: RESY_DEFAULT_HEADERS,
222 authToken: string;
223 }) => {
224 const response = await fetch(`${RESY_API_URL}/3/book`, {
225 method: "POST",
226 headers: {
247 venueId,
248 });
249 console.log("Fetched available slots for day", {
250 count: slots.length,
251 times: slots.map((slot) => `${slot.date.start} -> ${slot.date.end}`),

ipmain.tsx2 matches

@hanu•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/hanu/fetchJSON";
2
3export let ip = await fetchJSON("https://api.ipify.org?format=json");

geolocationmain.tsx1 match

@juliendorra•Updated 1 year ago
1export let geolocation = async (req, res) => {
2 const ip = req.options.headers["x-forwarded-for"];
3 const jsonresponse = await $stevekrouse.fetchJSON(
4 `http://ip-api.com/json/${ip}`
5 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago