Bet9ja APIbet9ja.com ↗
Access Bet9ja live sports events, real-time odds across 30–400+ markets per match, and booking code creation/decoding via 4 structured API endpoints.
What is the Bet9ja API?
The Bet9ja API gives developers access to 4 endpoints covering live sports events, per-event betting markets, and booking code management on the Bet9ja platform. The get_live_events endpoint returns all currently live matches with basic odds (1X2, Double Chance, Over/Under), competition group metadata, and sport-level event counts. The get_event_odds endpoint drills into a single live event and can return 400+ individual odds values across all active markets.
curl -X GET 'https://api.parse.bot/scraper/a7a733b2-d9c6-41da-aae1-f1c963063c45/get_live_events?sport_id=3000001' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace bet9ja-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Bet9ja SDK — live events, odds, and booking codes."""
from parse_apis.bet9ja_com_api import Bet9ja, EventNotFound
client = Bet9ja()
# List live events (capped at 5 for this walkthrough)
for event in client.live_events.list(sport_id="3000001", limit=5):
print(event.name, event.status.score, event.market_count)
# Drill into one event's full odds
event = client.live_events.list(limit=1).first()
if event:
detail = event.detail()
print(detail.name, detail.total_odds, "odds across", detail.market_count, "markets")
# Create a booking from the first event's 1X2 home win odds
if event:
import json
sel = json.dumps([{
"event_id": str(event.event_id),
"market_key": "LIVES_1X2_1",
"odd_value": detail.odds.get("LIVES_1X2_1", 1.5),
"event_name": event.name,
}])
booking = client.bookings.create(selections=sel, stake=500)
print(booking.booking_code, booking.bet_type, booking.selections[0].odd_value)
# Decode the booking code we just created
decoded = client.bookings.get(booking_code=booking.booking_code)
print(decoded.booking_code, decoded.total_selections, decoded.selections[0].market_name)
# Typed error handling: attempt to fetch a non-existent event
try:
client.event_details.get(event_id="999999999")
except EventNotFound as exc:
print(f"Not found: {exc}")
print("exercised: live_events.list / detail / bookings.create / bookings.get / event_details.get")
Retrieve all currently live sporting events with their basic odds (1X2, Double Chance, Over/Under, etc.). Returns sports categories, competition groups, and events with real-time status including score and match time. Optionally filter by sport_id to narrow results to a single sport.
| Param | Type | Description |
|---|---|---|
| sport_id | string | Internal sport ID to filter events. Use the sport IDs returned in the sports dictionary (e.g. '3000001' for Soccer, '3000005' for Tennis). |
{
"type": "object",
"fields": {
"events": "array of live event objects with odds",
"groups": "object mapping group IDs to competition group metadata (id, name, sport, sport_id)",
"sports": "object mapping sport IDs to sport metadata (id, name, sport_type_id, event_count)",
"total_events": "integer"
},
"sample": {
"events": [
{
"name": "Cafe Sidama - Welwalo Adigrat University",
"odds": {
"LIVES_1X2_1": 1.87,
"LIVES_1X2_2": 4.75,
"LIVES_1X2_X": 2.8
},
"status": {
"time": "09'",
"score": "0-0",
"period": "1st Half"
},
"event_id": 9683346,
"group_id": 47202,
"sport_id": 3000001,
"start_date": "2026-07-09 08:00:00",
"market_count": 120
}
],
"groups": {
"49385": {
"id": "49385",
"name": "World Cup-Zoom",
"sport": "Soccer",
"sport_id": 3000001
}
},
"sports": {
"3000001": {
"id": "3000001",
"name": "Soccer",
"event_count": 108,
"sport_type_id": "1"
}
},
"total_events": 108
}
}About the Bet9ja API
Live Events and Odds
The get_live_events endpoint returns three top-level objects: events (an array of live event objects with embedded basic odds), groups (a map of group IDs to competition metadata including name, sport, and sport_id), and sports (a map of sport IDs to metadata including name, sport_type_id, and event_count). An optional sport_id parameter filters the response to a single sport — pass '3000001' for soccer, for example. The total_events integer tells you the full count before iterating the array.
Per-Event Market Data
get_event_odds takes a required event_id (obtained from get_live_events) and returns the full market tree for that live event. The markets object maps each market ID to its name, description, category, selections, and selection_keys. The companion odds object maps those selection keys directly to decimal odds values. Match context is available in status (containing time, period, and score), group_name, start_date, and sport_id. market_count and total_odds summarize the depth of the response — soccer matches commonly exceed 30 markets and 100+ selections.
Booking Code Workflow
create_booking_code accepts a JSON array of selections — each containing event_id, market_key, sign, and odd_value sourced from get_event_odds — plus an optional stake in NGN. It returns a booking_code string alongside a coupon_id, bet_type (3 for single, 4 for multiple), and the full selection detail array. decode_booking_code reverses this: supply any alphanumeric booking_code and receive the complete betslip including event_name, group_name, market_name, sport_name, odd_value, and scheduled start times for every selection.
The Bet9ja API is a managed, monitored endpoint for bet9ja.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when bet9ja.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official bet9ja.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Displaying a live odds widget filtered by sport using the
sport_idparameter inget_live_events - Building a bet comparison tool that monitors decimal odds changes across 400+ markets per match via
get_event_odds - Generating shareable booking codes for multi-leg accumulators using
create_booking_codewith a selections array - Decoding user-submitted booking codes to verify bet details and odds before accepting them in a social betting app
- Tracking live match state (score, period, elapsed time) from the
statusobject returned byget_event_odds - Aggregating
event_countper sport from thesportsdictionary to build a live sports activity dashboard - Storing betslip history by persisting
coupon_idand selection data returned fromcreate_booking_code
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Bet9ja offer an official public developer API?+
What does `get_event_odds` return beyond basic 1X2 odds?+
markets object (with name, description, category, selections, and selection_keys per market) and a flat odds object keyed by selection key. For a typical soccer match this covers 30+ markets — correct score, both teams to score, Asian handicap, and more. The market_count and total_odds fields summarize the depth of the response.Are pre-match or upcoming events covered, or only live events?+
get_live_events returns events that are in-play at the time of the request, and get_event_odds requires the event_id to belong to a currently live event. Pre-match odds and scheduled fixtures are not covered. You can fork the API on Parse and revise it to add an endpoint targeting upcoming events.Can I look up historical betting results or settled coupon outcomes?+
decode_booking_code endpoint returns the selections, odds, and event details stored on the coupon at creation time, but does not include settlement status or historical match results. You can fork the API on Parse and revise it to add an endpoint that retrieves settled coupon data.Is the `sport_id` filter on `get_live_events` required, and how do I find valid IDs?+
sport_id parameter is optional. Omitting it returns all live events across every sport. Valid sport IDs are included in the sports dictionary of any get_live_events response — each entry contains an id field (e.g. '3000001' for soccer) that you can pass back as the filter on subsequent calls.