# Historical Odds Data API
URL: https://sockodds.com/use-cases/historical-odds-data-api/

> Finished events are never pruned from the feed, so an odds archive of every Australian book starts the day you start pulling.

Finished events are never pruned from the feed, so an odds archive of every Australian book starts the day you start pulling.

SockOdds never prunes a finished event. From the day you start pulling, every event your plan can see stays queryable with its last-seen prices from every book, its status and its results — an archive of the Australian market that grows on its own. What the feed does not do yet is snapshot opening and closing prices; that part is yours.

## Why build your odds history on SockOdds

- **Retention by design.** The source never deletes; a stale event is flagged, not dropped.
- **Every book, every market, last price seen.** `byBookmaker` with `lastUpdatedAt`.
- **Fair prices as labels.** `fairOdds` on Base and above.
- **Results in the same object.** Grade the archive.
- **Date windows.** `startsAfter` / `startsBefore` / `finalized=true`.

## How an odds-history backtest works with our data

### Acquire finalized events

`/events?leagueID=AFL&startsAfter=…&startsBefore=…&finalized=true`, paging with `cursor`.

### Derive features

Last price per book, consensus, fair price, and — if you snapshot on a schedule — line movement.

### Grade and measure

Compare with `results`.

## Example request

```bash
curl "https://api.sockodds.com/v2/events/?leagueID=NRL&finalized=true&startsAfter=2026-09-01T00:00:00Z&limit=100" \
  -H "x-api-key: YOUR_API_KEY"
```

Finished NRL events with the last odds seen and results:

```json
{
  "eventID": "afl_2026-09-03_fremantle_vs_hawthorn",
  "leagueID": "AFL",
  "odds": {
    "points-all-game-eo-odd": {
      "oddID": "points-all-game-eo-odd",
      "opposingOddID": "points-all-game-eo-even",
      "marketName": "Odd/Even Total Points",
      "statID": "points",
      "statEntityID": "all",
      "periodID": "game",
      "betTypeID": "eo",
      "sideID": "odd",
      "fairOdds": null,
      "bookOdds": "-116",
      "byBookmaker": {
        "unibet": {
          "odds": "-115",
          "decimal": 1.87,
          "available": true
        },
        "tabtouch": {
          "odds": "-118",
          "decimal": 1.85,
          "available": true
        }
      }
    }
  }
}
```

## SockOdds vs building your own odds archive

| Capability | SockOdds | building your own odds archive |
| --- | --- | --- |
| Retention | Finished events kept | Snapshot and store every poll forever |
| No-vig fair odds | Built in | De-vig yourself |
| Results | On the event | A separate results feed |
| Opening & closing lines | Not snapshotted yet — poll and store | Same |
| Normalised ids | One `oddID` | Reconcile per book |

## Frequently asked questions

### What is a historical odds data API?

A feed from which past events and their prices can be queried. SockOdds retains events from 2026-09 onward.

### Which plan includes historical odds?

Every plan can query retained events it is scoped to.

### Do you provide opening and closing lines?

Not yet; poll and store them yourself.

### Can I compute closing line value?

If you snapshot before kick-off, yes.

### Are results included?

Where the source carries them.

### How do I join across books and sports?

On `eventID` and `oddID`.

## Related use cases

- [Odds Data API for Sports Betting Models & Backtesting](https://sockodds.com/use-cases/sports-betting-machine-learning/): Sports betting machine learning data API with retained events, no-vig fair odds labels, and results for training and backtesting models on AFL, NRL and more..
- [Odds API for Bet Tracking & Settlement](https://sockodds.com/use-cases/bet-tracking-settlement-api/): A bet tracking and settlement API: grade bets from results and the started/ended/finalized flags.
- [Odds API for Positive EV Betting](https://sockodds.com/use-cases/positive-ev-betting-api/): Positive EV betting API with no-vig fairOdds and every AU book's price side by side, so you can surface +EV bets without building your own devig pipeline..
- [Pricing](https://sockodds.com/pricing/): plans priced on request rate and scope, including a free Lite tier with no card.

## Start building today

Free plan available. Set up in 5 minutes. Scale when you're ready.
