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/$1?q=api&page=7&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 19751 results for "api"(2871ms)

postHogAPICapture1 file match

@goodieโ€ขUpdated 2 months ago

sensibleMagentaPinniped

@Ayomiplentyโ€ขUpdated 2 months ago

instagramScraping1 file match

@wolfโ€ขUpdated 3 months ago

harmoniousPlumTapir1 file match

@davincidreamsโ€ขUpdated 3 months ago

apiProxy2 file matches

@maxmโ€ขUpdated 3 months ago

capitalMultipliers2 file matches

@vinaybjp12โ€ขUpdated 3 months ago

fiberplaneHonoZodStarter10 file matches

@fiberplaneโ€ขUpdated 3 months ago
Hono-Zod-OpenAPI with Fiberplane API Playground integration

API_Management

@aryandcโ€ขUpdated 3 months ago

lovingCoralTapir1 file match

@khennyybโ€ขUpdated 4 months ago

factoid-triviaindex.ts11 matches

@bmitchinsonโ€ขUpdated 21 mins ago
75}
76
77// API endpoints
78app.get("/api/game-state", async (c) => {
79 const gameState = await getGameState();
80 return c.json(gameState);
81});
82
83app.get("/api/users", async (c) => {
84 const users = await getActiveUsers();
85 return c.json({ users });
86});
87
88app.post("/api/join", async (c) => {
89 const { name } = await c.req.json();
90
111});
112
113app.post("/api/leave", async (c) => {
114 const { userId } = await c.req.json();
115
122});
123
124app.post("/api/submit-fact", async (c) => {
125 const { userId, fact } = await c.req.json();
126
133});
134
135app.post("/api/start-round", async (c) => {
136 const unusedFacts = await getUnusedFacts();
137
154});
155
156app.post("/api/vote", async (c) => {
157 const { factId, voterId, guessedUserId } = await c.req.json();
158
179});
180
181app.post("/api/reveal", async (c) => {
182 const currentRound = await getCurrentRound();
183
201});
202
203app.post("/api/skip", async (c) => {
204 const currentRound = await getCurrentRound();
205
213
214// Admin endpoint to kick all players and clear game data
215app.post("/api/admin/kick-all", async (c) => {
216 try {
217 await clearAllGameData();

factoid-triviaREADME.md11 matches

@bmitchinsonโ€ขUpdated 3 hours ago
50```
51โ”œโ”€โ”€ backend/
52โ”‚ โ”œโ”€โ”€ index.ts # Main Hono server with game API endpoints
53โ”‚ โ”œโ”€โ”€ database/
54โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # SQLite schema for users, facts, votes, rounds
92- โœ… **Complete game flow from start to finish**
93
94## API Endpoints
95
96- `GET /api/game-state` - Get current game state including users, rounds, leaderboard
97- `POST /api/join` - Join the game with a name
98- `POST /api/leave` - Leave the game
99- `POST /api/submit-fact` - Submit a personal fact
100- `POST /api/start-round` - Start a new round with a random fact
101- `POST /api/vote` - Cast a vote for who you think the fact belongs to
102- `POST /api/reveal` - Reveal the answer and award points
103- `POST /api/skip` - Skip the current round
104- `POST /api/admin/kick-all` - **[ADMIN]** Clear all game data and kick all players
105
106## Admin Features
apiry
snartapi