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=1275&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 13481 results for "fetch"(1141ms)

todosPlaceholdermain.tsx2 matches

@pomdtr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const todosPlaceholder = (async () => {
4 const resp = await fetch("https://jsonplaceholder.typicode.com/todos");
5 return resp.json();
6})();

chatmain.tsx1 match

@nimalu•Updated 1 year ago
24 document.getElementById("message-input").value = '';
25 const ul = document.getElementById("inbox");
26 const data = await fetch("https://api.val.town/eval/@nimalu.sendChatMessage('" + message + "','"+ sender + "')")
27 .then(res => res.json())
28 .then(res => res.data)

testPostCallmain.tsx2 matches

@mehmet•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function testPostCall() {
4 const result = await fetchJSON(
5 "https://api.val.town/express/@stevekrouse.postWebhook1",
6 {

pageApimain.tsx2 matches

@mgruel•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/mgruel/fetchJSON";
2
3type PaginatedData<T> = {
22 nextUrl.searchParams.set("limit", `${limit}`);
23 while (nextUrl) {
24 const { data, links } = await fetchJSON<PaginatedData<T>>(
25 nextUrl,
26 options,

holidaysUSmain.tsx2 matches

@jaeseung272crb•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);

pingHttpmain.tsx2 matches

@robin•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pingHttp(url: string) {
4 try {
5 const res = await fetch(url);
6 return res.status === 200;
7 } catch {

starWarsmain.tsx2 matches

@insanity54•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);

register_discord_commandsmain.tsx2 matches

@mattx•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let register_discord_commands = async (
13 url += `commands`;
14 }
15 const response = await fetch(url, {
16 headers: {
17 "Content-Type": "application/json",

commentsmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function comments({ token, since, until, offset, limit, relationship }: {
33 };
34}> {
35 return fetchJSON(
36 "http://api.val.town/v1/me/comments?" +
37 searchParams({

subredditExamplemain.tsx2 matches

@rcoady•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Reddit recent posts from /r/aww (cute animals)
4export let subredditExample = fetchJSON(
5 "https://www.reddit.com/r/aww/.json"
6);

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago