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/$%7Bsuccess?q=fetch&page=690&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 8624 results for "fetch"(1589ms)

dailyDadJokemain.tsx2 matches

@sieteunoseis•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return punchline;
7}

gsheet_callmain.tsx2 matches

@gwelinder•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {

jadeOpossummain.tsx2 matches

@tmcw•Updated 1 year ago
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { form } from "https://esm.town/v/stevekrouse/date_me_form";
3import browse from "https://esm.town/v/stevekrouse/dateme_browse";
13app.get("/faq", faq);
14app.get("/rss.xml", c => dateMeRSS(c.req as unknown as Request));
15export default modifyFetchHandler(app.fetch, {
16 style: `@media (max-width: 500px) {
17 .github-fork-ribbon {

datememain.tsx2 matches

@tmcw•Updated 1 year ago
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { form } from "https://esm.town/v/stevekrouse/date_me_form";
3import browse from "https://esm.town/v/stevekrouse/dateme_browse";
13app.get("/faq", faq);
14app.get("/rss.xml", c => dateMeRSS(c.req as unknown as Request));
15export default modifyFetchHandler(app.fetch, {
16 style: `@media (max-width: 500px) {
17 .github-fork-ribbon {

dream_interpretermain.tsx4 matches

@mattq•Updated 1 year ago
73
74 // Send the POST request
75 const response = await fetch("https://dreaminterpreteraibackend.com/dream", {
76 method: "POST",
77 headers: {
87 "Sec-Ch-Ua-Mobile": "?0",
88 "Sec-Ch-Ua-Platform": "\"macOS\"",
89 "Sec-Fetch-Dest": "empty",
90 "Sec-Fetch-Mode": "cors",
91 "Sec-Fetch-Site": "cross-site",
92 "Uid": randomUuid(),
93 "User-Agent":

insecureFetchmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1export function insecureFetch(input: string | URL | Request, init?: RequestInit) {
2 const origReq = new Request(input, init);
3 const proxyURL = new URL("https://unsecure-fetch.val-town.workers.dev");
4 proxyURL.searchParams.set("url", origReq.url);
5 const req = new Request(proxyURL, origReq);
6 return globalThis.fetch(req);
7}

fetch_impl_examplesmain.tsx6 matches

@vladimyr•Updated 1 year ago
1import { fetch as stdFetch } from "https://esm.town/v/std/fetch?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
3import { insecureFetch } from "https://esm.town/v/vladimyr/insecureFetch";
4
5let data = await fetchJSON("https://httpbun.com/get", { fetch: insecureFetch });
6console.log(data.origin);
7
8data = await fetchJSON("https://httpbun.com/get", { fetch: stdFetch });
9console.log(data.origin);
10
11data = await fetchJSON("https://httpbun.com/get");
12console.log(data.origin);

fetch_impl_examplesREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a2_shared/fetch_impl_examples

insecureFetchmain.tsx3 matches

@vladimyr•Updated 1 year ago
1export function insecureFetch(input: string | URL | Request, init?: RequestInit) {
2 const origReq = new Request(input, init);
3 const proxyURL = new URL("https://unsecure-fetch.val-town.workers.dev");
4 proxyURL.searchParams.set("url", origReq.url);
5 const req = new Request(proxyURL, origReq);
6 return globalThis.fetch(req);
7}

insecureFetchREADME.md5 matches

@vladimyr•Updated 1 year ago
1# Insecure SSL Cert Fetch
2
3This will be useful if you're getting a `invalid peer certificate: UnknownIssuer error`.
4
5If you need to make a fetch request to a website with a dubious or non-standard SSL certificate, you can use this proxy we made on Cloudflare workers (which doesn't verify SSL certs): https://unsecure-fetch.val-town.workers.dev/
6
7```ts
8import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
9
10const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
11const data = await insecureFetch(url)
12const text = await data.text();
13console.log(text)
14```
15
16Migrated from folder: a0_forks/insecureFetch

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago