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=73&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 10642 results for "api"(612ms)

telegramBotStarterindex.ts1 match

@nnn1111•Updated 1 week ago
30 // This is a no-op if nothing's changed
31 if (!isEndpointSet) {
32 await bot.api.setWebhook(req.url, {
33 secret_token: SECRET_TOKEN,
34 });

survivor-planindex.ts28 matches

@prashamtrivedi•Updated 1 week ago
27 getQuickGuidance,
28 buildDailyProgressText
29} from "./api/ai-assistant.ts";
30import { sendDailyEmail, sendWeeklyEmail } from "./api/email.ts";
31
32// Create the Hono app
60});
61
62// Migration API endpoint
63app.post("/api/migrate", async c => {
64 const body = await c.req.json();
65 const { version } = body;
86});
87
88// API Routes
89// Get all tracks
90app.get("/api/tracks", async c => {
91 try {
92 const tracks = await queries.getTracks();
99
100// Update track status
101app.put("/api/tracks/:id", async c => {
102 const trackId = parseInt(c.req.param("id"));
103 const body = await c.req.json();
118
119// Get all tasks
120app.get("/api/tasks", async c => {
121 try {
122 const tasks = await queries.getTasks();
129
130// Get tasks by track
131app.get("/api/tracks/:id/tasks", async c => {
132 const trackId = parseInt(c.req.param("id"));
133
142
143// Update task status
144app.put("/api/tasks/:id/status", async c => {
145 const taskId = parseInt(c.req.param("id"));
146 const body = await c.req.json();
161
162// Update task notes
163app.put("/api/tasks/:id/notes", async c => {
164 const taskId = parseInt(c.req.param("id"));
165 const body = await c.req.json();
176
177// Get daily log
178app.get("/api/daily-logs/:date", async c => {
179 const date = c.req.param("date");
180
194
195// Create/update daily log
196app.post("/api/daily-logs", async c => {
197 const body = await c.req.json();
198 const { date, notes, wins, challenges, tracksProgress } = body;
255
256// Get weekly review
257app.get("/api/weekly-reviews/:weekNumber", async c => {
258 const weekNumber = parseInt(c.req.param("weekNumber"));
259
273
274// Create weekly review
275app.post("/api/weekly-reviews", async c => {
276 const body = await c.req.json();
277 const { weekNumber, metricsData, gapsIdentified, adjustedTargets, recalibratedPriorities } = body;
337
338// Get user status
339app.get("/api/user-status", async c => {
340 try {
341 const userStatus = await queries.getUserStatus();
353
354// Create/update user status
355app.post("/api/user-status", async c => {
356 const body = await c.req.json();
357 const { timeAvailability, financialNeeds, mentalState, obstacles } = body;
374
375// Get track prompts
376app.get("/api/track-prompts", async c => {
377 try {
378 const trackPrompts = await queries.getTrackPrompts();
385
386// Get track prompt by track ID
387app.get("/api/tracks/:id/prompt", async c => {
388 const trackId = parseInt(c.req.param("id"));
389
403
404// Update track prompt
405app.put("/api/tracks/:id/prompt", async c => {
406 const trackId = parseInt(c.req.param("id"));
407 const body = await c.req.json();
425
426// Get AI guidance for a track
427app.post("/api/tracks/:id/guidance", async c => {
428 const trackId = parseInt(c.req.param("id"));
429
446
447// Get daily standup feedback
448app.post("/api/daily-standup", async c => {
449 try {
450 // Get user status
483
484// Get weekly review feedback
485app.post("/api/weekly-review-feedback", async c => {
486 const body = await c.req.json();
487 const { weekNumber } = body;
551
552// Get quick guidance
553app.post("/api/quick-guidance", async c => {
554 const body = await c.req.json();
555 const { specificQuestion, relevantContext, immediateCircumstances } = body as GuidanceRequest;
575
576// Get recent AI responses
577app.get("/api/ai-responses", async c => {
578 try {
579 const responses = await queries.getRecentAIResponses();
586
587// Trigger daily email
588app.post("/api/send-daily-email", async c => {
589 try {
590 const success = await sendDailyEmail();
602
603// Trigger weekly email
604app.post("/api/send-weekly-email", async c => {
605 try {
606 const success = await sendWeeklyEmail();
618
619// Get basic info
620app.get("/api/info", c => {
621 const currentDay = getCurrentDay();
622 const currentWeek = getCurrentWeek();

blob_adminmain.tsx6 matches

@gaincue•Updated 1 week ago
15
16// Public route without authentication
17app.get("/api/public/:id", async (c) => {
18 const key = `__public/${c.req.param("id")}`;
19 const { blob } = await import("https://esm.town/v/std/blob");
133};
134
135app.get("/api/blobs", checkAuth, async (c) => {
136 const prefix = c.req.query("prefix") || "";
137 const limit = parseInt(c.req.query("limit") || "20", 10);
142});
143
144app.get("/api/blob", checkAuth, async (c) => {
145 const key = c.req.query("key");
146 if (!key) return c.text("Missing key parameter", 400);
150});
151
152app.put("/api/blob", checkAuth, async (c) => {
153 const key = c.req.query("key");
154 if (!key) return c.text("Missing key parameter", 400);
159});
160
161app.delete("/api/blob", checkAuth, async (c) => {
162 const key = c.req.query("key");
163 if (!key) return c.text("Missing key parameter", 400);
167});
168
169app.post("/api/blob", checkAuth, async (c) => {
170 const { file, key } = await c.req.parseBody();
171 if (!file || !key) return c.text("Missing file or key", 400);

blob_adminapp.tsx19 matches

@gaincue•Updated 1 week ago
70 const menuRef = useRef(null);
71 const isPublic = blob.key.startsWith("__public/");
72 const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
73
74 useEffect(() => {
234 setLoading(true);
235 try {
236 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237 const data = await response.json();
238 setBlobs(data);
261 setBlobContentLoading(true);
262 try {
263 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264 const content = await response.text();
265 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
275 const handleSave = async () => {
276 try {
277 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278 method: "PUT",
279 body: editContent,
287 const handleDelete = async (key) => {
288 try {
289 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290 setBlobs(blobs.filter(b => b.key !== key));
291 if (selectedBlob && selectedBlob.key === key) {
304 const key = `${searchPrefix}${file.name}`;
305 formData.append("key", encodeKey(key));
306 await fetch("/api/blob", { method: "POST", body: formData });
307 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308 setBlobs([newBlob, ...blobs]);
326 try {
327 const fullKey = `${searchPrefix}${key}`;
328 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329 method: "PUT",
330 body: "",
341 const handleDownload = async (key) => {
342 try {
343 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344 const blob = await response.blob();
345 const url = window.URL.createObjectURL(blob);
360 if (newKey && newKey !== oldKey) {
361 try {
362 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363 const content = await response.blob();
364 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365 method: "PUT",
366 body: content,
367 });
368 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370 if (selectedBlob && selectedBlob.key === oldKey) {
380 const newKey = `__public/${key}`;
381 try {
382 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383 const content = await response.blob();
384 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385 method: "PUT",
386 body: content,
387 });
388 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390 if (selectedBlob && selectedBlob.key === key) {
399 const newKey = key.slice(9); // Remove "__public/" prefix
400 try {
401 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402 const content = await response.blob();
403 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404 method: "PUT",
405 body: content,
406 });
407 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409 if (selectedBlob && selectedBlob.key === key) {
554 onClick={() =>
555 copyToClipboard(
556 `${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
557 )}
558 className="text-blue-400 hover:text-blue-300 text-sm"
577 >
578 <img
579 src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
580 alt="Blob content"
581 className="max-w-full h-auto"

survivor-plan.mcp.json1 match

@prashamtrivedi•Updated 1 week ago
4 "command": "/root/Code/valTownProject/valTownMCPServer/build/valtown-mcp-linux",
5 "env": {
6 "VAL_TOWN_API_TOKEN": "vtwn_vXeoezF4CAugwkQ7RxxEXiHrNv9",
7 "VAL_TOWN_PREFER_CLI": "true"
8 }

survivor-planQuickGuidance.js1 match

@prashamtrivedi•Updated 1 week ago
29
30 try {
31 const response = await fetch('/api/quick-guidance', {
32 method: 'POST',
33 headers: {

survivor-planWeeklyReview.js6 matches

@prashamtrivedi•Updated 1 week ago
31 // Fetch tracks, tasks, and weekly review in parallel
32 const [tracksResponse, tasksResponse, weeklyReviewResponse] = await Promise.all([
33 fetch('/api/tracks'),
34 fetch('/api/tasks'),
35 fetch(`/api/weekly-reviews/${weekNumber}`)
36 ]);
37
227
228 try {
229 const response = await fetch('/api/weekly-reviews', {
230 method: 'POST',
231 headers: {
250 // Send weekly email
251 try {
252 await fetch('/api/send-weekly-email', {
253 method: 'POST'
254 });
271
272 try {
273 const response = await fetch('/api/weekly-review-feedback', {
274 method: 'POST',
275 headers: {

survivor-planSetupWizard.js1 match

@prashamtrivedi•Updated 1 week ago
81
82 try {
83 const response = await fetch('/api/user-status', {
84 method: 'POST',
85 headers: {

survivor-planDailyStandup.js4 matches

@prashamtrivedi•Updated 1 week ago
34 const fetchExistingLog = async () => {
35 try {
36 const response = await fetch(`/api/daily-logs/${date}`);
37
38 if (response.ok) {
111
112 try {
113 const response = await fetch('/api/daily-logs', {
114 method: 'POST',
115 headers: {
131 // Trigger email
132 try {
133 await fetch('/api/send-daily-email', {
134 method: 'POST'
135 });
156
157 try {
158 const response = await fetch('/api/daily-standup', {
159 method: 'POST'
160 });

survivor-planApp.js3 matches

@prashamtrivedi•Updated 1 week ago
30 try {
31 // Try to get user status
32 const response = await fetch('/api/user-status');
33
34 if (response.status === 404) {
56 try {
57 setIsLoading(true);
58 const response = await fetch('/api/migrate', {
59 method: 'POST',
60 headers: {
79 async function fetchInfo() {
80 try {
81 const response = await fetch('/api/info');
82 if (response.ok) {
83 const data = await response.json();

daily-advice-app1 file match

@dcm31•Updated 1 day ago
Random advice app using Advice Slip API

gptApiTemplate1 file match

@charmaine•Updated 2 days ago
apiv1
papimark21