Batch Odds
Fetch odds for multiple events in a single request. This avoids making separate API calls for each event, reducing latency and rate limit consumption.
POST /api/v1/odds/batchAuthentication
Requires API key. Available to all tiers.
Request Body
Send a JSON body with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
event_ids | string[] | Yes | Array of event IDs to fetch odds for |
sportsbook | string | No | Single sportsbook ID filter (defaults to all available for your tier) |
market | string | No | Single market type filter (defaults to all) |
Batch Limits by Tier
The maximum number of events per batch request depends on your tier:
| Tier | Max Events per Batch |
|---|---|
| Free | 10 |
| Hobby | 10 |
| Pro | 50 |
| Sharp | 50 |
| Enterprise | 100 |
Exceeding the batch limit for your tier will return a 400 invalid_request error. Split large requests into multiple batches if needed.
Example Requests
cURL
curl -X POST "https://api.sharpapi.io/api/v1/odds/batch" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_ids": ["evt_nba_lal_bos_20260126", "evt_nba_gsw_mia_20260126"],
"sportsbook": "draftkings",
"market": "moneyline"
}'Response
Success (200)
{
"success": true,
"data": {
"events": [
{
"event_id": "evt_nba_lal_bos_20260126",
"event_name": "Los Angeles Lakers @ Boston Celtics",
"sport": "basketball",
"league": "nba",
"start_time": "2026-01-26T19:30:00Z",
"is_live": false,
"odds": [
{
"sportsbook": "draftkings",
"market_type": "moneyline",
"selection": "Boston Celtics",
"selection_type": "home",
"odds_american": -210,
"odds_decimal": 1.476,
"line": null,
"timestamp": "2026-01-26T10:15:00.000Z"
},
{
"sportsbook": "draftkings",
"market_type": "moneyline",
"selection": "Los Angeles Lakers",
"selection_type": "away",
"odds_american": 175,
"odds_decimal": 2.75,
"line": null,
"timestamp": "2026-01-26T10:15:00.000Z"
}
]
},
{
"event_id": "evt_nba_gsw_mia_20260126",
"event_name": "Golden State Warriors @ Miami Heat",
"sport": "basketball",
"league": "nba",
"start_time": "2026-01-26T20:00:00Z",
"is_live": false,
"odds": [
{
"sportsbook": "draftkings",
"market_type": "moneyline",
"selection": "Miami Heat",
"selection_type": "home",
"odds_american": -130,
"odds_decimal": 1.769,
"line": null,
"timestamp": "2026-01-26T10:15:05.000Z"
}
]
}
],
"missing_events": []
},
"meta": {
"requested": 2,
"found": 2,
"missing": 0,
"max_batch": 50,
"filters": {
"sportsbook": "draftkings",
"market": "moneyline"
},
"updated_at": "2026-01-26T10:15:05.000Z"
}
}Response Headers
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 296
X-RateLimit-Reset: 1737853200
X-Data-Delay: 0
X-Request-Id: req_batch_abc123Error Responses
400 Batch Limit Exceeded
{
"error": {
"code": "invalid_request",
"message": "Batch limit exceeded. Your tier (hobby) allows 10 events per batch, but 25 were requested.",
"docs": "https://sharpapi.io/docs/api-reference/odds-batch"
}
}400 Missing Events Field
{
"error": {
"code": "invalid_request",
"message": "The 'event_ids' field is required and must be a non-empty array of event IDs.",
"docs": "https://sharpapi.io/docs/api-reference/odds-batch"
}
}401 Unauthorized
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key",
"docs": "https://sharpapi.io/docs/authentication"
}
}Response Structure
The batch response nests events and missing IDs under data, with counts in meta:
Data Object
| Field | Type | Description |
|---|---|---|
data.events | EventOdds[] | Array of event objects with nested odds |
data.missing_events | string[] | Event IDs that were not found or had no odds |
Meta Object
| Field | Type | Description |
|---|---|---|
meta.requested | integer | Number of event IDs in your request |
meta.found | integer | Number of events that had odds data |
meta.missing | integer | Number of events not found |
meta.max_batch | integer | Maximum batch size for your tier |
meta.filters | object | Applied filters (sportsbook, market) |
If an event ID in your request has no odds (e.g., the event has ended or doesn’t exist), it will appear in data.missing_events rather than causing an error. The response will still include odds for all valid events.
Response Schema
Each item in the data.events array is an event object with nested odds:
Event Object
| Field | Type | Description |
|---|---|---|
event_id | string | Event identifier |
event_name | string | Human-readable event name |
sport | string | Sport slug |
league | string | League slug |
start_time | string | ISO 8601 event start time |
is_live | boolean | Whether event is live |
game_state | object | undefined | Live game state (only for live events with scores) |
odds | array | Array of odds for this event |
Odds Object (nested in event)
| Field | Type | Description |
|---|---|---|
sportsbook | string | Sportsbook ID |
market_type | string | Market type |
selection | string | Selection name |
selection_type | string | home, away, over, under |
odds_american | number | American odds |
odds_decimal | number | Decimal odds |
line | number | null | Line value |
timestamp | string | When odds were last updated |
Use Cases
Pre-game Odds Loading
Load odds for an entire day’s slate in a single call instead of making dozens of individual requests:
# Get all NBA event IDs from the events endpoint
events_response = requests.get(
'https://api.sharpapi.io/api/v1/events',
params={'league': 'nba', 'limit': 50},
headers={'X-API-Key': 'YOUR_API_KEY'}
)
event_ids = [e['id'] for e in events_response.json()['data']]
# Batch fetch all odds at once
odds_response = requests.post(
'https://api.sharpapi.io/api/v1/odds/batch',
headers={'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json'},
json={'event_ids': event_ids}
)Dashboard Refresh
Periodically refresh odds for events a user is watching:
async function refreshWatchlist(eventIds) {
const response = await fetch('https://api.sharpapi.io/api/v1/odds/batch', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ event_ids: eventIds })
});
const { data, meta } = await response.json();
if (data.missing_events.length > 0) {
console.warn('Missing events:', data.missing_events);
}
return data.events;
}Related Endpoints
- Odds Snapshot - Get odds with flexible query filters
- Best Odds - Get best odds across books per selection
- Events - List events to get event IDs for batch requests