Skip to contents

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". See pa_sports().

date

Character string with the intended UTC game date in YYYY-MM-DD format. 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. TRUE uses the keyless sandbox endpoint, FALSE the live endpoint, NULL (default) defers to the global pa_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.

Examples

if (FALSE) { # \dontrun{
# Replace the example date with one inside your plan's window.
games <- pa_historical(
  "basketball_nba",
  date = "2026-11-29",
  regions = "us",
  markets = "h2h"
)
} # }