Skip to main content

REST API

The REST API provides synchronous access to game data and history.

Try it Online

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
tip

See the Authentication Guide for detailed information on creating and managing API keys.

Rate Limiting

LimitValue
Requests per minute100
Per IP addressYes

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:

ParameterTypeDescription
gamestringGame 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:

StatusErrorDescription
404Game not foundInvalid 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:

ParameterTypeDefaultDescription
gamestring-Game slug
limitinteger500Max 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:

ParameterTypeDefaultDescription
typestring-Game type
limitinteger500Max results (1-1000)

Game Types:

TypeGames
multipliercrash, slot
colordouble
trendingwall-street
slotsslot

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:

StatusErrorCause
400Invalid game slugMalformed game parameter
404Game not foundGame doesn't exist
429Too many requestsRate limit exceeded
500Internal Server ErrorServer error

Data Types

Round Object

FieldTypeDescription
game_slugstringURL-friendly game name
game_typestringGame category
finished_atstringISO 8601 timestamp
valuestringExtracted value based on game type

Value by Game Type

The value field contains the relevant data extracted from the game result:

Game TypeValue ContainsExample
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

  1. Cache responses - Use finished_at for cache invalidation
  2. Handle errors gracefully - Check for error responses
  3. Use streaming for real-time - REST is for queries, not live updates
  4. Respect rate limits - Implement backoff on 429 responses
  5. Use the value field directly - Already extracted based on game type