Endpoints Reference
Complete reference of all available endpoints.
REST API
Games
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/games | List all games |
| GET | /api/latest/:game | Latest result for game |
| GET | /api/history/:game | History for game |
| GET | /api/history/type/:type | History by game type |
Query Parameters
| Endpoint | Parameter | Type | Default | Description |
|---|---|---|---|---|
/api/history/:game | limit | int | 500 | Max results (1-1000) |
/api/history/type/:type | limit | int | 500 | Max results (1-1000) |
Streaming
WebSocket
| Endpoint | Description |
|---|---|
ws://host/ws/:game | Stream by game slug |
ws://host/ws/type/:type | Stream by game type |
SSE
| Endpoint | Description |
|---|---|
GET /sse/:game | Stream by game slug |
GET /sse/type/:type | Stream by game type |
WebTransport
| Endpoint | Description |
|---|---|
https://host:4433/wt | WebTransport endpoint |
Game Slugs
| Slug | Name | Type |
|---|---|---|
crash | Crash | multiplier |
double | Double | color |
slot | Slot Machine | slots |
wall-street | Wall Street | trending |
Game Types
| Type | Description | Games |
|---|---|---|
multiplier | Numeric multiplier games | crash, slot |
color | Color-based games | double |
slots | Slot machine games | slot |
trending | Trend-based games | wall-street |
Static Files
| Path | Description |
|---|---|
/ | Dashboard (index.html) |
/websocket.html | WebSocket demo |
/sse.html | SSE demo |
/webtransport.html | WebTransport demo |
/test.html | Protocol comparison |
Environment URLs
Production
Base URL: https://datastream.hypetech.games
WebSocket: wss://datastream.hypetech.games/ws/:game
SSE: https://datastream.hypetech.games/sse/:game
WebTransport: https://datastream.hypetech.games:4433/wt
Local Development
Base URL: http://localhost:3000
WebSocket: ws://localhost:3000/ws/:game
SSE: http://localhost:3000/sse/:game
WebTransport: https://localhost:4433/wt
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request (invalid parameters) |
| 404 | Not Found (game/resource doesn't exist) |
| 429 | Too Many Requests (rate limited) |
| 500 | Internal Server Error |
Response Headers
REST API
Content-Type: application/json
X-Ratelimit-Limit: 100
X-Ratelimit-Remaining: 97
X-Ratelimit-Reset: 53
SSE
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
Transfer-Encoding: chunked
CORS
All endpoints support CORS with:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
OpenAPI Specification
openapi: 3.0.0
info:
title: Data Stream API
version: 1.0.0
description: Real-time CDC streaming API
servers:
- url: https://datastream.hypetech.games
description: Production
- url: http://localhost:3000
description: Local
paths:
/api/games:
get:
summary: List all games
responses:
'200':
description: List of games
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Game'
/api/latest/{game}:
get:
summary: Get latest result
parameters:
- name: game
in: path
required: true
schema:
type: string
responses:
'200':
description: Latest round
content:
application/json:
schema:
$ref: '#/components/schemas/Round'
'404':
description: Game not found
/api/history/{game}:
get:
summary: Get history
parameters:
- name: game
in: path
required: true
schema:
type: string
- name: limit
in: query
schema:
type: integer
default: 500
responses:
'200':
description: History
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Round'
components:
schemas:
Game:
type: object
properties:
slug:
type: string
name:
type: string
type:
type: string
last_round:
type: integer
last_update:
type: string
format: date-time
Round:
type: object
properties:
round_id:
type: integer
game_id:
type: integer
game_slug:
type: string
game_type:
type: string
finished_at:
type: string
format: date-time
extras:
type: string
timestamp:
type: integer