# Bet9ja — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Place and manage sports bets on live events with real-time odds data through Bet9ja's betting platform. Create and decode booking codes to track your wagers and access current betting information across available sports events.

**Category:** Sports | **Website:** [bet9ja.com/](https://bet9ja.com/) | **Docs:** [parse.bot/marketplace/8169d3bb-bef4-4108-b78b-6975c21c6d6f/bet9ja-com-api](https://parse.bot/marketplace/8169d3bb-bef4-4108-b78b-6975c21c6d6f/bet9ja-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-bet9ja-com-api-8169d3bb/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### create_booking_code

Create a booking code from one or more bet selections. The booking code can be shared and later decoded to retrieve the original selections. Selections must reference currently active live events with valid market keys and odds values obtained from get_event_odds.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `selections` | string | Yes | JSON array of selection objects. Each object must have: event_id (string), market_key (string, e.g. 'LIVES_1X2_1'), odd_value (number), event_name (string), and optionally event_code (string). Example: [{"event_id":"9683346","market_key":"LIVES_1X2_1","odd_value":1.87,"event_name":"Team A - Team B","event_code":"3346"}] |
| `stake` | number | No | Stake amount in NGN (Nigerian Naira). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bet9ja-com-api-8169d3bb/create_booking_code \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"selections":"<string>","stake":"<number>"}'
```

### decode_booking_code

Decode a booking code to retrieve its bet selections, odds, and event details. Returns the full betslip information including all selections with their event names, markets, odds values, and scheduled start times.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `booking_code` | string | Yes | Alphanumeric booking code to decode (e.g. '5K6VK7L'). Obtained from create_booking_code or shared by users. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bet9ja-com-api-8169d3bb/decode_booking_code \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"booking_code":"<string>"}'
```

### get_event_odds

Retrieve all available betting markets and odds for a specific live event. Returns comprehensive market data including market descriptions, selection options, and current odds values. Typically returns 30-400+ individual odds across all markets for a soccer match.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `event_id` | string | Yes | Numeric event ID from get_live_events response (e.g. '9683346'). The event must be currently live. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bet9ja-com-api-8169d3bb/get_event_odds \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_id":"<string>"}'
```

### get_live_events

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.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `sport_id` | string | No | Internal sport ID to filter events. Use the sport IDs returned in the sports dictionary (e.g. '3000001' for Soccer, '3000005' for Tennis). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-bet9ja-com-api-8169d3bb/get_live_events \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sport_id":"<string>"}'
```
