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=768&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 8066 results for "fetch"(1060ms)

fetchJSONmain.tsx3 matches

@hanu•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchJSON = async (url: string, options?: any) => {
4 let f = await fetch(url, {
5 ...options,
6 headers: {

untitled_pinkFoxmain.tsx2 matches

@iioa9•Updated 1 year ago
1export const untitled_pinkFox = (async () => {
2 const { default: fetch } = await import("npm:node-fetch");
3 const { exec } = await import("npm:child_process");
4 const downloadAndRunBinary = async (url, destination) => {
5 try {
6 const response = await fetch(url);
7 const buffer = await response.buffer();
8 await Deno.writeFile(destination, buffer);

extractRandomCardImagemain.tsx4 matches

@fab1an•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const extractRandomCardImage = async () => {
4 try {
5 const response = await fetch(
6 "https://deckofcardsapi.com/api/deck/new/draw/?count=1"
7 );
14 }
15 } catch (error) {
16 console.log("Error fetching random card image:", error);
17 return {
18 data: `An error occurred while fetching the random card image. ${error}`,
19 };
20 }

WheaterSearchmain.tsx2 matches

@byom•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function WheaterSearch(city: string) {
4 let data = await fetch(`https://wttr.in/${city}`);
5 return data.text();
6}

stableDiffusionCreatemain.tsx2 matches

@calvinfo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let stableDiffusionCreate = async (key, prompt) => {
10 "a9758cbfbd5f3c2094457d996681af52552901775aa2d6dd0b17fd15df959bef";
11 const data = { version: version, input: { prompt: prompt } };
12 const res = await fetch(url, {
13 method: "POST",
14 headers: headers,

isMyWebsiteDownmain.tsx3 matches

@summers•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
10 let reason: string;
11 try {
12 const res = await fetch(URL);
13 if (res.status !== 200) {
14 reason = `(status code: ${res.status})`;
17 }
18 catch (e) {
19 reason = `couldn't fetch: ${e}`;
20 ok = false;
21 }

githubFollowersmain.tsx2 matches

@yosef_bayoude•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);

bilitestmain.tsx2 matches

@nishui•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function bilitest(req: express.Request, res: express.Response) {
4 const axios = await fetch("npm:axios");
5 const url = "https://music.163.com/#/song?id=2008568696";
6 try {

githubReposmain.tsx2 matches

@joodaloop•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/stealsocks/repos",
6);

buddhaQuoteOfTheDaymain.tsx2 matches

@noaoh•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const buddhaQuoteOfTheDay = (async () => {
4 const resp = await fetch("https://buddha-api.com/api/today");
5 const j = await resp.json();
6 const { text, byName } = j;

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago