# SportWizzard API — Single-File Docs

The sports betting data API: sportsbook and DFS odds, plus events, players, teams, box-score stats, historical prices, and computed DFS edges / cross-book arbitrage — all in one canonical schema.

**Billing status:** Free API signup is open. Usage is not currently metered, and paid subscriptions are paused. Credit costs and plan limits below describe the planned model and are not currently enforced.

- **Base URL:** `https://api.sportwizzard.com` — all endpoints under `/api/v1`, JSON.
- **Envelope:** every list/detail response is `{ "success", "data", "nextCursor", "meta" }` (exception: `/snapshot` returns a raw gzip body).
- **Pagination:** opaque cursors — read `nextCursor`, pass back as `?cursor=`, stop at `null`. Never parse or construct a cursor.
- **Source of truth:** [openapi.json](https://sportwizzard.com/openapi.json) · full per-endpoint docs with examples: [llms-full.txt](https://sportwizzard.com/llms-full.txt) · agent index: [llms.txt](https://sportwizzard.com/llms.txt)

Response examples are illustrative; market totals, source counts, prices, and timestamps change over time.

## Quickstart

```bash
curl "https://api.sportwizzard.com/api/v1/edges?limit=5" \
  -H "X-Api-Key: sw_live_your_api_key_here"
```

Truncated response (real shape):

```json
{
  "success": true,
  "data": [
    {
      "id": "…",
      "competition": "mlb",
      "eventId": "…",
      "participants": [
        { "side": 1, "sideLabel": "home", "position": 1, "name": "Boston Red Sox" },
        { "side": 2, "sideLabel": "away", "position": 1, "name": "New York Yankees" }
      ],
      "eventStartTime": "2026-07-19T23:05Z",
      "market": "PLAYER_TOTAL_BASES",
      "statType": "total_bases",
      "period": "FULL",
      "line": 1.5,
      "outcomeCode": "OVER",
      "playerName": "…",
      "dfsSource": "prizepicks",
      "dfsMultiplier": 1.0,
      "bookSource": "pinnacle",
      "bookImpliedProbability": 58.2,
      "oddsByBook": [
        { "source": "pinnacle", "over": -139, "under": 118, "impliedProb": 58.2 },
        { "source": "fanduel", "over": -132, "under": 110 }
      ]
    }
  ],
  "nextCursor": null,
  "meta": { "count": 1 }
}
```

Edges are a screening signal (DFS line vs. the most favorable book's no-vig price) — verify before treating one as +EV, and relay that caveat to end users.

## Authentication

Send `X-Api-Key: <api-key>` — or `Authorization: Bearer <api-key>`, both accepted. Keys are **self-serve and free**: sign in at [sportwizzard.com/account](https://sportwizzard.com/account) → **API Keys** tab. No card required.

Current state: Free API signup is open; usage is not currently metered, and paid subscriptions are paused. Send an API key with data requests; planned credit costs and limits are not currently enforced.

### Who gets which fields

One set of endpoints serves everyone; some fields depend on the caller. Signed-out callers, website sessions and Free-plan keys get names and sides. An API key on a paid plan also gets:

- `competitorId` / `playerId` on event `participants`
- `playerId` on odds, historical odds, edge and arbitrage rows
- arbitrage selection `sourceReferences`, `marketSourceReferences` and `eventSourceReferences`
- event `sourceReferences` (`include=source_references`; ignored for other callers)

These routes send `Vary: Authorization, X-Api-Key`, and a paid-plan response is `Cache-Control: private`. `/players`, `/competitors`, stats and `/source-references/lookup` are keyed by IDs and return the same fields to everyone.

## Endpoint index

| Method & path | What it does |
|---|---|
| `GET /api/v1/competitions` | Active leagues (call this first — leagues are seasonal) |
| `GET /api/v1/seasons?year=` | List seasons |
| `GET /api/v1/sportsbooks` | List sportsbooks / DFS sources |
| `GET /api/v1/markets` · `/markets/active` | Market catalog (all / currently live) |
| `GET /api/v1/status` | Platform status |
| `GET /api/v1/competitors` · `/competitors/{id}` · `/competitors/{id}/stats` · `/competitors/{competitorId}/odds` | Teams, box stats, per-team odds |
| `GET /api/v1/players` · `/players/{id}` · `/players/{id}/stats` · `/players/{playerId}/odds` | Players, box stats, per-player odds |
| `GET /api/v1/events` · `/events/active` · `/events/{id}` | Events with their participants (filter by `competitor_id` or `player_id`); detail adds each side's score, venue, weather, lineups. `/events/{id}?include_context_history=true` adds the timestamped change log of probable pitchers / lineups / weather |
| `GET /api/v1/events/{id}/stats` · `/events/{eventId}/odds` | Full box score; one event's odds board |
| `GET /api/v1/stats/players` | Bulk player box stats (filter by event/team/player) |
| `GET /api/v1/odds` | Flat odds rows (scope by competition/sportsbook/market/event_id/player_id/competitor_id; `scope=event\|season\|tournament` splits game markets from futures) |
| `GET /api/v1/odds/updated?since=` | Delta feed — only rows changed since your last sync |
| `GET /api/v1/snapshot` | Entire live board as one gzip blob (ETag + 304 support); `?include_history=true` (paid-plan keys only) populates every selection's `selectionPrice`: price runs, oldest first, each `{observedAt, lastObservedAt, priceAmerican, priceDecimal, dfsMultiplier, suspended (only when true), liquidityTier (exchanges only)}` |
| `GET /api/v1/edges` | DFS edges vs. no-vig sharp prices (derived signal) |
| `GET /api/v1/arbitrage` | Cross-book arbitrage, two- & three-way (derived signal) |
| `GET /api/v1/historical/odds` · `/historical/arbitrage` | Historical prices & arbs |
| `GET /api/v1/account/usage` | Account plan and API usage details |
| `WebSocket /api/v1/customer-stream` | Live market updates when stream access is enabled for a paid-plan key |

## Customer market stream (when enabled)

Connect to `wss://api.sportwizzard.com/api/v1/customer-stream` with `X-Api-Key: <api-key>`, then send a `subscribe` message. Each filter is optional; omitted filters match all markets. Values within a filter are ORed, and different filters are combined with AND.

```json
{"type":"subscribe","channel":"markets","source":["draftkings"],"competition":["nba"],"event":["<event-uuid>"]}
```

The server acknowledges with a `subscribed` message containing an `epoch` and `sequence`. For an initial load, request the history-free versioned snapshot from that floor, then keep reading the stream while the snapshot downloads:

```text
GET /api/v1/snapshot?include_history=false&competition=nba&feed_epoch=<epoch>&min_sequence=<sequence>
X-Api-Key: <api-key>
```

This uses the snapshot's ordinary one-credit price. Apply the subscription's source and event filters locally to the snapshot rows. The server sends UTF-8 JSON in binary WebSocket messages. Market updates arrive in batches, and completed heartbeats are standalone. Merge snapshot rows and incoming updates by market ID and row sequence. A standalone heartbeat with `complete: true` is the durable cursor; wait until its `sequence` covers the snapshot's finish sequence before treating the initial load as caught up. Save only a completed heartbeat cursor for reconnect, and repeat the same filters:

```json
{"type":"subscribe","channel":"markets","source":["draftkings"],"competition":["nba"],"event":["<event-uuid>"],"cursor":{"epoch":"<epoch>","sequence":123}}
```

If the server sends `resync`, discard the old cursor and repeat the subscribe-first snapshot flow. The initial `subscribed` position is a bootstrap floor, not a completed resume cursor.

When enabled, Free keys cannot use the stream. Apprentice keys may hold 1 simultaneous connection, Wizard 3, and Archmage 10. The first successfully delivered event-bearing market or liveness update costs 1 credit per API key, canonical event ID, and UTC hour. Other sockets and replayed delivery for that same event-hour share the charge. Eventless market and liveness updates, removals, and control messages are free. At the monthly cap, further stream use is refused with `credit_limit` and the reset time; there is no stream overage.

## Market vocabulary: `/odds` vs `/edges` (read this before filtering player props)

The two feeds name the same market **differently** — the most common first-try mistake.

- **`/odds`** (the flat book feed) splits the market into two fields: `market` is the broad **family** (`PLAYER_TOTAL`, `PLAYER_MILESTONE`, `PLAYER_YES_NO`, `MONEYLINE`, `SPREAD`, `TOTAL`, …) and `marketSubtype` is the **specific stat** (`PLAYER_TOTAL_POINTS`, `PLAYER_TOTAL_SINGLES`, `TOTAL_RUNS`, …). To pull player props, filter on the family: `?market=PLAYER_TOTAL`. `market` tokens are **substring** matches, so `?market=PLAYER_TOTAL` also matches every `PLAYER_TOTAL_*` subtype; narrow with `marketSubtype` client-side (or pass the subtype string to `market`, since substring matching catches it too).
- **`/edges`** (the derived DFS-vs-sharp feed) puts the **specific subtype directly in `market`** (`market: "PLAYER_TOTAL_SINGLES"`, no separate `marketSubtype`), plus a lowercase short `statType` (`"singles"`, `"points"`).

So a value like `PLAYER_TOTAL_POINTS` is an `/edges` `market`, but on `/odds` it's a `marketSubtype` (the `/odds` `market` would be `PLAYER_TOTAL`). Discover live values with `GET /api/v1/markets/active`.

**Real `/odds` player-prop row** (`GET /api/v1/odds?competition=mlb&market=PLAYER_TOTAL&limit=1`):

```json
{
  "id": "4f332204-…:ballybet:PLAYER_TOTAL_RBIS:019f8db6-…",
  "sportsbook": "ballybet",
  "competition": "mlb",
  "eventId": "4f332204-…",
  "market": "PLAYER_TOTAL",
  "marketSubtype": "PLAYER_TOTAL_RBIS",
  "period": "FULL",
  "selection": "Over",
  "outcomeCode": "OVER",
  "outcomeParticipants": [{ "kind": "player", "name": "Ernie Clement" }],
  "line": 0.5,
  "priceAmerican": 190,
  "priceDecimal": 2.9,
  "playerName": "Ernie Clement",
  "suspended": false,
  "eventStartTime": "2026-07-23T19:07",
  "updated": "2026-07-23T17:26:15Z"
}
```

## Outcomes

Odds, historical odds and arbitrage selections describe the outcome with these fields:

- **`outcomeCode`** — the canonical code below. Filter on it rather than parsing `selection`.
- **`side`** — the event side the outcome is about: `1`, `2` (matching `participants[].side`) or absent. A moneyline or spread leg is `WIN` with its `side`. A player prop's `side` is the player's team's side. Totals, draws, "neither" and futures have no `side`; the code says what they are.
- **`outcomeParticipants`** — `[{ "kind": "competitor" | "player", "name" }]`, the names the leg carries as the source sent them. A futures winner names its team here. A side-only outcome has none; read the event participant on that `side`. A paid-plan key also gets `competitorId` / `playerId`.
- **`side1Score` / `side2Score`** — on `SCORE` (exact-score) outcomes.
- **`statType`** — the canonical stat (`points`, `rec_yards`, `threes_made`, …): source synonyms are folded into one value per sport.

| `outcomeCode` | Meaning |
|---|---|
| `OVER` / `UNDER` | Over or under the `line` |
| `YES` / `NO` | The proposition happens / does not happen |
| `WIN` | The leg's `side` or named participant wins or is the answer (moneyline, spread, a futures team, a tournament winner) |
| `DRAW` | The event ends level |
| `NEITHER` | Neither side or named participant |
| `WIN_OR_DRAW` | Double chance: the leg's `side` wins or it is a draw |
| `EITHER` | Either side wins (no draw) |
| `ODD` / `EVEN` | The total is odd / even |
| `SCORE` | An exact score; read `side1Score` / `side2Score` |
| `RANGE` | The value lands in a band |
| `OTHER` | Any other result, or "the field" |
| `LABEL` | A categorical answer only the `selection` label explains (method of victory, plate-appearance result, half-time/full-time pair) |

Exchange selections carry their current `liquidityTier`; snapshot markets carry `phase` (`PRE` or `LIVE`). `playerName` on a player prop is the name as the source sent it; a paid-plan key also gets `playerId`.

## Event participants

Events, edges, arbitrage and historical arbitrage rows carry `participants`: who takes part, ordered by `side`, then `position`, then `name`. `/events` uses `startTime`; edge and arbitrage rows use `eventStartTime`.

| Field | Meaning |
|---|---|
| `side` | `1` or `2`; absent for a field event (golf) |
| `sideLabel` | `home` (side 1) / `away` (side 2) for team sports; absent for tennis, MMA and esports, where side order is arbitrary |
| `position` | Order within a side: `1`, or `1` and `2` for doubles partners; absent for golf |
| `name` | The competitor's or player's canonical name |
| `competitorId` / `playerId` | Exactly one; paid-plan API keys only. A team is a competitor; a tennis player, fighter or golfer is a player |
| `score` | `GET /api/v1/events/{id}` only: the side's final score once the box score exists |

Team sport (`GET /api/v1/events?competition=nba`):

```json
{
  "id": "875db31e-eb97-4a9c-a987-f5e47fb44f5a",
  "startTime": "2026-11-05T00:00Z",
  "status": "scheduled",
  "competition": "nba",
  "hasOdds": true,
  "participants": [
    { "side": 1, "sideLabel": "home", "position": 1, "name": "Washington Wizards" },
    { "side": 2, "sideLabel": "away", "position": 1, "name": "Atlanta Hawks" }
  ]
}
```

Tennis singles:

```json
{
  "id": "55aaddff-d914-4417-b4d9-2c10596f13bd",
  "startTime": "2026-11-03T13:00Z",
  "status": "scheduled",
  "competition": "tennis",
  "hasOdds": true,
  "participants": [
    { "side": 1, "position": 1, "name": "Brandon Nakashima" },
    { "side": 2, "position": 1, "name": "Matteo Berrettini" }
  ]
}
```

Tennis doubles list two players per side (`position` 1 and 2). Golf lists the whole field with only `name` (no `side` or `position`). A future has no event, so it has no `participants`. A paid-plan key also gets `competitorId` on each team or `playerId` on each player.

`GET /api/v1/events/{id}` adds each side's final `score` once the box score exists, and `state`, the latest live state (absent when there is none):

```json
"state": { "status": "in_progress", "period": "Q3", "clock": "07:41", "side1Score": 71, "side2Score": 64, "source": "caesars", "observedAt": "2026-11-03T01:12:09Z" }
```

Filters: `competitor_id` on `/events`, `/odds` and `/competitors/{id}/odds` matches events in which that competitor takes part; `/events?player_id=` matches events in which that player takes part.

## Futures: season-long markets (`marketScope`, `segment`, `?scope=`)

Season-long futures — division/conference/championship winners, awards, season leaders, team win totals, and season-long player props — ride the **same `/api/v1/odds` feed** as game markets. They were always in the feed; they are now labelled.

### The `scope` filter (on `GET /api/v1/odds` only)

| Value | Returns |
|---|---|
| `?scope=event` | Single-game markets only |
| `?scope=season` | Season-long futures only |
| `?scope=tournament` | Tournament outrights only (e.g. golf) |
| *(omitted)* | All scopes — the unchanged default |

Matching is **exact**: `scope=season` does **not** include `TOURNAMENT` rows. An unrecognized value returns `400 invalid_parameter` naming the valid values (`event`, `season`, `tournament`) — a typo can never silently look like "no futures exist". `scope` is accepted **only** by `/api/v1/odds`; `/odds/updated`, `/events/{id}/odds`, `/players/{id}/odds` and `/competitors/{id}/odds` ignore it. The `marketScope` and `segment` *fields*, however, appear on rows from all of those feeds.

### Three orthogonal axes — don't collapse them

- **`marketScope`** — *what* the market is about. `SEASON` (a season-long future, tied to a season rather than a game) or `TOURNAMENT` (a tournament outright). **Omitted entirely on ordinary game rows** — absent means event scope, so read it with `.get()`, not `[]`.
- **`period`** — the window *within* that season. `REG_SEASON` settles at the end of the regular season (division winner, win totals); `FULL` settles through the playoffs (Super Bowl / World Series winner). Same field, same meaning as on game rows.
- **`segment`** — *which slice of the competition* the market covers: `AFC_EAST`, `NFC`, `AL`, `NL_WEST`, `EAST`, `SEC`, `BIG_TEN`, … Present only when the market is segment-scoped.

**`segment` is load-bearing.** All 32 NFL `DIVISION_WINNER` selections share a **single** `seasonId` (their `eventId` is null). Group by `(seasonId, marketSubtype, segment)` — never by `eventId` — or eight separate 4-team division races collapse into what looks like one 32-team race.

**Real response** (`GET /api/v1/odds?scope=season&competition=nfl&sportsbook=draftkings&market=CATEGORICAL&limit=1000`, trimmed to two of the four `AFC_EAST` selections):

```json
{
  "success": true,
  "data": [
    {
      "id": "b2e737f7-dfb6-4535-bdc4-852ce6b8d255:draftkings:DIVISION_WINNER:01a01c2f-a38f-76ec-bf53-d62195266d0d",
      "sportsbook": "draftkings",
      "competition": "nfl",
      "eventId": "b2e737f7-dfb6-4535-bdc4-852ce6b8d255",
      "market": "CATEGORICAL",
      "marketSubtype": "DIVISION_WINNER",
      "period": "REG_SEASON",
      "selection": "BUF Bills",
      "priceAmerican": -136,
      "priceDecimal": 1.74,
      "outcomeCode": "WIN",
      "outcomeParticipants": [{ "kind": "competitor", "name": "BUF Bills" }],
      "suspended": false,
      "eventStartTime": "2027-02-16T23:59",
      "updated": "2026-08-20T16:44:17Z",
      "marketScope": "SEASON",
      "segment": "AFC_EAST"
    },
    {
      "id": "b2e737f7-dfb6-4535-bdc4-852ce6b8d255:draftkings:DIVISION_WINNER:01a01c2f-a38f-76f0-833f-3ed2a753d5bd",
      "sportsbook": "draftkings",
      "competition": "nfl",
      "eventId": "b2e737f7-dfb6-4535-bdc4-852ce6b8d255",
      "market": "CATEGORICAL",
      "marketSubtype": "DIVISION_WINNER",
      "period": "REG_SEASON",
      "selection": "NY Jets",
      "priceAmerican": 1900,
      "priceDecimal": 20.0,
      "outcomeCode": "WIN",
      "outcomeParticipants": [{ "kind": "competitor", "name": "NY Jets" }],
      "suspended": false,
      "eventStartTime": "2027-02-16T23:59",
      "updated": "2026-08-20T16:44:17Z",
      "marketScope": "SEASON",
      "segment": "AFC_EAST"
    }
  ],
  "meta": { "count": 593, "updated": "2026-08-20T16:44:17Z" }
}
```

Note both rows share one `eventId` — as do all 32 of that book's division-winner selections, and every other book's. `segment` is the only field separating the AFC East race from the other seven.

### Gotchas that will bite you

- **Filter by family, not subtype.** Winner/award futures live in the `CATEGORICAL` family, so use `?market=CATEGORICAL` and narrow on `marketSubtype` client-side. **`?market=DIVISION_WINNER` returns empty** — same family-vs-subtype rule as player props (see "Market vocabulary" above). Futures also appear under `TEAM_TOTAL` (win totals), `YES_NO` (e.g. `TO_MAKE_PLAYOFFS`), and `PLAYER_TOTAL`.
- **Season player props reuse the game-prop tokens.** A `PLAYER_TOTAL_PASS_YARDS` row with `marketScope: "SEASON"` is a **full-season** passing-yards line (e.g. `line: 3750.5`), not a game line. Check `marketScope` before comparing a prop to a game-level model.
- **`eventStartTime` on a futures row is not a kickoff.** It is the season's end date, normalized server-side: always present, and the same value for every book quoting that season. Don't render it as a game time — a `DIVISION_WINNER` row reading `2027-02-16T23:59` is the season's settlement window, not a Feb 16 game. A futures row has `eventId: null` and a `seasonId` instead.
- **Winner/award futures are one-sided.** `CATEGORICAL` markets carry one `WIN` selection per competitor, with no `side` and the team in `outcomeParticipants` — there is no opposing `NO` side on most books. (`YES_NO` futures such as `TO_MAKE_PLAYOFFS` do carry both sides.)
- **Futures are deliberately excluded from `/edges` and `/arbitrage`.** Season- and tournament-scope markets never enter the no-vig / edge math. This is a fail-closed product decision, not a coverage gap — don't wait for futures edges to appear.
- **Cross-book futures share one season.** All books' futures for a competition carry the same `seasonId`, so a single `seasonId` spans every book's Super Bowl price — line-shop by grouping on `(marketSubtype, segment, outcomeCode)` plus the team (`outcomeParticipants[].competitorId` for a paid-plan key, otherwise the name) across `sportsbook`.

## Credit costs

The following credit costs and plan limits are part of the planned pricing model. Usage is currently unmetered and paid subscriptions are paused.

| Call | Cost |
|---|---|
| Reference endpoints (leagues, seasons, sportsbooks, teams, players, markets, status) | Planned: free, uncounted |
| Data endpoints (odds, events, stats, edges, arbitrage) | Planned: 1 credit per event served in the response |
| Historical endpoints | Planned: 5 credits per event |
| `GET /api/v1/snapshot` | Planned: 1 credit per pull; 5 with `?include_history=true` (every selection's `selectionPrice` rows) |
| Empty responses and `304 Not Modified` | Planned: free |

Planned tiers and limits: Free, Apprentice, Wizard, and Archmage. Every tier is a hard stop at its monthly credit cap. Detailed planned prices and limits: [sportwizzard.com/pricing](https://sportwizzard.com/pricing).

## Rate-limit etiquette

- Bulk pulls: use `/api/v1/snapshot` instead of paging `/odds`, then sync with `/api/v1/odds/updated?since=`.
- Don't poll `/edges` or `/arbitrage` faster than every 20 seconds — the board doesn't refresh faster than that.
- Use the `ETag` header with `If-None-Match` on odds endpoints to avoid transferring an unchanged response body.
- An out-of-season league returns a valid, empty `data: []` (with an explanatory `meta.note`) — that's "out of season," not an error; don't retry-loop it.

## MCP setup

Hosted server (Streamable HTTP, no install): `https://mcp.sportwizzard.com/mcp` — 20 read-only tools over the same v1 API.

**Claude Code:**

```bash
claude mcp add --transport http sportwizzard https://mcp.sportwizzard.com/mcp \
  --header "Authorization: Bearer sw_live_your_api_key_here"
```

**Claude custom connector (claude.ai → Settings → Connectors → Add custom connector):**

- URL: `https://mcp.sportwizzard.com/mcp`
- Header: `Authorization: Bearer sw_live_your_api_key_here`

**Any MCP client (.mcp.json):**

```json
{
  "mcpServers": {
    "sportwizzard": {
      "type": "http",
      "url": "https://mcp.sportwizzard.com/mcp",
      "headers": { "Authorization": "Bearer sw_live_..." }
    }
  }
}
```

Also available as an open-source stdio server: `npx -y sportwizzard-mcp` ([source](https://github.com/sportwizzard/sportwizzard-mcp), includes a mock mode via `SPORTWIZZARD_MOCK=1`).
