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=705&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 8406 results for "fetch"(1766ms)

uploadByURLmain.tsx2 matches

@stevedylandev•Updated 1 year ago
3 export default async function uploadByURL(url){
4 try {
5 const urlStream = await fetch(url)
6 const arrayBuffer = await urlStream.arrayBuffer()
7 const blob = new Blob([arrayBuffer])
9 const data = new FormData()
10 data.append("file", blob)
11 const upload = await fetch('https://api.pinata.cloud/pinning/pinFileToIPFS', {
12 method: 'POST',
13 headers: {

search_heroiconsmain.tsx1 match

@pomdtr•Updated 1 year ago
2
3export default async function(ctx: BrowserContext) {
4 const resp = await fetch("https://api.iconify.design/collection?prefix=heroicons");
5 if (!resp.ok) {
6 throw new Error(await resp.text());

glifJsonmain.tsx2 matches

@cjpais•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const glifJson = async (id: string) => {
14 const url = `https://alpha.glif.xyz/api/glifs?id=${id}`;
15 try {
16 const response = await fetch(url);
17 if (!response.ok) {
18 throw new Error(`HTTP error! status: ${response.status}`);

mgsrBotEndpointmain.tsx2 matches

@rayman•Updated 1 year ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature";
2import { formatInput } from "https://esm.town/v/rayman/formatInput";
3import { fetch } from "https://esm.town/v/std/fetch";
4import { example1 } from "https://esm.town/v/stevekrouse/example1?v=3";
5import process from "node:process";
48 content: `${
49 JSON.stringify(
50 await (await fetch(
51 "https://api.val.town/v1/eval/"
52 + encodeURIComponent(req.body.data.options[0].value),

search_user_valsmain.tsx1 match

@pomdtr•Updated 1 year ago
4export default async function(ctx: BrowserContext<{ user: string }>) {
5 const { user: userID } = ctx.params;
6 const resp = await fetch(`https://api.val.town/v1/users/${userID}/vals?limit=100`, {
7 headers: {
8 Authorization: `Bearer ${Deno.env.get("valtown")}`,

mgsrBotEndpoint2main.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature";
2import { formatInput } from "https://esm.town/v/rayman/formatInput";
3import { fetch } from "https://esm.town/v/std/fetch";
4import { example1 } from "https://esm.town/v/stevekrouse/example1?v=3";
5import process from "node:process";
66 break;
67 case "eval":
68 const evalResponse = await fetch(
69 `https://api.val.town/v1/eval/${encodeURIComponent(body.data.options[0].value)}`,
70 { headers: { "Content-Type": "application/json" } },

testUrlConstructionValmain.tsx1 match

@willthereader•Updated 1 year ago
8 const order = ["created_at DESC", "id DESC"]; // Sorting order for comments
9 const timestamp = "2024-01-19T17:00:00.000Z"; // Filtering criteria
10 const page = 1; // Page number to fetch
11 // Invoke the function from the other Val
12 const constructedUrl = ConstructReadTangleUrl2(timestamp);

untitled_jadeLizardmain.tsx2 matches

@trea•Updated 1 year ago
1import { difference } from "https://deno.land/std@0.214.0/datetime/mod.ts";
2import { decodeBase64 } from "https://deno.land/std@0.214.0/encoding/base64.ts";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
5export default async function(req: Request): Promise<Response> {
17 });
18 }
19 const release = await fetchJSON(
20 `https://api.github.com/repos/aryeohq/aryeo/releases/latest`,
21 );

atlasmain.tsx1 match

@jdan•Updated 1 year ago
33 }
34});
35export default app.fetch;

svgMapOfCountrymain.tsx2 matches

@jdan•Updated 1 year ago
20 }
21
22 const res = await fetch(mapUrl);
23 if (res.status !== 200) {
24 throw new Error(`[${res.status}] Error fetching ${mapUrl}`);
25 }
26

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago