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/?q=api&page=474&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=api

Returns an array of strings in format "username" or "username/projectName"

Found 5057 results for "api"(613ms)

runValmain.tsx2 matches

@std•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_URL } from "https://esm.town/v/std/API_URL";
3
4export function runVal(name, ...args) {
5 return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
6 method: "POST",
7 body: JSON.stringify({

valTownApiExampleSearchmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleSearch = (async () => {
4 const query = new URLSearchParams({ query: "lodash", limit: "4" });
5 const response = await fetch(`https://api.val.town/v1/search/vals?${query}`);
6 const json = await response.json();
7 return json;

blocks_innermain.tsx1 match

@tmcw•Updated 1 year ago
3export let blocks_inner = async (req, res) => {
4 const [_, user, id, ...file] = req.path.split("/");
5 const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) =>
6 r.json()
7 );

twitterAPIDownmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1// set by stevekrouse.checkIfTwitterAPIIsDown at 2023-05-09T17:45:30.441Z
2export let twitterAPIDown = {
3 "down": false,
4 "reason": "search returned 4 results at Tue May 09 2023 17:45:30 GMT+0000 (Coordinated Universal Time)"

geoffApimain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { geoffApiSecret } from "https://esm.town/v/stevekrouse/geoffApiSecret";
2
3export const geoffApi = ({ secret }) => {
4 if (secret !== geoffApiSecret) return "Bad secret";
5};

vidmain.tsx1 match

@stevekrouse•Updated 1 year ago
3export let vid = async (name) =>
4 (await fetchJSON(
5 `https://api.val.town/v1/alias/${name.replace(".", "/").replace("@", "")}`,
6 )).id;

discoverWeeklyTracksmain.tsx2 matches

@stevekrouse•Updated 1 year ago
2import { spotifyGetToken } from "https://esm.town/v/stevekrouse/spotifyGetToken";
3import { discoverWeeklySearch } from "https://esm.town/v/stevekrouse/discoverWeeklySearch";
4import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
5
6export let discoverWeeklyTracks = spotifyAPI({
7 endpoint: `playlists/${discoverWeeklySearch.playlists.items.at(0).id}/tracks`,
8 token: (await spotifyGetToken(spotifyDoNotShareState)).access_token,

activitypubmain.tsx1 match

@tmcw•Updated 1 year ago
48 preferredUsername: `bot`,
49 summary: `Photos from ${DOMAIN}.com`,
50 inbox: `https://${DOMAIN}/api/inbox`,
51 followers: `https://${DOMAIN}/u/bot/followers`,
52 icon: {

discordGetMessagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordAPI } from "https://esm.town/v/stevekrouse/discordAPI";
2
3// https://discord.com/developers/docs/resources/channel#get-channel-messages
4export let discordGetMessages = ({token, tokenType, channelId}) => discordAPI({
5 token,
6 tokenType,

californiaBusinessNotificationsmain.tsx1 match

@tmcw•Updated 1 year ago
6 const { parse } = await import("https://deno.land/x/xml/mod.ts");
7 const res: any = await fetch(
8 "https://bizfileonline.sos.ca.gov/api/FilingDetail/business/4603/false",
9 {
10 headers: {

runValAPIEx2 file matches

@charmaine•Updated 15 hours ago

PassphraseAPI2 file matches

@wolf•Updated 3 days ago
artivilla
founder @outapint.io vibe coding on val.town. dm me to build custom vals: https://artivilla.com
fiberplane
Purveyors of Hono tooling, API Playground enthusiasts, and creators of 🪿 HONC 🪿 (https://honc.dev)