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=747&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 8150 results for "fetch"(3414ms)

fetchImageAsBase64main.tsx3 matches

@liamdanielduffy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchImageAsBase64(url) {
4 const response = await fetch(url);
5 const blob = await response.blob();
6 return new Promise((resolve, reject) => {

userValsmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function userVals({ token, id }: {
36 }
37 : {};
38 return fetchJSON(
39 `https://api.val.town/v1/users/${id}/vals`,
40 { headers },

dighimapperGcpCountmain.tsx2 matches

@bert•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const dighimapperGcpCount = (async () => {
4 const url =
5 "https://annotations.allmaps.org/maps?imageservicedomain=images.dighimapper.eu";
6 const reponse = await fetch(url);
7 const annotations = await reponse.json();
8 let gcpCount = 0;

fetchAndParseXMLmain.tsx3 matches

@mgruel•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/mgruel/fetchText";
2
3export const fetchAndParseXML = async <T extends any = any>(
4 url: string | URL,
5 options?: RequestInit,
7 const { XMLParser } = await import("npm:fast-xml-parser");
8 const parser = new XMLParser();
9 const xmlString = await fetchText(url, options);
10 return parser.parse(xmlString) as T;
11};

getInvitesFromRedditmain.tsx2 matches

@francoischalifour•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function getInvitesFromReddit() {
4 const codeRegex = /bsky-social-[a-zA-Z0-9]+/g;
5 const result = await fetchJSON(
6 "https://www.reddit.com/r/blueskyinvites/.json"
7 );

openAiModerationmain.tsx2 matches

@patrickjm•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3/**
23 body.model = model;
24 }
25 const result = await fetchJSON(
26 "https://api.openai.com/v1/moderations",
27 {

nasaAPODmain.tsx2 matches

@cufaoil•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD

fetchJSONmain.tsx3 matches

@U9G•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchJSON = async (url: string, options?: any) => {
4 let f = await fetch(url, {
5 ...options,
6 headers: {

searchTweetsmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function searchTweets({ accessToken, query, params }: {
7}) {
8 const q = new URLSearchParams({ query, ...params }).toString();
9 const results = await fetchJSON(
10 `https://api.twitter.com/2/tweets/search/recent?${q}`,
11 {

getPoemForTimemain.tsx2 matches

@crsven•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getPoemForTime = async (time: string) => {
4 const poemResponse = await fetch(
5 `https://poem.town/api/v1/clock/poem/${time}`
6 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago