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//%22script.js/%22?q=api&page=1&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 25401 results for "api"(1017ms)

PixelPixelApiMonitor1 file match

@selfire1•Updated 6 hours ago
Regularly polls the API and messages on an error.

weatherApp1 file match

@dcm31•Updated 12 hours ago
A simple weather app with dropdown cities using Open-Meteo API

integrate-api-nvidia-com-v1-chat-completions3 file matches

@curtcox•Updated 12 hours ago

todoist-api

@scottscharl•Updated 1 day ago

elevenLabsDialogueTester2 file matches

@dcm31•Updated 2 days ago
Public tester for ElevenLabs text-to-dialogue API

hello-realtime4 file matches

@jubertioai•Updated 4 days ago
Sample app for the OpenAI Realtime API

github-api13 file matches

@cricks_unmixed4u•Updated 4 days ago
Very incomplete collection of useful GitHub API adapters

rest-api-example

@lcarbonaro•Updated 4 days ago
bible-sdk

bible-sdk5 file matches

@cameronpak•Updated 5 days ago
Free Use Bible API TS SDK

pushover1 file match

@jacobbudin•Updated 1 week ago
Send a push notification via Pushover API

spotymain.ts2 matches

@skirtowner•Updated 1 hour ago
19 const now = Date.now();
20 if (!cached.accessToken || now >= cached.expiresAt) {
21 const tokenResp = await fetch("https://accounts.spotify.com/api/token", {
22 method: "POST",
23 headers: {
46 let playlists: any[] = [];
47 let nextUrl: string | null =
48 "https://api.spotify.com/v1/me/playlists?limit=50";
49
50 while (nextUrl) {
1# API Routes
2
3JSON API endpoints for frontend/backend communication.
4
5## Separation of Concerns
6
7API routes handle:
8- JSON request/response formatting
9- HTTP status code management
11- Error response standardization
12
13API routes delegate business logic to controllers and return clean JSON responses.
14
15## Endpoints
16
17### GET /api/health
18
19**Purpose**: System health check endpoint
32**HTTP Status**: Always 200
33
34### POST /api/viewing
35
36**Purpose**: Update page viewing status in blob storage for real-time tracking with immediate Notion sync
41 pageId: string, // Notion page UUID
42 viewing: boolean, // true when actively viewing, false when leaving
43 tabVisible: boolean // Page Visibility API state
44}
45```
92```
93
94### GET /api/viewing/:id
95
96**Purpose**: Get current viewing status for a page
125**Error Responses**: Same pattern as other endpoints
126
127### GET /api/viewing/:id/stats
128
129**Purpose**: Get viewing analytics/statistics for a page
148```
149
150### GET /api/demo/:id/properties
151
152**Purpose**: Get Notion page properties (filtered for UI consumption)
198{
199 error: "Failed to fetch page data",
200 details: "Notion API error message"
201}
202```
203
204### GET /api/demo/:id
205
206**Purpose**: Get complete Notion page with content blocks
251## Error Handling Pattern
252
253All API routes follow consistent error handling:
254
255```typescript
269## Data Filtering
270
271API routes return filtered data for UI consumption:
272- **Button properties removed**: Notion button properties are filtered out to prevent UI confusion
273- **Raw Notion format**: Other properties maintain their original Notion API structure
274- **Complete hierarchy**: Block content includes full nested structure with children
275
278```bash
279# Get page properties only
280curl https://your-val.web.val.run/api/demo/abc123/properties
281
282# Get complete page with content
283curl https://your-val.web.val.run/api/demo/abc123
284
285# Health check
286curl https://your-val.web.val.run/api/health
287```
fapian
<("<) <(")> (>")>
Kapil01