# Odds WebSocket integration: snapshots, gaps and replay

Connect to GetOdds retained-odds WebSocket delivery and handle checkpoints, reconnects and source coverage.

Canonical page: https://getoddsapi.com/odds-websocket

## Free API key

Get a free GetOdds API key: **1,000 requests per UTC day and 60 per minute, no card**. One key covers REST and the hosted MCP server.

Sign up: https://getoddsapi.com/sign-up?ref=ai-claudebot

## Quickstart

1. Create an account at https://getoddsapi.com/sign-up?ref=ai-claudebot, open https://getoddsapi.com/dashboard and issue a key with the sources you need (draftkings, fanduel, betrivers, prizepicks or underdog). Keep it in a server environment variable named GETODDS_API_KEY.
2. Read current DraftKings NBA spreads with curl:

```bash
curl --fail-with-body "https://getoddsapi.com/api/v1/odds?sport=NBA&market=spread&fresh_only=true&limit=50" \
  -H "Authorization: Bearer $GETODDS_API_KEY"
```

3. The same request in Python (standard library only):

```python
import json, os, urllib.request

req = urllib.request.Request(
    "https://getoddsapi.com/api/v1/odds?sport=NBA&market=spread&fresh_only=true&limit=50",
    headers={"Authorization": "Bearer " + os.environ["GETODDS_API_KEY"]},
)
with urllib.request.urlopen(req) as res:
    rows = json.load(res)["data"]
for row in rows:
    print(row["away"], "at", row["home"], row["side"], row["line"], row["american"], row["observed_at"])
```

4. Check `observed_at`, `age_seconds` and `stale` on every row before using a price. Full reference: https://getoddsapi.com/docs

## Use with Claude (MCP)

```bash
claude mcp add --transport http getodds https://getoddsapi.com/api/mcp \
  --header "Authorization: Bearer $GETODDS_API_KEY"
```

The MCP tools follow the key's source grants and share its allowance. Setup guide: https://getoddsapi.com/use-with-claude

## Pricing

| Plan | Allowance | Price |
| --- | --- | --- |
| Free key | 1,000 requests a day, 60 a minute | $0, no card |
| Developer Bundle | 10,000 requests or credits a month on each of four sources | $149 a month |

Free development allowance: 1,000 requests per UTC day and 60 per minute per account, with no payment step. Paid: the Developer Bundle at $149 per month, with 10,000 monthly requests or credits on each of four sources.
Details: https://getoddsapi.com/bundle

## Guide


Canonical: https://getoddsapi.com/odds-websocket
Reviewed: 2026-11-07 UTC

Connect to GetOdds retained-odds WebSocket delivery and handle checkpoints, reconnects and source coverage.

## Choose the actual transport

GetOdds offers wss://getoddsapi.com/api/v1/odds/stream for retained DraftKings-via-ESPN odds changes. Send your GetOdds bearer key from a server-side client and follow /docs/odds-stream. Delivery polls retained changes every five seconds; it does not increase source collection frequency or guarantee complete capture. The four-source /api/v1/markets threshold endpoint remains REST-only.

## A reliable consumer has explicit states

Start disconnected. Authenticate, obtain a snapshot and its documented cursor, then apply ordered changes. Persist the last successfully applied cursor only after committing the change. A duplicate should have no effect. A sequence gap should trigger the provider’s documented recovery path. Do not invent cursors from local timestamps.

## Recovery is part of the integration

On a transient disconnect, reconnect with bounded exponential backoff and jitter. On authentication or entitlement refusal, stop and fix the account. If replay retention has elapsed, clear the partial view and request a new snapshot. Use a bounded input queue; a slow consumer should resynchronize instead of accumulating unlimited memory.

## Evaluate the competitor on the same workload

Odds-API.io documents WebSocket delivery and replay behavior. Test the same event set, market filters, reconnect scenario and consumer lag on each candidate. Record source timestamps and receive timestamps separately; measuring HTTP latency does not establish upstream quote latency.

## Questions

### Can I use my GetOdds key on a branded stream?

No. Use the credential and entitlement documented by that branded service.

### Does polling become a WebSocket feed?

GetOdds uses a real WebSocket connection to deliver five-second polls of retained changes. Each successful poll costs one shared credit, including empty polls. Transport, source sampling and credit consumption are separate concerns.

### What if a replay cursor has expired?

Follow the provider’s documented resnapshot procedure; do not silently continue with an incomplete board.

## Sources

- [DraftKingsAPI documentation](https://draftkingsapi.com/agents.md)
- [PrizePicksAPI documentation](https://prizepicksapi.com/agents.md)
- [Odds-API.io WebSocket reference](https://docs.odds-api.io/guides/websockets)

Independent product; not affiliated with the operators named. No picks or predicted profits.

---

GetOdds is an independent developer product and is not affiliated with any sportsbook or pick’em operator. Prices describe data, not betting advice.
