Skip to main content

Endpoints Reference

Complete reference of all available endpoints.

REST API

Games

MethodEndpointDescription
GET/api/gamesList all games
GET/api/latest/:gameLatest result for game
GET/api/history/:gameHistory for game
GET/api/history/type/:typeHistory by game type

Query Parameters

EndpointParameterTypeDefaultDescription
/api/history/:gamelimitint500Max results (1-1000)
/api/history/type/:typelimitint500Max results (1-1000)

Streaming

WebSocket

EndpointDescription
ws://host/ws/:gameStream by game slug
ws://host/ws/type/:typeStream by game type

SSE

EndpointDescription
GET /sse/:gameStream by game slug
GET /sse/type/:typeStream by game type

WebTransport

EndpointDescription
https://host:4433/wtWebTransport endpoint

Game Slugs

SlugNameType
crashCrashmultiplier
doubleDoublecolor
slotSlot Machineslots
wall-streetWall Streettrending

Game Types

TypeDescriptionGames
multiplierNumeric multiplier gamescrash, slot
colorColor-based gamesdouble
slotsSlot machine gamesslot
trendingTrend-based gameswall-street

Static Files

PathDescription
/Dashboard (index.html)
/websocket.htmlWebSocket demo
/sse.htmlSSE demo
/webtransport.htmlWebTransport demo
/test.htmlProtocol 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

CodeDescription
200Success
400Bad Request (invalid parameters)
404Not Found (game/resource doesn't exist)
429Too Many Requests (rate limited)
500Internal 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