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%20%22Optional%20title%22?q=api&page=106&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 13317 results for "api"(1375ms)

worldclockMAP-FEATURE-README.md1 match

@evilmathwalnuts•Updated 4 days ago
33## Implementation Notes
34
35- The map uses OpenStreetMap tiles which don't require an API key
36- Each timezone has an approximate geographic coordinate associated with it
37- When a timezone is selected, the map centers on that location

MyPortfolioindex.ts2 matches

@Dangari•Updated 4 days ago
28app.get("/assets/*", c => serveFile(c.req.path, import.meta.url));
29
30// API endpoint for contact form (placeholder)
31app.post("/api/contact", async (c) => {
32 try {
33 const data = await c.req.json();

MyPortfoliomain.js1 match

@Dangari•Updated 4 days ago
146 try {
147 // Send form data to backend
148 const response = await fetch('/api/contact', {
149 method: 'POST',
150 headers: {

MyPortfolioindex.html2 matches

@Dangari•Updated 4 days ago
33 <!-- Analytics (Simple Page View Counter) -->
34 <script async defer>
35 fetch('/api/analytics/pageview', { method: 'POST' })
36 .catch(err => console.error('Analytics error:', err));
37 </script>
243 <li class="flex items-center">
244 <i class="fas fa-check text-green-500 mr-2"></i>
245 <span>API Design</span>
246 </li>
247 <li class="flex items-center">

MUSALLindex.ts38 matches

@otega07•Updated 4 days ago
2import { Hono } from "https://deno.land/x/hono/mod.ts";
3import { parseProject, readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
4import type { ApiResponse, RecommendationRequest, UserProfile } from "../shared/types";
5import { drills, initDatabase, initSampleDrills, playlists, sessions, users } from "./database";
6import { generateFootballDrills, generateMusicPlaylist, generateTrainingSession } from "./openai";
59});
60
61// API Routes
62
63// User routes
64app.post("/api/users", async c => {
65 await ensureDbInitialized();
66
69 const newUser = await users.create(body);
70
71 return c.json<ApiResponse<UserProfile>>({
72 success: true,
73 data: newUser,
74 });
75 } catch (error) {
76 return c.json<ApiResponse<null>>({
77 success: false,
78 error: error instanceof Error ? error.message : "Failed to create user",
81});
82
83app.get("/api/users/:id", async c => {
84 await ensureDbInitialized();
85
89
90 if (!user) {
91 return c.json<ApiResponse<null>>({
92 success: false,
93 error: "User not found",
95 }
96
97 return c.json<ApiResponse<UserProfile>>({
98 success: true,
99 data: user,
100 });
101 } catch (error) {
102 return c.json<ApiResponse<null>>({
103 success: false,
104 error: error instanceof Error ? error.message : "Failed to get user",
107});
108
109app.patch("/api/users/:id", async c => {
110 await ensureDbInitialized();
111
116
117 if (!updatedUser) {
118 return c.json<ApiResponse<null>>({
119 success: false,
120 error: "User not found",
122 }
123
124 return c.json<ApiResponse<UserProfile>>({
125 success: true,
126 data: updatedUser,
127 });
128 } catch (error) {
129 return c.json<ApiResponse<null>>({
130 success: false,
131 error: error instanceof Error ? error.message : "Failed to update user",
135
136// Playlist routes
137app.get("/api/playlists/user/:userId", async c => {
138 await ensureDbInitialized();
139
142 const userPlaylists = await playlists.getByUserId(userId);
143
144 return c.json<ApiResponse<typeof userPlaylists>>({
145 success: true,
146 data: userPlaylists,
147 });
148 } catch (error) {
149 return c.json<ApiResponse<null>>({
150 success: false,
151 error: error instanceof Error ? error.message : "Failed to get playlists",
155
156// Drill routes
157app.get("/api/drills", async c => {
158 await ensureDbInitialized();
159
177 }
178
179 return c.json<ApiResponse<typeof result>>({
180 success: true,
181 data: result,
182 });
183 } catch (error) {
184 return c.json<ApiResponse<null>>({
185 success: false,
186 error: error instanceof Error ? error.message : "Failed to get drills",
190
191// Session routes
192app.get("/api/sessions/user/:userId", async c => {
193 await ensureDbInitialized();
194
197 const userSessions = await sessions.getByUserId(userId);
198
199 return c.json<ApiResponse<typeof userSessions>>({
200 success: true,
201 data: userSessions,
202 });
203 } catch (error) {
204 return c.json<ApiResponse<null>>({
205 success: false,
206 error: error instanceof Error ? error.message : "Failed to get sessions",
209});
210
211app.get("/api/sessions/:id", async c => {
212 await ensureDbInitialized();
213
217
218 if (!session) {
219 return c.json<ApiResponse<null>>({
220 success: false,
221 error: "Session not found",
223 }
224
225 return c.json<ApiResponse<typeof session>>({
226 success: true,
227 data: session,
228 });
229 } catch (error) {
230 return c.json<ApiResponse<null>>({
231 success: false,
232 error: error instanceof Error ? error.message : "Failed to get session",
236
237// AI recommendation routes
238app.post("/api/recommendations/playlist", async c => {
239 await ensureDbInitialized();
240
247 const user = await users.getById(body.userId);
248 if (!user) {
249 return c.json<ApiResponse<null>>({
250 success: false,
251 error: "User not found",
256 const savedPlaylist = await playlists.create(generatedPlaylist);
257
258 return c.json<ApiResponse<typeof savedPlaylist>>({
259 success: true,
260 data: savedPlaylist,
261 });
262 } catch (error) {
263 return c.json<ApiResponse<null>>({
264 success: false,
265 error: error instanceof Error ? error.message : "Failed to generate playlist",
268});
269
270app.post("/api/recommendations/drills", async c => {
271 await ensureDbInitialized();
272
279 const user = await users.getById(body.userId);
280 if (!user) {
281 return c.json<ApiResponse<null>>({
282 success: false,
283 error: "User not found",
293 const recommendedDrills = await generateFootballDrills(user, body.request, allDrills);
294
295 return c.json<ApiResponse<typeof recommendedDrills>>({
296 success: true,
297 data: recommendedDrills,
298 });
299 } catch (error) {
300 return c.json<ApiResponse<null>>({
301 success: false,
302 error: error instanceof Error ? error.message : "Failed to generate drill recommendations",
305});
306
307app.post("/api/recommendations/session", async c => {
308 await ensureDbInitialized();
309
316 const user = await users.getById(body.userId);
317 if (!user) {
318 return c.json<ApiResponse<null>>({
319 success: false,
320 error: "User not found",
344 });
345
346 return c.json<ApiResponse<typeof newSession>>({
347 success: true,
348 data: newSession,
349 });
350 } catch (error) {
351 return c.json<ApiResponse<null>>({
352 success: false,
353 error: error instanceof Error ? error.message : "Failed to generate training session",

bananananaindex.ts1 match

@yawnxyz•Updated 4 days ago
15 <title>A Love Story with Bananas</title>
16 <style>
17 @import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Poppins:wght@300;400;600&display=swap');
18
19 * {

aimemoryindex.ts1 match

@neverstew•Updated 4 days ago
214 }
215
216 // Handle POST requests for API operations
217 if (req.method === "POST") {
218 // Process the request

HTOCApp.tsx4 matches

@homestocompare•Updated 4 days ago
27 try {
28 const [citiesRes, statesRes] = await Promise.all([
29 fetch('/api/properties/cities'),
30 fetch('/api/properties/states')
31 ]);
32
48 const fetchProjectInfo = async () => {
49 try {
50 const res = await fetch('/api/project-info');
51 const data = await res.json();
52 setProjectInfo(data);
77 if (newFilters.searchTerm) queryParams.append('searchTerm', newFilters.searchTerm);
78
79 const response = await fetch(`/api/properties?${queryParams.toString()}`);
80
81 if (!response.ok) {

HTOCREADME.md1 match

@homestocompare•Updated 4 days ago
10## Usage
11
12These files can be imported from both the frontend and backend code. They should not contain any environment-specific code (no Deno or browser-specific APIs).

HTOCREADME.md7 matches

@homestocompare•Updated 4 days ago
7- `index.ts` - Main entry point for the backend
8- `database/` - Database schema and queries
9- `routes/` - API route handlers
10
11## API Endpoints
12
13### Properties
14
15- `GET /api/properties` - Get all properties with optional filtering
16 - Query parameters:
17 - `minPrice` - Minimum price
22 - `state` - Filter by state
23 - `searchTerm` - Search in title, description, address, and city
24- `GET /api/properties/:id` - Get a single property by ID
25- `GET /api/properties/cities` - Get list of available cities
26- `GET /api/properties/states` - Get list of available states
27
28### Project Info
29
30- `GET /api/project-info` - Get information about the project for the view source link
31
32## Static Files

vapi-minutes-db1 file match

@henrywilliams•Updated 3 days ago

vapi-minutes-db2 file matches

@henrywilliams•Updated 3 days ago
mux
Your friendly, neighborhood video API.
api