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=55&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"(416ms)

stevensDemosendDailyBrief.ts8 matches

@Waryaaβ€’Updated 1 week ago
97
98export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
99 // Get API keys from environment
100 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
101 const telegramToken = Deno.env.get("TELEGRAM_TOKEN");
102
106 }
107
108 if (!apiKey) {
109 console.error("Anthropic API key is not configured.");
110 return;
111 }
122
123 // Initialize Anthropic client
124 const anthropic = new Anthropic({ apiKey });
125
126 // Initialize Telegram bot
162
163 // disabled title for now, it seemes unnecessary...
164 // await bot.api.sendMessage(chatId, `*${title}*`, { parse_mode: "Markdown" });
165
166 // Then send the main content
169
170 if (content.length <= MAX_LENGTH) {
171 await bot.api.sendMessage(chatId, content, { parse_mode: "Markdown" });
172 // Store the briefing in chat history
173 await storeChatMessage(
198 // Send each chunk as a separate message and store in chat history
199 for (const chunk of chunks) {
200 await bot.api.sendMessage(chatId, chunk, { parse_mode: "Markdown" });
201 // Store each chunk in chat history
202 await storeChatMessage(

survivor-trackerApp.tsx1 match

@prashamtrivediβ€’Updated 1 week ago
15 const checkSetup = async () => {
16 try {
17 const response = await fetch("/api/setup/status");
18 const data = await response.json();
19 setIsSetup(data.isSetup);

survivor-trackerapi.ts18 matches

@prashamtrivediβ€’Updated 1 week ago
75});
76
77// API endpoints
78// --- Setup ---
79app.get("/api/setup/status", async (c) => {
80 const status = await getPersonalStatus();
81 return c.json({ isSetup: !!status });
82});
83
84app.post("/api/setup", async (c) => {
85 try {
86 const body = await c.req.json();
94
95// --- Tracks ---
96app.get("/api/tracks", async (c) => {
97 try {
98 const tracks = await getAllTrackStatuses();
104});
105
106app.get("/api/tracks/:id", async (c) => {
107 try {
108 const trackId = parseInt(c.req.param("id"));
118});
119
120app.post("/api/tracks/:id", async (c) => {
121 try {
122 const trackId = parseInt(c.req.param("id"));
134
135// --- Tasks ---
136app.get("/api/tasks/today", async (c) => {
137 try {
138 const today = getCurrentDay();
145});
146
147app.get("/api/tasks/week/:week", async (c) => {
148 try {
149 const week = parseInt(c.req.param("week"));
156});
157
158app.get("/api/tasks/track/:trackId", async (c) => {
159 try {
160 const trackId = parseInt(c.req.param("trackId"));
167});
168
169app.post("/api/tasks/:id/status", async (c) => {
170 try {
171 const taskId = c.req.param("id");
185
186// --- Daily Logs ---
187app.post("/api/daily-logs", async (c) => {
188 try {
189 const body = await c.req.json();
222});
223
224app.get("/api/daily-logs/today", async (c) => {
225 try {
226 const today = formatDate(new Date());
233});
234
235app.get("/api/daily-logs/track/:trackId", async (c) => {
236 try {
237 const trackId = parseInt(c.req.param("trackId"));
245
246// --- Weekly Reviews ---
247app.get("/api/weekly-reviews/current", async (c) => {
248 try {
249 const currentWeek = getCurrentWeek();
256});
257
258app.post("/api/weekly-reviews/generate", async (c) => {
259 try {
260 // Get all tracks
309
310// --- Guidance ---
311app.get("/api/guidance/track/:trackId", async (c) => {
312 try {
313 const trackId = parseInt(c.req.param("trackId"));
338});
339
340app.post("/api/guidance/quick", async (c) => {
341 try {
342 const body = await c.req.json();
362
363// --- Resources ---
364app.get("/api/resources/survival-plan", async (c) => {
365 try {
366 const survivalPlan = await readFile("/backend/resources/survivalPlan.md", import.meta.url);

survivor-trackerDashboard.tsx3 matches

@prashamtrivediβ€’Updated 1 week ago
41 // Fetch tracks and today's tasks in parallel
42 const [tracksRes, tasksRes] = await Promise.all([
43 fetch("/api/tracks"),
44 fetch("/api/tasks/today")
45 ]);
46
71 const handleTaskStatusChange = async (taskId: string, newStatus: Task['status']) => {
72 try {
73 const response = await fetch(`/api/tasks/${taskId}/status`, {
74 method: "POST",
75 headers: {

survivor-trackerSetupForm.tsx1 match

@prashamtrivediβ€’Updated 1 week ago
35
36 try {
37 const response = await fetch("/api/setup", {
38 method: "POST",
39 headers: {

survivor-trackerREADME.md1 match

@prashamtrivediβ€’Updated 1 week ago
49β”‚ β”‚ β”œβ”€β”€ survivalPlan.md # 21-day survival plan content
50β”‚ β”‚ └── trackPrompts.md # Track-specific prompts
51β”‚ β”œβ”€β”€ api.ts # API endpoints
52β”‚ └── index.ts # Main entry point
53β”œβ”€β”€ frontend/

vt-bloglive-reload.ts1 match

@shouserβ€’Updated 1 week ago
82 // if we wanted to create a /lastUpdatedAt route,
83 // which would let us pass a val town bearer token, we could do that here
84 // gives us 10k API requests per minute instead of 1k
85 // and would work with private projects
86

vt-blogget-old-posts.ts25 matches

@shouserβ€’Updated 1 week ago
19export const oldPosts: BlogPost[] = [
20 {
21 "title": "Solving the internal / external API riddle",
22 "slug": "api-conundrum",
23 "link": "/blog/api-conundrum",
24 "description": "Figuring out how to provide an API that's usable by everyone and fast for us to iterate on",
25 "pubDate": "Thu, 27 Mar 2025 00:00:00 GMT",
26 "author": "Tom MacWright",
27 },
28 {
29 "title": "API Tokens Scopes",
30 "slug": "api-token-scopes",
31 "link": "/blog/api-token-scopes",
32 "description": "Improving security with granular control over permissions",
33 "pubDate": "Fri, 01 Nov 2024 00:00:00 GMT",
59 },
60 {
61 "title": "Expanding the Vals API - RFC",
62 "slug": "expanding-the-vals-api-rfc",
63 "link": "/blog/expanding-the-vals-api-rfc",
64 "description": "Our REST API lets you do a lot - and soon it will enable more",
65 "pubDate": "Fri, 30 Jun 2023 00:00:00 GMT",
66 "author": "AndrΓ© Terron",
133 },
134 {
135 "title": "The perks of a good OpenAPI spec",
136 "slug": "openapi",
137 "link": "/blog/openapi",
138 "description": "Taking advantage of our typed REST API to build a platform around\nVal Town.",
139 "pubDate": "Thu, 25 Jul 2024 00:00:00 GMT",
140 "author": "Tom MacWright",
262 },
263 {
264 "title": "The API we forgot to name",
265 "slug": "the-api-we-forgot-to-name",
266 "link": "/blog/the-api-we-forgot-to-name",
267 "description": "An API that takes a Request and returns a Response - what was that, again?",
268 "pubDate": "Thu, 19 Oct 2023 00:00:00 GMT",
269 "author": "Steve Krouse",
286 },
287 {
288 "title": "Deprecating the Run API",
289 "slug": "deprecating-the-run-api",
290 "link": "/blog/deprecating-the-run-api",
291 "description": "Not every function should be an API",
292 "pubDate": "Wed, 07 Feb 2024 00:00:00 GMT",
293 "author": "AndrΓ© Terron",
321 "slug": "val-town-newsletter-1",
322 "link": "/blog/val-town-newsletter-1",
323 "description": "Programmatic notifications, Hacker News API, and more.",
324 "pubDate": "Wed, 04 Jan 2023 00:00:00 GMT",
325 "author": "Steve Krouse",
450 "slug": "val-town-newsletter-22",
451 "link": "/blog/val-town-newsletter-22",
452 "description": "Townie upgrades, Scoped API permissions, Fal partnership",
453 "pubDate": "Mon, 02 Dec 2024 00:00:00 GMT",
454 "author": "Steve Krouse",

vt-blog2025-04-08-migration.md1 match

@shouserβ€’Updated 1 week ago
83We didn't. We left them where they are, and proxy to them.
84
85Writing a proxy in Val Town (or any functions platform with the ['fetch handler' interface](https://blog.val.town/blog/the-api-we-forgot-to-name/)) is a delight:
86
87```ts

FarcasterGalleryimage.tsx3 matches

@moeβ€’Updated 1 week ago
84
85const loadEmoji = (code) => {
86 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
87 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`;
88 return fetch(api).then((r) => r.text());
89};
90

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)