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=723&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 8303 results for "fetch"(3763ms)

SAMPLE_JOKEmain.tsx4 matches

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

emailRandomJokemain.tsx4 matches

@fostergeorge•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;

emailRandomJokemain.tsx4 matches

@pedersenhaylie•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;

emailRandomJokemain.tsx4 matches

@amywng•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;

emailRandomJokemain.tsx4 matches

@vindema•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;

extractRandomWordsmain.tsx4 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const extractRandomWords = async (req: Request) => {
4 try {
5 const response = await fetch("https://random-word-api.herokuapp.com/word?number=1");
6 if (!response.ok) {
7 // If the response is not OK, return an error message
18 });
19 } catch (error) {
20 console.log("Error fetching random words:", error);
21
22 // Return an error message in a Response object
23 return new Response(JSON.stringify({ error: `An error occurred while fetching the random words. ${error}` }), {
24 headers: { "Content-Type": "application/json" },
25 status: 500, // Set an appropriate HTTP status code for errors

untitled_coralChinchillamain.tsx3 matches

@pujdesai•Updated 1 year ago
1export async function untitled_coralChinchilla(email: Email) {
2 async function emailRandomJoke() {
3 async function fetchRandomJoke() {
4 const response = await fetch(
5 "<https://official-joke-api.appspot.com/random_joke>",
6 );
8 }
9
10 const randomJoke = await fetchRandomJoke();
11 const setup = randomJoke.setup;
12 const punchline = randomJoke.punchline;

emailRandomJokemain.tsx3 matches

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

emailRandomJoke2main.tsx3 matches

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

untitled_orangeImpalamain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export const untitled_orangeImpala = fetchJSON(
4 "https://api.openai.com/v1/usage?date=2023-11-01",
5 {

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago