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/image-url.jpg%20%22Image%20title%22?q=fetch&page=758&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 8442 results for "fetch"(823ms)

examplebotendpointmain.tsx2 matches

@mattx•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { example1 } from "https://esm.town/v/stevekrouse/example1?v=3";
3import process from "node:process";
41 type: 4,
42 data: {
43 content: `${await (await fetch(
44 "https://api.val.town/v1/eval/" +
45 encodeURIComponent(body.data.options[0].value),

airtable_get_samplemain.tsx2 matches

@mattx•Updated 1 year ago
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const airtable_get_sample = (async () => {
5 const data = await fetchJSON(
6 "https://api.airtable.com/v0/appXSrKDlwbAijRmD/All%20content/recxS2AKaE1klriwW",
7 {

gqlmain.tsx2 matches

@wilhelm•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let gql = (api, query, variables = {}) =>
4 fetch(api, {
5 method: "POST",
6 body: JSON.stringify({ query, variables }),

githubStarsmain.tsx2 matches

@sourishkrout•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function githubStars(
6 bearer?: string,
7) {
8 const { stargazers_count } = await fetchJSON(
9 `https://api.github.com/repos/${encodeURIComponent(handle)}/${
10 encodeURIComponent(repo)

getFirebaseTweetsmain.tsx2 matches

@puf•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function getFirebaseTweets() {
4 const result = await fetch("https://twitter.com/firebase");
5 console.log(result);
6}

getLemmyJwtmain.tsx1 match

@canpolat•Updated 1 year ago
7 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
8 let client = new LemmyHttp(`https://${instance}`, {
9 fetchFunction: fetch,
10 });
11 try {

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 };

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago