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/?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 8143 results for "fetch"(1982ms)

stableDiffusionGetmain.tsx2 matches

@calvinfo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let stableDiffusionGet = async (key, url) => {
6 "Content-Type": "application/json",
7 };
8 const res = await fetch(url, { headers });
9 return res.json();
10}

getFatCatListingsmain.tsx2 matches

@Ryan•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const getFatCatListings = async () => {
4 const meResult = await fetch(
5 "https://api-mainnet.magiceden.dev/v2/collections/degenfatcats/listings?offset=0&limit=20",
6 {

githubFollowingmain.tsx2 matches

@dharmatech•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);

githubFollowingmain.tsx2 matches

@gerard•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following
4export let githubFollowing = fetchJSON(
5 "https://api.github.com/users/stevekrouse/following"
6);

biliStreammain.tsx2 matches

@nishui•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { email } from "https://esm.town/v/std/email?v=9";
3import { set } from "https://esm.town/v/std/set?v=11";
24 for (let i = 0; i < idArray.length; i++) {
25 const id = idArray[i];
26 const request = fetch(
27 `https://api.live.bilibili.com/room/v1/Room/room_init?id=${id}`,
28 ).then((data) => data.json());

wttrJsonmain.tsx2 matches

@rwev•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrJson(location: string) {
4 // https://github.com/chubin/wttr.in#json-output
5 return (await fetch(`https://wttr.in/${location}?format=j1`)).json();
6}

bggTestmain.tsx2 matches

@clayton•Updated 1 year ago
1import { fetchXML } from "https://esm.town/v/stevekrouse/fetchXML?v=3";
2
3export const bggTest = async function () {
4 const xml = await fetchXML(
5 "https://boardgamegeek.com/xmlapi2/plays?username=acciopatronus",
6 );

duckDbJsonmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { insertDataIntoDuckDb } from "https://esm.town/v/neverstew/insertDataIntoDuckDb";
3import { getDuckDB } from "https://esm.town/v/tmcw/getDuckDB?v=1";
5export const duckDbJson = (async () => {
6 const db = await getDuckDB();
7 const r = await fetch("https://jsonplaceholder.typicode.com/todos");
8 await insertDataIntoDuckDb(db, await r.json());
9 const c = await db.connect();

rawmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function raw(val: `@${string}.${string}`) {
4 const [owner, name] = val.slice(1).split(".") as string[];
5 return fetchJSON(
6 `https://api.val.town/v1/alias/${owner}/${name}`,
7 )

runmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function run(
10 const method = data ? "POST" : "GET";
11 const body = data ? JSON.stringify({ args: data }) : undefined;
12 const response = await fetch(url, { method, headers, body });
13 return await response.json();
14}

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago