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=29&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 25342 results for "api"(1455ms)

hello-realtimeindex.html1 match

@jubertioai•Updated 4 days ago
4 <meta charset="utf-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 <title>OpenAI Realtime API Voice Agent</title>
7 <style>
8 :root {

cogs-v-clippies-2index.ts13 matches

@malcolmocean•Updated 4 days ago
36});
37
38// API Routes
39
40// Create new game
41app.post("/api/games", async c => {
42 const body = await c.req.json() as CreateGameRequest;
43
67
68// Get game info
69app.get("/api/games/:gameId", async c => {
70 const gameId = c.req.param("gameId").toUpperCase();
71
83
84// Join game
85app.post("/api/games/:gameId/join", async c => {
86 const gameId = c.req.param("gameId").toUpperCase();
87 const body = await c.req.json() as JoinGameRequest;
119
120// Get game for management
121app.get("/api/games/:gameId/manage/:mgmtId", async c => {
122 const gameId = c.req.param("gameId").toUpperCase();
123 const mgmtId = c.req.param("mgmtId");
134
135// Update game settings
136app.put("/api/games/:gameId/manage/:mgmtId", async c => {
137 const gameId = c.req.param("gameId").toUpperCase();
138 const mgmtId = c.req.param("mgmtId");
150
151// Create piece type
152app.post("/api/games/:gameId/manage/:mgmtId/pieces", async c => {
153 const gameId = c.req.param("gameId").toUpperCase();
154 const mgmtId = c.req.param("mgmtId");
166
167// Clone game
168app.post("/api/games/:gameId/clone", async c => {
169 const gameId = c.req.param("gameId").toUpperCase();
170
207
208// Get player data
209app.get("/api/games/:gameId/players/:username", async c => {
210 const gameId = c.req.param("gameId").toUpperCase();
211 const username = c.req.param("username");
228
229// Create player piece
230app.post("/api/games/:gameId/players/:username/pieces", async c => {
231 const gameId = c.req.param("gameId").toUpperCase();
232 const username = c.req.param("username");
249
250// Update player piece instructions
251app.put("/api/games/:gameId/players/:username/pieces/:pieceId", async c => {
252 const gameId = c.req.param("gameId").toUpperCase();
253 const username = c.req.param("username");
271
272// Take turn (trigger LLM moves)
273app.post("/api/games/:gameId/turn", async c => {
274 const gameId = c.req.param("gameId").toUpperCase();
275 const body = await c.req.json() as TurnRequest;
326
327// Server-sent events for turn updates
328app.get("/api/games/:gameId/events", async c => {
329 const gameId = c.req.param("gameId").toUpperCase();
330

cogs-v-clippies-2PlayPage.tsx5 matches

@malcolmocean•Updated 4 days ago
73 const loadPlayerData = async () => {
74 try {
75 const response = await fetch(`/api/games/${gameId}/players/${username}`);
76
77 if (!response.ok) {
99
100 const setupSSE = () => {
101 const eventSource = new EventSource(`/api/games/${gameId}/events`);
102 eventSourceRef.current = eventSource;
103
171 };
172
173 const response = await fetch(`/api/games/${gameId}/players/${username}/pieces`, {
174 method: 'POST',
175 headers: { 'Content-Type': 'application/json' },
202 };
203
204 const response = await fetch(`/api/games/${gameId}/players/${username}/pieces/${pieceId}`, {
205 method: 'PUT',
206 headers: { 'Content-Type': 'application/json' },
258 };
259
260 const response = await fetch(`/api/games/${gameId}/turn`, {
261 method: 'POST',
262 headers: { 'Content-Type': 'application/json' },

cogs-v-clippies-2ManagePage.tsx4 matches

@malcolmocean•Updated 4 days ago
31 const loadGameData = async () => {
32 try {
33 const response = await fetch(`/api/games/${gameId}/manage/${mgmtId}`);
34
35 if (!response.ok) {
66
67 try {
68 const response = await fetch(`/api/games/${gameId}/manage/${mgmtId}`, {
69 method: 'PUT',
70 headers: { 'Content-Type': 'application/json' },
111 };
112
113 const response = await fetch(`/api/games/${gameId}/manage/${mgmtId}/pieces`, {
114 method: 'POST',
115 headers: { 'Content-Type': 'application/json' },
153
154 try {
155 const response = await fetch(`/api/games/${gameId}/clone`, {
156 method: 'POST'
157 });

cogs-v-clippies-2JoinPage.tsx2 matches

@malcolmocean•Updated 4 days ago
22 const loadGame = async () => {
23 try {
24 const response = await fetch(`/api/games/${gameId}`);
25
26 if (!response.ok) {
51 const request: JoinGameRequest = { username };
52
53 const response = await fetch(`/api/games/${gameId}/join`, {
54 method: 'POST',
55 headers: { 'Content-Type': 'application/json' },

cogs-v-clippies-2HomePage.tsx1 match

@malcolmocean•Updated 4 days ago
26 };
27
28 const response = await fetch('/api/games', {
29 method: 'POST',
30 headers: { 'Content-Type': 'application/json' },

cogs-v-clippies-2openai.ts1 match

@malcolmocean•Updated 4 days ago
70
71 } catch (error) {
72 console.error("OpenAI API error:", error);
73 throw new Error(`Failed to generate move: ${error.message}`);
74 }

cogs-v-clippies-2types.ts1 match

@malcolmocean•Updated 4 days ago
52}
53
54// API request/response types
55export interface CreateGameRequest {
56 name: string;

cogs-v-clippies-2README.md1 match

@malcolmocean•Updated 4 days ago
11 - **queries.ts**: Database query functions
12- **llm/**: LLM integration
13 - **openai.ts**: OpenAI API calls for piece moves
14
15### Frontend (`/frontend/`)

denoCrudTaskREADME.md25 matches

@diegoivo•Updated 4 days ago
1# RankWatch API
2
3A powerful keyword ranking monitoring API built with Val Town. Track your SEO rankings with precision and reliability.
4
5## 🚀 Features
25- **Unlimited**: Unlimited keywords/projects, daily updates
26
27## 📚 API Documentation
28
29### Swagger UI
30Access interactive documentation at: `GET /docs`
31
32### OpenAPI Specification
33Get the OpenAPI spec at: `GET /docs/openapi.json`
34
35### Alternative Documentation
42- **Framework**: Hono for HTTP routing
43- **Database**: SQLite (Turso-powered)
44- **External API**: Serper.dev for Google search data
45- **Email**: Val Town std/email (Resend integration ready)
46
47### Key Components
48- `main.ts` - Main application entry point
49- `authApi.ts` - Authentication endpoints
50- `projectsApi.ts` - Project management
51- `keywordsApi.ts` - Keyword management with bulk operations
52- `rankingsApi.ts` - Ranking data and analysis
53- `searchApi.ts` - Global search functionality
54- `exportApi.ts` - CSV export endpoints
55- `swaggerApi.ts` - API documentation
56- `serperClient.ts` - Serper.dev integration
57- `cronDaily.ts` - Daily ranking checks (unlimited users)
66JWT_SECRET=your-secure-jwt-secret-key
67
68# Serper.dev API Key (get from https://serper.dev)
69SERPER_API_KEY=your-serper-api-key
70
71# Resend API Key (for email notifications)
72RESEND_API_KEY=your-resend-api-key
73
74# Optional: Custom base URL
82
831. **Create Vals**: Create separate Vals for each main component:
84 - Main API: `main.ts`
85 - Weekly Cron: `cronWeekly.ts`
86 - Daily Cron: `cronDaily.ts`
92 - Daily: Every day 6 AM UTC
93
94## 🔧 API Endpoints
95
96### Authentication
161
162### Support Tables
163- `rate_limits` - API rate limiting
164- `usage_limits` - Plan usage tracking
165
192```typescript
193resend: {
194 apiKey: Deno.env.get("RESEND_API_KEY"),
195 fromEmail: "noreply@rankwatch.dev",
196}
2011. **Clone the project** to your Val Town workspace
2022. **Set environment variables** in Val Town settings
2033. **Deploy main API** using `main.ts`
2044. **Setup cron jobs** for automated ranking checks
2055. **Test endpoints** using Swagger UI at `/docs`
220
221### Automated Testing
222The API includes health checks:
223- `GET /health` - Service health
224- `GET /status` - API status and features
225- `GET /docs/health` - Documentation health
226
228
229### Health Endpoints
230- `GET /` - API welcome/info
231- `GET /health` - Database connectivity check
232- `GET /status` - Feature and limits overview

elevenLabsDialogueTester2 file matches

@dcm31•Updated 22 hours ago
Public tester for ElevenLabs text-to-dialogue API

hello-realtime4 file matches

@jubertioai•Updated 2 days ago
Sample app for the OpenAI Realtime API
fapian
<("<) <(")> (>")>
Kapil01