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=477&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 5056 results for "api"(639ms)

hnSearchmain.tsx2 matches

@stevekrouse•Updated 1 year ago
3
4/* Search Hacker News via Agolia
5Look for the valid params: https://hn.algolia.com/api */
6export let hnSearch = async ({
7 search_by_date,
17 let cleaned_params = await searchParams(params);
18 let data = await fetchJSON(
19 `http://hn.algolia.com/api/v1/${type}?${cleaned_params}`
20 );
21 if (!data.hits && data.message) {

discordChannelmain.tsx1 match

@stevekrouse•Updated 1 year ago
3export function discordChannel({ botToken, serverId }) {
4 return fetchJSON(
5 `https://discord.com/api/guilds/${serverId}/channels`,
6 {
7 headers: {

spotifyAddToPlaylistmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifyAddToPlaylist = ({ id, ...params }) => spotifyAPI({
4 endpoint: `playlists/${id}/tracks`,
5 method: 'POST',

addSendGridEmailmain.tsx1 match

@stevekrouse•Updated 1 year ago
3// called by supabase newsletter trigger (defined in sql editor)
4export let addSendGridEmail = ({ token, email, listId }) =>
5 fetchJSON("https://api.sendgrid.com/v3/marketing/contacts", {
6 method: "PUT",
7 headers: {

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

authenticatedCanMutatemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { testMutateSemantics } from "https://esm.town/v/stevekrouse/testMutateSemantics";
2
3export const authenticatedCanMutate = (api) =>
4 testMutateSemantics({
5 stateName: "@stevekrouse.testState",
6 api,
7 mutateExpected: true,
8 mutator: (now) => `export let @stevekrouse.testState = ${now}`,

pixelmain.tsx1 match

@stevekrouse•Updated 1 year ago
31 }
32 else if (req.path.startsWith("/track")) {
33 // TODO lookup ip location http://ip-api.com/json/172.85.34.113
34 let data = {
35 query: req.query,

valOutputmain.tsx1 match

@stevekrouse•Updated 1 year ago
11 const name = match[2];
12 const val = await fetchJSON(
13 `https://api.val.town/v1/alias/${author}/${name}`,
14 );
15 return new Response(val.output.value);

planesAboveMemain.tsx1 match

@stevekrouse•Updated 1 year ago
15 });
16 console.log({ lat, lon, display_name });
17 let url = `https://opensky-network.org/api/states/all?${query}`;
18 let data = await fetchJSON(url);
19 return data?.states?.map((f) => ({

runValAPIEx2 file matches

@charmaine•Updated 11 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)