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.andrebassi.com.br
Local: http://localhost:3000

Authentication

Currently, the API is public and doesn't require authentication.

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 https://datastream.andrebassi.com.br/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:

{
"round_id": 512,
"game_id": 1,
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:45:42.735266-03:00",
"extras": "{\"point\": \"11.72\"}",
"timestamp": 1768621542123
}

Errors:

StatusErrorDescription
404Game not foundInvalid game slug

Example:

curl -s https://datastream.andrebassi.com.br/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:

[
{
"round_id": 512,
"game_id": 1,
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:45:42.735266-03:00",
"extras": "{\"point\": \"11.72\"}",
"timestamp": 1768621542123
},
{
"round_id": 511,
"game_id": 1,
"game_slug": "crash",
"game_type": "multiplier",
"finished_at": "2026-01-17T00:44:29.478153-03:00",
"extras": "{\"point\": \"7.77\"}",
"timestamp": 1768621469976
}
]

Example:

# Get last 10 crash results
curl -s "https://datastream.andrebassi.com.br/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:

[
{
"round_id": 512,
"game_slug": "crash",
"game_type": "multiplier",
"extras": "{\"point\": \"11.72\"}",
"timestamp": 1768621542123
},
{
"round_id": 510,
"game_slug": "slot",
"game_type": "multiplier",
"extras": "{\"multiplier\": \"2.50\"}",
"timestamp": 1768621500000
}
]

Example:

# Get last 5 multiplier results
curl -s "https://datastream.andrebassi.com.br/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
round_idintegerUnique round identifier
game_idintegerDatabase game ID
game_slugstringURL-friendly game name
game_typestringGame category
finished_atstringISO 8601 timestamp
extrasstringJSON-encoded game data
timestampintegerUnix ms timestamp

Extras by Game Type

Crash (multiplier)

{"point": "11.72"}

Double (color)

{"color": "red", "number": 5}

Slot (slots)

{"reels": ["cherry", "lemon", "orange"], "multiplier": "2.00"}
{"trending": "up"}

Client Examples

JavaScript (fetch)

async function getLatestCrash() {
const response = await fetch('/api/latest/crash');
const data = await response.json();
return data;
}

async function getHistory(game, limit = 100) {
const response = await fetch(`/api/history/${game}?limit=${limit}`);
const data = await response.json();
return data;
}

Go

package main

import (
"encoding/json"
"net/http"
)

type Round struct {
RoundID int64 `json:"round_id"`
GameSlug string `json:"game_slug"`
Extras string `json:"extras"`
Timestamp int64 `json:"timestamp"`
}

func getLatest(game string) (*Round, error) {
resp, err := http.Get("https://datastream.andrebassi.com.br/api/latest/" + game)
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

def get_latest(game):
response = requests.get(f'https://datastream.andrebassi.com.br/api/latest/{game}')
return response.json()

def get_history(game, limit=100):
response = requests.get(
f'https://datastream.andrebassi.com.br/api/history/{game}',
params={'limit': limit}
)
return response.json()

# Usage
latest = get_latest('crash')
print(f"Round {latest['round_id']}: {latest['extras']}")

curl

# List all games
curl -s https://datastream.andrebassi.com.br/api/games | jq

# Get latest crash result
curl -s https://datastream.andrebassi.com.br/api/latest/crash | jq

# Get history with limit
curl -s "https://datastream.andrebassi.com.br/api/history/crash?limit=10" | jq

# Get history by type
curl -s "https://datastream.andrebassi.com.br/api/history/type/multiplier?limit=5" | jq

Best Practices

  1. Cache responses - Use timestamp 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. Parse extras correctly - It's a JSON string, parse it separately