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/$%7Burl%7D?q=fetch&page=764&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 8496 results for "fetch"(1109ms)

fetchReadwiseListmain.tsx4 matches

@ofalvai•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Fetches a Readwise Reader list
4// Based on https://readwise.io/reader_api#list
5export const fetchReadwiseList = async (
6 token: string,
7 location: "new" | "later" | "archive" | "feed",
8) => {
9 return fetchJSON(
10 `https://readwise.io/api/v3/list?location=${location}`,
11 {

quotesmain.tsx2 matches

@jshawl•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const quotes = await fetchJSON(
4 "https://zenquotes.io/api/random",
5);

githubUsermain.tsx2 matches

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

createReplitDBClientmain.tsx5 matches

@claytn•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3/**
18 return {
19 get: (key) => {
20 return fetch(`${REPLIT_DB_URL}/${key}`);
21 },
22 set: (key, value) => {
23 return fetch(`${REPLIT_DB_URL}/${key}=${encodeURIComponent(value)}`, {
24 method: "POST",
25 headers: { "Content-Type": "application/x-www-form-urlencoded" },
27 },
28 delete: (key) => {
29 return fetch(`${REPLIT_DB_URL}/${key}`, { method: "DELETE" });
30 },
31 list: (prefix) => {
32 return fetch(`${REPLIT_DB_URL}?prefix=${encodeURIComponent(prefix)}`);
33 },
34 };

slackReplyToMessagemain.tsx2 matches

@naquiroz•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import process from "node:process";
3
18 // Note: `req.body.event` has information about the event
19 // like the sender and the message text
20 const result = await fetchJSON(
21 "https://slack.com/api/chat.postMessage",
22 {

valTownApiExampleValmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );

evaluationFromValExamplemain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let evaluationFromValExample = (async () => {
4 const response = await fetch(`https://api.val.town/v1/eval`, {
5 method: "post",
6 body: JSON.stringify({ code: "1 + 1" }),

rlimitmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
3
13 key = parent.userHandle + "." + parent.valName;
14 }
15 const limit = await fetchJSON(
16 `https://rlimit.com/${namespace}/${type}/${max}/${interval}/${key}`,
17 );

uidmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { handle } from "https://esm.town/v/stevekrouse/handle";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export let uid =
5 (await fetchJSON(
6 `https://api.val.town/v1/alias/${handle}`,
7 )).id;

fetchTablemain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { parseTable } from "https://esm.town/v/stevekrouse/parseTable";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
3
4export let fetchTable = (url) =>
5 fetchText(url).then(parseTable);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago