API Documentation
Introduction
Base URL: https://api.duelapi.com
All endpoints require authentication using an API key in the X-API-Key header, except for the /health endpoint.
Authentication
Include your API key in the request header:
X-API-Key: cr_your_read_key_here
Endpoints
GET /health
Check API status and get basic statistics. Rate limited to 60 requests per minute per IP.
Authentication: Not required
Example Request:
curl https://api.duelapi.com/health
Example Response:
{
"status": "ok",
"uptime": 12345.67,
"totalSpins": 150,
"totalRoulette": 120,
"totalCrashes": 30
}
GET /crash/recent
Get the most recent crash game rounds.
Authentication: Required
Query Parameters:
limit(optional): Number of crashes to return (default: 10, max: 10,000)page(optional): Page number for pagination (default: 0). Each page contains up tolimititems.
Pagination:
- Page 0: Items 0 to
limit(most recent) - Page 1: Items
limitto2*limit - Page 2: Items
2*limitto3*limit
Example Request:
curl -H "X-API-Key: your_key" \
"https://api.duelapi.com/crash/recent?limit=5"
Example Response:
{
"total": 150,
"limit": 5,
"page": 0,
"totalPages": 30,
"hasMore": true,
"range": {
"start": 0,
"end": 5
},
"recent": [
{
"game": "crash",
"round": 455814,
"multiplier": 1.60,
"timestamp": 1765481292567,
"isoTimestamp": "2025-12-11T20:12:31.815Z",
"state": "crashed",
"nextRound": 455815
}
]
}
GET /roulette/recent
Get the most recent roulette spins.
Authentication: Required
Query Parameters:
limit(optional): Number of spins to return (default: 10, max: 10,000)page(optional): Page number for pagination (default: 0). Each page contains up tolimititems.
Pagination:
- Page 0: Items 0 to
limit(most recent) - Page 1: Items
limitto2*limit - Page 2: Items
2*limitto3*limit
Example Request:
curl -H "X-API-Key: your_key" \
"https://api.duelapi.com/roulette/recent?limit=5"
Example Response:
{
"total": 35000,
"rouletteCount": 200,
"limit": 5,
"page": 0,
"totalPages": 40,
"hasMore": true,
"range": {
"start": 0,
"end": 5
},
"recent": [
{
"game": "roulette",
"multiplier": 2,
"coinName": "Red",
"timestamp": 1765481292567,
"isoTimestamp": "2025-12-11T20:12:31.815Z"
}
]
}
GET /crash/last
Get the most recent crash game.
Authentication: Required
Example Request:
curl -H "X-API-Key: your_key" \
"https://api.duelapi.com/crash/last"
GET /roulette/last
Get the most recent roulette spin.
Authentication: Required
Example Request:
curl -H "X-API-Key: your_key" \
"https://api.duelapi.com/roulette/last"
GET /crash/stats
Get comprehensive statistics about crash games.
Authentication: Required
Example Response:
{
"total": 150,
"averageMultiplier": 2.45,
"minMultiplier": 1.01,
"maxMultiplier": 10.23,
"byMultiplier": {
"1.5": 20,
"2.0": 15
}
}
Sports Betting Odds API
Access real-time sports betting odds from Duel.com. The Odds API provides live and prematch odds for multiple sports in an Odds-API compatible format.
Base URL: https://api.duelapi.com/v4 or https://api.duelapi.com/odds/v4
Authentication: All endpoints require a Read API key. You can provide it via:
- Header:
X-API-Key: your_key - Query parameter:
?apiKey=your_key
Odds API Endpoints
GET /v4/sports
Get a list of all available sports with active events.
Authentication: Required (header or query parameter)
Example Request (Header):
curl -H "X-API-Key: your_key" \
"https://api.duelapi.com/v4/sports"
Example Request (Query Parameter):
curl "https://api.duelapi.com/v4/sports?apiKey=your_key"
Example Response:
[
{
"key": "soccer_usa_mls",
"group": "Soccer",
"title": "Major League Soccer",
"description": "Soccer – Major League Soccer",
"active": true,
"has_outrights": false
},
{
"key": "basketball_nba",
"group": "Basketball",
"title": "NBA",
"description": "Basketball – NBA",
"active": true,
"has_outrights": false
}
]
GET /v4/sports/{sport}/events
Get a list of events for a specific sport (without odds).
Authentication: Required (header or query parameter)
Path Parameters:
sport- The sport key (e.g.,soccer_usa_mls)
Example Request:
curl "https://api.duelapi.com/v4/sports/soccer_usa_mls/events?apiKey=your_key"
Example Response:
[
{
"id": "2611304894455484438",
"sport_key": "soccer_usa_mls",
"sport_title": "Soccer",
"commence_time": "2025-12-12T20:00:00Z",
"home_team": "CV Gran Canaria 2",
"away_team": "CV Finestrat"
}
]
GET /v4/sports/{sport}/odds
Get full odds data for all events in a specific sport. Includes markets, outcomes, and prices.
Authentication: Required (header or query parameter)
Path Parameters:
sport- The sport key (e.g.,soccer_usa_mls)
Example Request:
curl "https://api.duelapi.com/v4/sports/soccer_usa_mls/odds?apiKey=your_key"
Example Response:
[
{
"id": "2611304894455484438",
"sport_key": "soccer_usa_mls",
"sport_title": "Soccer",
"commence_time": "2025-12-12T20:00:00Z",
"home_team": "CV Gran Canaria 2",
"away_team": "CV Finestrat",
"bookmakers": [
{
"key": "duel",
"title": "Duel",
"last_update": "2025-12-12T19:45:00Z",
"markets": [
{
"key": "m_186",
"title": "Match Winner (1X2)",
"last_update": "2025-12-12T19:45:00Z",
"outcomes": [
{
"name": "Home",
"price": 1.22
},
{
"name": "Draw",
"price": 3.65
}
]
}
]
}
]
}
]
Notes:
- Odds are automatically enriched with team names and market descriptions
- Live events are updated in real-time
- Returns empty array if no events found for the sport
GET /odds/api/odds & GET /odds/api/events
Get raw odds and events data (paginated). These endpoints require pagination to prevent bulk data dumps.
Authentication: Required
Query Parameters:
limit(required): Number of items per page (max: 1000, default: 100)offset(optional): Pagination offset (default: 0)eventId(optional): Filter by specific event IDsport(optional, events only): Filter by sport key
Example Request:
curl "https://api.duelapi.com/odds/api/odds?apiKey=your_key&limit=100&offset=0"
Example Response:
{
"odds": [...],
"totalOdds": 5000,
"limit": 100,
"offset": 0,
"hasMore": true,
"message": "Use ?limit=N&offset=N for pagination. Max 1000 per request."
}
Code Examples
JavaScript - Crash/Roulette
const apiKey = 'your_api_key_here';
const response = await fetch(
'https://api.duelapi.com/crash/recent?limit=10',
{
headers: {
'X-API-Key': apiKey
}
}
);
const data = await response.json();
console.log(data.recent);
JavaScript - Sports Odds
const apiKey = 'your_api_key_here';
// Get available sports
const sportsResponse = await fetch(
`https://api.duelapi.com/v4/sports?apiKey=${apiKey}`
);
const sports = await sportsResponse.json();
console.log('Available sports:', sports);
// Get odds for a specific sport
const oddsResponse = await fetch(
`https://api.duelapi.com/v4/sports/soccer_usa_mls/odds?apiKey=${apiKey}`
);
const odds = await oddsResponse.json();
console.log('Odds:', odds);
Python - Crash/Roulette
import requests
api_key = 'your_api_key_here'
headers = {'X-API-Key': api_key}
response = requests.get(
'https://api.duelapi.com/crash/recent?limit=10',
headers=headers,
timeout=60
)
data = response.json()
print(data['recent'])
Python - Sports Odds
import requests
api_key = 'your_api_key_here'
# Get available sports
sports_response = requests.get(
f'https://api.duelapi.com/v4/sports?apiKey={api_key}'
)
sports = sports_response.json()
print('Available sports:', sports)
# Get odds for a specific sport
odds_response = requests.get(
f'https://api.duelapi.com/v4/sports/soccer_usa_mls/odds?apiKey={api_key}'
)
odds = odds_response.json()
print('Odds:', odds)
cURL - Crash/Roulette
curl -H "X-API-Key: your_api_key_here" \
"https://api.duelapi.com/crash/recent?limit=10"
cURL - Sports Odds
# Get sports list
curl "https://api.duelapi.com/v4/sports?apiKey=your_api_key_here"
# Get odds for a sport
curl "https://api.duelapi.com/v4/sports/soccer_usa_mls/odds?apiKey=your_api_key_here"