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/image-url.jpg%20%22Optional%20title%22?q=fetch&page=736&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 8994 results for "fetch"(1924ms)

goldCheetahmain.tsx4 matches

@matthewhu8•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

popcornmain.tsx1 match

@pomdtr•Updated 1 year ago
36});
37
38export default app.fetch;

goldTyrannosaurusmain.tsx4 matches

@archer1121•Updated 1 year ago
1// ... imports ...
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

get_gemini_modelsmain.tsx2 matches

@cotr•Updated 1 year ago
11 const API_KEY = process.env.GEMINI_API_KEY;
12
13 const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${API_KEY}`);
14
15 const data = await response.json();
22 return models;
23 } catch (error) {
24 console.error("Error fetching Gemini models:", error);
25 return [];
26 }

chocolateDovemain.tsx4 matches

@leopivatoneu•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

dailyDadJokemain.tsx2 matches

@viniciuscainelli•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

sapphireHummingbirdmain.tsx4 matches

@anyak_hemlani•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

azureBasiliskmain.tsx3 matches

@scrypticoa•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",
6 );
8}
9
10const randomJoke = await fetchRandomJoke();
11const setup = randomJoke.setup;
12const punchline = randomJoke.punchline;

bookReservationOnResymain.tsx7 matches

@kmb•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const bookReservationOnResy = async ({
145 )
146 }&password=${encodeURIComponent(params.password)}`;
147 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
148 method: "POST",
149 body: body,
167 }) => {
168 const url = `${RESY_API_URL}/3/details`;
169 const response = await fetch(url.toString(), {
170 method: "POST",
171 headers: RESY_DEFAULT_HEADERS,
192 searchParams.set("party_size", params.seats.toString());
193 searchParams.set("venue_id", params.venueId);
194 const response = await fetch(`${url}?${searchParams}`, {
195 method: "GET",
196 headers: RESY_DEFAULT_HEADERS,
212 searchParams.set("url_slug", params.slug);
213 searchParams.set("location", params.city);
214 const response = await fetch(`${url}?${searchParams}`, {
215 method: "GET",
216 headers: RESY_DEFAULT_HEADERS,
224 authToken: string;
225 }) => {
226 const response = await fetch(`${RESY_API_URL}/3/book`, {
227 method: "POST",
228 headers: {
252 venueId,
253 });
254 console.log("Fetched available slots for day", {
255 count: slots.length,
256 times: slots.map((slot) => `${slot.date.start} -> ${slot.date.end}`),

roseRoundwormmain.tsx2 matches

@arushee4•Updated 1 year ago
3 "punchline": "A cat-tastrophe.",
4};
5// Fetches a random joke.
6function fetchRandomJoke() {
7 const SAMPLE_JOKE = {
8 "setup": "What do you call a group of disorganized cats?",

TAC_FetchBasic2 file matches

@A7_OMC•Updated 3 hours ago

hn-fetch1 file match

@matija•Updated 4 hours ago