Use case: model builders

Backtest a betting model against real closing lines

Grade model picks against the closing line, the benchmark that separates real edge from variance.

Who this is for

Quants and hobbyist modelers who want to know whether their picks beat the close. Game-line history runs continuously back to 2005, and the prop archive holds 30M+ prop closing lines collected since 2022.

Recommended workflow
  1. Check /historical/coverage for your sport before paying
  2. Pull historical odds by date range for features
  3. Grade every pick against the closing price
  4. Track beat rate and average CLV separately from win rate

The three endpoints this build uses

GET /v1/historical/sports/{sport_key}/oddsHistorical odds by date for building the feature set your model trains on.
GET /v1/historical/sports/{sport_key}/closing-oddsClosing lines for game markets and player props, the benchmark your picks are graded against.
GET /v1/historical/coveragePublic, no-auth coverage stats: rows, span, and sources per sport. Verify the archive fits your backtest before you commit.

Working code

import requests

closes = requests.get(
    "https://parlay-api.com/v1/historical/sports/baseball_mlb/closing-odds",
    params={"markets": "h2h", "dateFrom": "2026-04-01", "dateTo": "2026-04-30"},
    headers={"X-API-Key": "YOUR_KEY"},
).json()
# join model picks to the closing price of the same market, then
# measure beat rate and average CLV in probability space

Which tier fits

Historical and closing-line endpoints are available from the Pro tier up. The coverage endpoint is public, so verify the archive covers your sport and seasons before paying anything. Current limits are on the pricing page.

Example repo

Start from betting-model-starter, an open-source starting point for this exact build.

Build links

/answers/backtest-betting-model/answers/get-historical-closing-lines/historical-coverage