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=1227&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 13567 results for "fetch"(8429ms)

rssProxymain.tsx2 matches

@lchtao26•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/preact */
2import { fetch } from "https://esm.town/v/std/fetch";
3import { render } from "npm:preact-render-to-string";
4
24 );
25 }
26 return fetch(feedUrl);
27}

staticmain.tsx2 matches

@pomdtr•Updated 1 year ago
35
36 // we check that we are not exposing private vals
37 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
38 headers: {
39 authorization: `Bearer ${Deno.env.get("valtown")}`,
60});
61
62export default app.fetch;

cliOldmain.tsx1 match

@pomdtr•Updated 1 year ago
35});
36
37export default app.fetch;
38
39// #cli

plausiblemain.tsx1 match

@saolsen•Updated 1 year ago
1export async function track(domain: string, req: Request) {
2 await fetch("https://plausible.io/api/event", {
3 method: "POST",
4 headers: {

watchWebsitemain.tsx2 matches

@chet•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob?v=11";
3import { email } from "https://esm.town/v/std/email?v=11";
4import { fetch } from "https://esm.town/v/std/fetch";
5
6export async function watchWebsite(url: string) {
7 const newHtml = await fetch(url).then(r => r.text());
8
9 const key = "watch:" + url;

staticREADME.md1 match

@pomdtr•Updated 1 year ago
13```
14
15You can then fetch the exported string from outside val.town using:
16
17```sh

getDifficultiesmain.tsx1 match

@aryanj•Updated 1 year ago
2
3export const handler = async () => {
4 const hashrateResp = await fetch("https://mempool.space/api/v1/mining/hashrate/3y");
5 const { difficulty } = await hashrateResp.json();
6

getBlockFeesmain.tsx1 match

@aryanj•Updated 1 year ago
2
3export default async function(req: Request): Promise<Response> {
4 const blockFeesResp = await fetch("https://mempool.space/api/v1/mining/blocks/fees/3y");
5 const blockFees = await blockFeesResp.json();
6

getHashratemain.tsx1 match

@aryanj•Updated 1 year ago
2
3export const handler = async () => {
4 const resp = await fetch("https://mempool.space/api/v1/mining/hashrate/3y");
5 const { difficulty, hashrates } = await resp.json();
6

cliOldREADME.md1 match

@pomdtr•Updated 1 year ago
52```
53
54Cli vals don't have access to val town tokens. Instead of trying to replicate your valtown secrets locally, you can configure your cli vals to call your http endpoints using `fetch`.

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago