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=1296&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 16340 results for "fetch"(4101ms)

getIPmain.tsx2 matches

@bansal•Updated 7 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3let result = await fetch("https://api64.ipify.org?format=json");
4let json = await result.json();
5console.log(json.ip);

cerebras_codermain.tsx1 match

@caseyg•Updated 7 months ago
36
37 try {
38 const response = await fetch("/", {
39 method: "POST",
40 body: JSON.stringify({ prompt, currentCode: code }),

kickstart_feedbackmain.tsx5 matches

@bansal•Updated 7 months ago
93 }
94
95 fetch("/airtable-data")
96 .then(response => response.json())
97 .then(data => {
138
139 try {
140 const response = await fetch("/upvote", {
141 method: "POST",
142 headers: {
364 const { recordId, currentUpvotes } = await request.json();
365
366 const updateResponse = await fetch(
367 `https://api.airtable.com/v0/${BASE_ID}/${TABLE_NAME}/${recordId}`,
368 {
396 }
397
398 // Existing data fetch endpoint
399 if (request.url.includes("/airtable-data")) {
400 try {
401 const response = await fetch(
402 `https://api.airtable.com/v0/${BASE_ID}/${TABLE_NAME}`,
403 {

bskymain.tsx1 match

@daisuke•Updated 7 months ago
8 const url = "https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=dai.bsky.social&filter=posts_no_replies";
9
10 const data: Feed = await fetch(url).then((r) => r.json());
11
12 return new Response(

encouragingAmethystTickmain.tsx3 matches

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

amicableAquamarinePanthermain.tsx4 matches

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

CS1200main.tsx4 matches

@timpineda•Updated 7 months 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;

constantTomatoTarantulamain.tsx3 matches

@henrique056•Updated 7 months 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;

CS1200Projmain.tsx5 matches

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

readablemain.tsx1 match

@neverstew•Updated 7 months ago
3
4export default async function(req: Request) {
5 let resp = await fetch(`https://${new URL(req.url).pathname.replace(/^https?:\/\//, '')}`, req);
6 let body = await resp.text();
7 let doc = new JSDOM(body);

readwise-instapaper1 file match

@welson•Updated 3 days ago
Fetches my articles from Readwise. Syncs with/ Neon + Instapaper

manual-fetcher

@miz•Updated 2 weeks ago