Fetches available game odds for one sport and game date. Passing a timestamp selects the date in its first ten characters. To reconstruct what your application knew at a particular time, use a log that retains each quote and when your application received it.
Usage
pa_historical(
sport,
date,
regions = "us",
markets = "h2h",
odds_format = c("decimal", "american"),
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().- date
Character string with the intended UTC game date in
YYYY-MM-DDformat. Convert local times to UTC before choosing the date.- regions
Comma-separated regions string or character vector, default
"us".- markets
Markets to include, e.g.
"h2h,spreads,totals". Character vectors are collapsed with commas.- 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.
Value
Parsed archive results with available events, bookmakers, markets and outcomes. The result can be empty.
Details
Requires an API key and a date within the plan's historical window. Check the archive coverage for your sport and source before spending credits. Its date span can contain gaps. The one-region, one-moneyline request below costs 10 credits once billed and can return an empty result. There is no sandbox equivalent.