Fetches historical closing lines for model calibration and CLV analysis. Available books, markets and dates depend on the dataset and account. Requires an API key; errors in sandbox mode.
Usage
pa_closing_odds(
sport,
markets = "h2h",
bookmakers = NULL,
season = NULL,
date = NULL,
date_from = NULL,
date_to = NULL,
player = NULL,
odds_format = c("american", "decimal"),
sandbox = NULL
)Arguments
- sport
A sport key such as
"basketball_nba"or a short league name such as"nba","nfl","nhl"or"epl". Seepa_sports().- markets
Markets to include, e.g.
"h2h,spreads,totals". Character vectors are collapsed with commas.- bookmakers
Optional bookmaker keys to filter to.
- season
Optional season filter, e.g.
"2023".- date
Optional single date filter (
"YYYY-MM-DD").- date_from, date_to
Optional date range filters.
- player
Optional player name filter for prop closing lines.
- odds_format
"decimal"or"american".- sandbox
Logical or
NULL.TRUEuses the keyless sandbox endpoint,FALSEthe live endpoint,NULL(default) defers to the globalpa_sandbox()toggle.