REST API
The REST API provides synchronous access to game data and history.
Open REST API Client — See HTTP polling in action!
Base URL
Production: https://datastream.hypetech.games
Local: http://localhost:3000
Authentication
All REST endpoints require API Key authentication.
# Using X-API-Key header (recommended)
curl -H "X-API-Key: sk_live_xxxxx" https://datastream.hypetech.games/api/games
# Using Authorization header
curl -H "Authorization: Bearer sk_live_xxxxx" https://datastream.hypetech.games/api/games
See the Authentication Guide for detailed information on creating and managing API keys.
Rate Limiting
| Limit | Value |
|---|---|
| Requests per minute | 100 |
| Per IP address | Yes |
Headers returned:
X-Ratelimit-Limit: 100
X-Ratelimit-Remaining: 97
X-Ratelimit-Reset: 53
Rate limit exceeded:
{
"error": "Too many requests, please slow down",
"success": false
}
Endpoints
List Games
Returns all available games with their latest round info.
GET /api/games
Response:
[
{
"slug": "crash",
"name": "Crash",
"type": "multiplier",
"last_round": 512,
"last_update": "2026-01-17T00:45:42.735266-03:00"
},
{
"slug": "double",
"name": "Double",
"type": "color",
"last_round": 507,
"last_update": "2026-01-17T00:39:02.123456-03:00"
}
]
Example:
curl -s -H "X-API-Key: sk_live_xxxxx" https://datastream.hypetech.games/api/games | jq
Get Latest Result
Returns the most recent result for a specific game.
GET /api/latest/:game
Parameters:
| Parameter | Type | Description |
|---|---|---|
game | string | Game slug (e.g., crash, double) |
Response:
{
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:45:42.735266-03:00",
"value": "11.72"
}
Errors:
| Status | Error | Description |
|---|---|---|
| 404 | Game not found | Invalid game slug |
Example:
curl -s -H "X-API-Key: sk_live_xxxxx" https://datastream.hypetech.games/api/latest/crash | jq
Get History by Game
Returns historical results for a specific game.
GET /api/history/:game
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
game | string | - | Game slug |
limit | integer | 500 | Max results (1-1000) |
Response:
[
{
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:45:42.735266-03:00",
"value": "11.72"
},
{
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:44:29.478153-03:00",
"value": "7.77"
}
]
Example:
# Get last 10 crash results
curl -s -H "X-API-Key: sk_live_xxxxx" "https://datastream.hypetech.games/api/history/crash?limit=10" | jq
Get History by Type
Returns historical results for all games of a specific type.
GET /api/history/type/:type
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | - | Game type |
limit | integer | 500 | Max results (1-1000) |
Game Types:
| Type | Games |
|---|---|
multiplier | crash, slot |
color | double |
trending | wall-street |
slots | slot |
Response:
[
{
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:45:42.735266-03:00",
"value": "11.72"
},
{
"game_slug": "slot",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:44:00.000000-03:00",
"value": "2.50"
}
]
Example:
# Get last 5 multiplier results
curl -s -H "X-API-Key: sk_live_xxxxx" "https://datastream.hypetech.games/api/history/type/multiplier?limit=5" | jq
Response Format
Success Response
All successful responses return JSON with the requested data.
Error Response
{
"error": "error message",
"success": false
}
Common Errors:
| Status | Error | Cause |
|---|---|---|
| 400 | Invalid game slug | Malformed game parameter |
| 404 | Game not found | Game doesn't exist |
| 429 | Too many requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error |
Data Types
Round Object
| Field | Type | Description |
|---|---|---|
game_slug | string | URL-friendly game name |
game_type | string | Game category |
finished_at | string | ISO 8601 timestamp |
value | string | Extracted value based on game type |
Value by Game Type
The value field contains the relevant data extracted from the game result:
| Game Type | Value Contains | Example |
|---|---|---|
multiplier (crash) | Crash point | "11.72" |
color (double) | Color result | "red" |
slots (slot) | Multiplier | "2.50" |
trending (wall-street) | Trend direction | "up" |
Client Examples
JavaScript (fetch)
const API_KEY = 'sk_live_xxxxx';
async function getLatestCrash() {
const response = await fetch('/api/latest/crash', {
headers: { 'X-API-Key': API_KEY }
});
const data = await response.json();
return data;
}
async function getHistory(game, limit = 100) {
const response = await fetch(`/api/history/${game}?limit=${limit}`, {
headers: { 'X-API-Key': API_KEY }
});
const data = await response.json();
return data;
}
Go
package main
import (
"encoding/json"
"net/http"
"time"
)
const apiKey = "sk_live_xxxxx"
type Round struct {
GameSlug string `json:"game_slug"`
GameType string `json:"game_type"`
FinishedAt time.Time `json:"finished_at"`
Value string `json:"value"`
}
func getLatest(game string) (*Round, error) {
req, _ := http.NewRequest("GET", "https://datastream.hypetech.games/api/latest/"+game, nil)
req.Header.Set("X-API-Key", apiKey)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
var round Round
json.NewDecoder(resp.Body).Decode(&round)
return &round, nil
}
Python
import requests
API_KEY = 'sk_live_xxxxx'
HEADERS = {'X-API-Key': API_KEY}
def get_latest(game):
response = requests.get(
f'https://datastream.hypetech.games/api/latest/{game}',
headers=HEADERS
)
return response.json()
def get_history(game, limit=100):
response = requests.get(
f'https://datastream.hypetech.games/api/history/{game}',
params={'limit': limit},
headers=HEADERS
)
return response.json()
# Usage
latest = get_latest('crash')
print(f"Game: {latest['game_slug']}, Value: {latest['value']}")
curl
# Set your API key
API_KEY="sk_live_xxxxx"
# List all games
curl -s -H "X-API-Key: $API_KEY" https://datastream.hypetech.games/api/games | jq
# Get latest crash result
curl -s -H "X-API-Key: $API_KEY" https://datastream.hypetech.games/api/latest/crash | jq
# Get history with limit
curl -s -H "X-API-Key: $API_KEY" "https://datastream.hypetech.games/api/history/crash?limit=10" | jq
# Get history by type
curl -s -H "X-API-Key: $API_KEY" "https://datastream.hypetech.games/api/history/type/multiplier?limit=5" | jq
Best Practices
- Cache responses - Use
finished_atfor cache invalidation - Handle errors gracefully - Check for error responses
- Use streaming for real-time - REST is for queries, not live updates
- Respect rate limits - Implement backoff on 429 responses
- Use the value field directly - Already extracted based on game type