# SX.bet — 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.

> Access data from sx.bet.

**Category:** Sports | **Website:** [sx.bet/](https://sx.bet/) | **Docs:** [parse.bot/marketplace/907348e1-f4fe-4e0e-bfd4-07e6ef8bffbd/sx-bet-api](https://parse.bot/marketplace/907348e1-f4fe-4e0e-bfd4-07e6ef8bffbd/sx-bet-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-sx-bet-api-907348e1/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_active_markets

Returns active betting fixtures with match details, teams, odds, and available market types. When league_id is provided, returns all fixtures for that league. Without it, returns upcoming fixtures across all sports optionally filtered by sport name. Each fixture includes market hashes needed for order book and consensus queries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter (e.g. 'game-lines', '1X2', 'set-betting'). |
| `league_id` | string | No | Numeric league ID from get_sports_leagues (e.g. '1308' for ATP Washington). Omitting returns upcoming fixtures across all sports. |
| `sport` | string | No | Sport name to filter upcoming fixtures (e.g. 'Tennis', 'Basketball', 'Soccer'). Only used when league_id is not provided. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sx-bet-api-907348e1/get_active_markets \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","league_id":"<string>","sport":"<string>"}'
```

### get_market_consensus

Returns betting consensus data for a fixture derived from the live order book: best decimal odds on each outcome, implied probabilities, total available liquidity on each side, and percentage distribution. Consensus reflects current market maker positions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter. |
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `market_hash` | string | No | Market hash to filter to a specific market. Omitting returns consensus for all markets. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sx-bet-api-907348e1/get_market_consensus \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","fixture_id":"<string>","market_hash":"<string>"}'
```

### get_match_trades

Returns paginated trade history for a specific fixture showing all executed bets: bettor username, stake amount, decimal odds, implied probability, which outcome was bet on, and settlement status. Serves as the match activity/history for an individual fixture.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `page` | integer | No | Zero-based page number for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sx-bet-api-907348e1/get_match_trades \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fixture_id":"<string>","page":"<integer>"}'
```

### get_order_book

Returns the full open order book for a fixture showing all active limit orders, their odds (as implied probability 0-1), stake sizes, and maker addresses. Orders are grouped by market type (MONEY_LINE, SPREAD, OVER_UNDER) and split into outcome one/two sides.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `bet_group` | string | No | Bet group filter. |
| `fixture_id` | string | Yes | Fixture ID from get_active_markets (e.g. 'L19606444'). |
| `market_hash` | string | No | Market hash to filter to a specific market within the fixture. Omitting returns all markets. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sx-bet-api-907348e1/get_order_book \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bet_group":"<string>","fixture_id":"<string>","market_hash":"<string>"}'
```

### get_sports_leagues

Returns all available sports and their active leagues on the SX Bet platform, including event counts per league. Use to discover league IDs for filtering active markets.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-sx-bet-api-907348e1/get_sports_leagues \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
