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=445&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 4574 results for "api"(733ms)

valTownApiExampleUsermain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleUser = (async () => {
4 const handle = "tmcw";
5 const response = await fetch(`https://api.val.town/v1/alias/${handle}`);
6 const json = await response.json();
7 return json;

githubStarredmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// Cities named Brooklyn
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred",
6);

twitterAPIDownAlertmain.tsx5 matches

@stevekrouse•Updated 1 year ago
1import { twitterAPIDown } from "https://esm.town/v/stevekrouse/twitterAPIDown";
2
3export async function twitterAPIDownAlert() {
4 if (twitterAPIDown.down)
5 console.email(
6 twitterAPIDown.reason,
7 "Twitter API may be down!"
8 );
9}

openAQLocationmain.tsx1 match

@tmcw•Updated 1 year ago
13 // Test
14 const { results } = fetchJSON(
15 "https://api.openaq.org/v2/locations?" +
16 new URLSearchParams({
17 // This is a comment

blocksmain.tsx2 matches

@tmcw•Updated 1 year ago
23 }
24 }"
25 x-init="blocks = await (await fetch('https://storage.googleapis.com/bb-search-data/parsed/blocks-min.json')).json()"
26 >
27 <div class='grid gap-4 grid-cols-4 lg:grid-cols-8'>
51 </html>`);
52 }
53 const gistRes = await fetch(`https://api.github.com/gists/${id}`);
54 if (!gistRes.ok) {
55 return res.send("GitHub replied with a non-200 status.");

exampleAuthApimain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { set } from "https://esm.town/v/std/set?v=11";
2import { verfiedCalls } from "https://esm.town/v/stevekrouse/verfiedCalls";
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function exampleAuthApi(arg1, arg2, auth) {
6 let { handle } = await verifyAPIAuth(auth);
7 if (handle) {
8 verfiedCalls.push({ handle, t: Date.now() });

discordGetChannelsmain.tsx2 matches

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

hasValTownStyleGuideUpdatedmain.tsx1 match

@stevekrouse•Updated 1 year ago
5export let hasValTownStyleGuideUpdated = async (since: Date) => {
6 let commits = await fetchJSON(
7 "https://api.github.com/repos/val-town/val.town/commits?path=/src/style.tsx&since=" +
8 since.toISOString(),
9 {

dsnyEventsFeedmain.tsx1 match

@tmcw•Updated 1 year ago
4 const ics = await import("npm:ics");
5 const events = await fetch(
6 "https://a827-donatenyc.nyc.gov/DSNYApi/api/Events/GetAllByBorough?borough=",
7 )
8 .then((r) => r.json());

chessTimemain.tsx1 match

@tmcw•Updated 1 year ago
3export let chessTime = (async () => {
4 const { secondsToHours } = await import("npm:date-fns");
5 const stats = await fetch("https://lichess.org/api/user/tmcw").then((r) =>
6 r.json()
7 );

PassphraseAPI2 file matches

@wolf•Updated 2 days ago

openapi2 file matches

@stevekrouse•Updated 4 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)