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
| 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 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:
| Parameter | Type | Description |
|---|---|---|
game | string | Game 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:
| Status | Error | Description |
|---|---|---|
| 404 | Game not found | Invalid 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:
| Parameter | Type | Default | Description |
|---|---|---|---|
game | string | - | Game slug |
limit | integer | 500 | Max 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:
| 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:
[
{
"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:
| 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 |
|---|---|---|
round_id | integer | Unique round identifier |
game_id | integer | Database game ID |
game_slug | string | URL-friendly game name |
game_type | string | Game category |
finished_at | string | ISO 8601 timestamp |
extras | string | JSON-encoded game data |
timestamp | integer | Unix 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"}
Wall Street (trending)
{"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
- Cache responses - Use
timestampfor 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
- Parse extras correctly - It's a JSON string, parse it separately