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=744&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 8156 results for "fetch"(5739ms)

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

headersExamplemain.tsx2 matches

@koenbok•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const headersExample = async (request: Request) => {
11 });
12 }
13 const response = await fetch(targetUrl);
14 console.log(response);
15 let headersObject = {};

getDictmain.tsx2 matches

@byjonathanleung•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getDict = (await fetch("https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv")).text()

getChineseDictionaryAsCSVmain.tsx2 matches

@byjonathanleung•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getChineseDictionaryAsCSV = (await fetch("https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv")).text()

denoImportExmain.tsx2 matches

@libo•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let denoImportEx = (async () => {
6 );
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago