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/image-url.jpg?q=api&page=127&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 19501 results for "api"(5631ms)

batchcast

batchcastmain.tsx13 matches

@gโ€ขUpdated 1 week ago
3 * controlling multiple Chromecast devices simultaneously.
4 * The application logic is entirely on the client-side, interacting with a
5 * user-provided backend REST API. This val only serves the static HTML, CSS,
6 * and JavaScript files.
7 */
304 // --- STATE ---
305 const PORT = 8081;
306 let apiBase = "";
307 let services = [];
308 let list = []; // Array of host strings
333 const allControlButtons = [sendMediaBtn, playBtn, pauseBtn, stopBtn, closeBtn, addAllBtn, removeAllBtn];
334
335 // --- API HELPERS ---
336 const apiCall = (endpoint, options = {}) => {
337 if (!apiBase) return Promise.reject("API base not set");
338 return fetch(`${apiBase}${endpoint}`, options);
339 };
340
341 const getStatus = () => apiCall("/status");
342 const getServices = () => apiCall("/services").then(res => res.ok ? res.json() : Promise.reject(res));
343 const getList = () => apiCall("/list").then(res => res.ok ? res.json() : Promise.reject(res));
344 const updateList = (hosts) => apiCall("/list", { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(hosts) });
345 const deleteFromList = (hosts) => apiCall("/list", { method: "DELETE", headers: { "Content-Type": "application/json" }, body: JSON.stringify(hosts) });
346
347 const postCommand = (endpoint, body = {}) => apiCall(endpoint, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
348 const sendMedia = (contentId, contentType) => postCommand("/media", { contentId, contentType });
349 const stopPlayback = () => postCommand("/stop");
428 if(servicesInterval) clearInterval(servicesInterval);
429
430 apiBase = `http://${host}:${PORT}`;
431 hostInput.disabled = true;
432 connectBtn.disabled = true;

YoutubeDownloaderyoutube.ts6 matches

@bman101โ€ขUpdated 1 week ago
23 // In a real implementation, you would either:
24 // 1. Use a separate service that has yt-dlp installed
25 // 2. Use YouTube API + other tools for downloading
26 // 3. Use a third-party service
27
72
73 /**
74 * Gets video information (simulated - in real implementation would use YouTube API)
75 */
76 private static async getVideoInfo(url: string): Promise<VideoInfo> {
77 const videoId = this.extractVideoId(url);
78
79 // In a real implementation, you would use YouTube Data API v3
80 // For demo purposes, we'll return mock data
81 return {
103 message: "Video downloaded successfully",
104 filename: `${videoInfo.title}.mp4`,
105 downloadUrl: `/api/download/video/${this.extractVideoId(url)}`
106 };
107 }
125 message: "Audio extracted successfully",
126 filename: `${videoInfo.title}.mp3`,
127 downloadUrl: `/api/download/audio/${this.extractVideoId(url)}`
128 };
129 }
140// 1. A server with yt-dlp installed (Python environment)
141// 2. File storage system (local filesystem, cloud storage, etc.)
142// 3. YouTube Data API key for video metadata
143// 4. Proper error handling and rate limiting
144// 5. Cleanup of temporary files

YoutubeDownloaderREADME.md1 match

@bman101โ€ขUpdated 1 week ago
17โ”‚ โ”œโ”€โ”€ index.ts # Main Hono server
18โ”‚ โ”œโ”€โ”€ routes/
19โ”‚ โ”‚ โ”œโ”€โ”€ download.ts # Download API endpoints
20โ”‚ โ”‚ โ””โ”€โ”€ static.ts # Static file serving
21โ”‚ โ””โ”€โ”€ services/

YoutubeDownloaderindex.ts3 matches

@bman101โ€ขUpdated 1 week ago
10});
11
12// API routes
13app.route("/api/download", downloadRoutes);
14
15// Static file serving and main routes
21 status: "healthy",
22 timestamp: new Date().toISOString(),
23 service: "YouTube Downloader API"
24 });
25});

YoutubeDownloaderdownload.ts4 matches

@bman101โ€ขUpdated 1 week ago
5const download = new Hono();
6
7// POST /api/download - Start a download
8download.post("/", async (c) => {
9 try {
44});
45
46// GET /api/download/video/:videoId - Download video file
47download.get("/video/:videoId", async (c) => {
48 const videoId = c.req.param("videoId");
61});
62
63// GET /api/download/audio/:videoId - Download audio file
64download.get("/audio/:videoId", async (c) => {
65 const videoId = c.req.param("videoId");
78});
79
80// GET /api/download/status/:videoId - Check download status
81download.get("/status/:videoId", async (c) => {
82 const videoId = c.req.param("videoId");

YoutubeDownloaderDownloadForm.tsx1 match

@bman101โ€ขUpdated 1 week ago
28 };
29
30 const response = await fetch("/api/download", {
31 method: "POST",
32 headers: {

pixelartindex.ts11 matches

@loadingโ€ขUpdated 1 week ago
91
92// Register
93app.post("/api/auth/register", async c => {
94 try {
95 const { username, email, password, display_name } = await c.req.json();
151
152// Login
153app.post("/api/auth/login", async c => {
154 try {
155 const { username, password } = await c.req.json();
194
195// Logout
196app.post("/api/auth/logout", async c => {
197 try {
198 const sessionId = getSessionFromCookie(c.req.header('cookie'));
210
211// Get current user
212app.get("/api/auth/me", async c => {
213 try {
214 const user = await getCurrentUser(c);
235
236// Create artwork
237app.post("/api/artworks", async c => {
238 try {
239 const user = await getCurrentUser(c);
266
267// Get user's artworks
268app.get("/api/artworks/my", async c => {
269 try {
270 const user = await getCurrentUser(c);
287
288// Get public artworks
289app.get("/api/artworks/public", async c => {
290 try {
291 const limit = parseInt(c.req.query('limit') || '50');
301
302// Get artwork by ID
303app.get("/api/artworks/:id", async c => {
304 try {
305 const id = parseInt(c.req.param('id'));
324
325// Update artwork
326app.put("/api/artworks/:id", async c => {
327 try {
328 const user = await getCurrentUser(c);
347
348// Delete artwork
349app.delete("/api/artworks/:id", async c => {
350 try {
351 const user = await getCurrentUser(c);
369
370// Search artworks
371app.get("/api/artworks/search", async c => {
372 try {
373 const query = c.req.query('q');

pixelartauth.ts1 match

@loadingโ€ขUpdated 1 week ago
1// Simple password hashing using Web Crypto API
2export async function hashPassword(password: string): Promise<string> {
3 const encoder = new TextEncoder();

ai_comments_to_tasksindex.ts2 matches

@arthrodโ€ขUpdated 1 week ago
245}
246
247// API endpoint to analyze PR messages
248app.post("/api/analyze", async c => {
249 try {
250 const body: AnalysisRequest = await c.req.json();

ai_comments_to_tasksindex.tsx1 match

@arthrodโ€ขUpdated 1 week ago
309
310 try {
311 const response = await fetch("/api/analyze", {
312 method: "POST",
313 headers: {

researchAgent2 file matches

@thesephistโ€ขUpdated 17 hours ago
This is a lightweight wrapper around Perplexity's web search API

memoryApiExample2 file matches

@ingenierotitoโ€ขUpdated 17 hours ago
snartapi
vapicxy