Answer

How to backtest a betting model

A practical method for backtesting sports betting models against historical odds, closing lines, and closing line value.

How do I backtest a betting model?

Backtest against prices that were actually available: pull historical odds snapshots and closing lines, grade your model's picks at those prices, and track closing line value separately from profit. ParlayAPI's archive holds 1.7M+ closing game lines with continuous coverage back to 2005, plus 30M+ prop closing lines since June 2022.

More detail

The most common backtesting mistake is grading picks at prices that never existed, such as averages or synthetic lines. Grade each pick at a real price a real book published at the time. ParlayAPI's historical endpoints return only stored real source prices; missing prices stay missing rather than being filled in.

Measure two things separately. Profit tells you whether the strategy made money over the sample. Closing line value tells you whether your entry prices consistently beat the market's final price, which is the stronger predictor of future performance because it is less noisy than win-loss variance.

Respect the archive's shape: coverage is continuous back to 2005 for game lines, with prop closing lines starting June 2022 and depth varying by sport and book. Check /v1/historical/sports/{sport_key}/coverage before training so your model does not learn from a gap.

Endpoint

GET /v1/historical/sports/{sport_key}/odds

curl 'https://parlay-api.com/v1/historical/sports/basketball_nba/odds?date=2026-04-01&markets=h2h' -H 'X-API-Key: YOUR_KEY'

Why developers use it

FAQ

What data do I need for a betting backtest?

Historical odds snapshots for entry prices, closing lines for CLV grading, and results for settlement. ParlayAPI serves the first two; scores endpoints and public results cover the third.

Why measure CLV instead of just profit?

Profit over a few hundred bets is mostly variance. Consistently beating the closing line is a repeatable skill signal that predicts long-run profit better than the short-run ledger does.

How far back does the odds archive go?

Game line coverage is continuous back to 2005, including NFL, 22 soccer leagues, and expanding US sports coverage. Prop closing lines run from June 2022, with 30M+ rows archived.

Related

/answers/historical-odds-api/answers/get-historical-closing-lines/use-cases/prop-model-backtesting/historical-coverage