> For the complete documentation index, see [llms.txt](https://rock-odds.gitbook.io/rock-odds-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rock-odds.gitbook.io/rock-odds-docs/overview.md).

# RockOdds API documentation

Integrate live and pregame sportsbook odds through a small REST API or a real-time Server-Sent Events (SSE) stream.

The RockOdds API currently covers NFL, NBA, NCAA basketball, NHL, MLB, and soccer.

```
https://rockodds.live/api/v2
```

## Get your first response

With your API key, you can retrieve upcoming NBA games in one request:

```bash
curl --request GET \
  --url "https://rockodds.live/api/v2/pregame?sport=NBA" \
  --header "X-API-Key: YOUR_API_KEY"
```

A successful response contains a `games` array:

```json
{
  "count": 1,
  "games": [
    {
      "game_id": "a1b2c3d4-e5f6-47a8-9012-3456789abcde",
      "sport": "NBA",
      "home_team": "Los Angeles Lakers",
      "away_team": "Boston Celtics",
      "start_time": "2026-08-28T19:30:00-04:00",
      "live": false,
      "markets": {}
    }
  ]
}
```

{% hint style="info" %}
The empty `markets` object above is shortened for readability. Real responses include the markets currently available for each game.
{% endhint %}

## Choose an integration

| If you need to...                            | Start with...                                                           |
| -------------------------------------------- | ----------------------------------------------------------------------- |
| Load odds on demand or on a schedule         | [REST quickstart](/rock-odds-docs/rest-quickstart.md)                   |
| Keep a local odds board updated in real time | [SSE quickstart](/rock-odds-docs/sse-quickstart.md)                     |
| Stream live and pregame odds together        | [`GET /stream?game_status=all`](/rock-odds-docs/endpoints/streaming.md) |
| Retrieve upcoming, non-live games            | [`GET /pregame`](/rock-odds-docs/endpoints/pregame.md)                  |
| Look up one game by ID                       | [`GET /games/{game_id}`](/rock-odds-docs/endpoints/single-game.md)      |

## Recommended next steps

1. Complete the [REST quickstart](/rock-odds-docs/rest-quickstart.md) or [SSE quickstart](/rock-odds-docs/sse-quickstart.md).
2. Read the [data model](/rock-odds-docs/data-model.md) before persisting odds.
3. Add [error handling and retries](/rock-odds-docs/errors-and-limits.md).
4. Move to the [real-time stream](/rock-odds-docs/endpoints/streaming.md) if polling is not fast enough for your use case.
