Skip to contents

Get bookmaker odds for a single event as they appeared at a point in time.

Like toa_event_odds() but for a historical snapshot: accepts any available market key (including player props and alternate lines) and returns the odds at the snapshot closest to (and at or before) the requested date. Look up a historical event_id with toa_sports_events_history(). The returned timestamp, previous_timestamp and next_timestamp columns let you page through snapshots.

Historical odds for additional markets are available from 2023-05-03 at 5-minute intervals; featured markets reach back to June 2020 on paid plans.

Usage quota cost: [number of unique markets returned] x [number of regions] (the standard rate, not the 10x historical multiplier). Snapshots with no data do not count against the quota.

Usage

toa_event_odds_history(
  sport_key,
  event_id,
  date,
  regions = "us",
  markets = "h2h",
  odds_format = "decimal",
  date_format = "iso",
  bookmakers = NULL
)

Arguments

sport_key

(string, required): The sport_key to look up odds for. See toa_sports() for a full lookup of sport_key values.

event_id

(string, required): The event_id to look up odds for. See toa_sports_events_history() for a full lookup of event_id values.

date

(string, required): The timestamp of the data snapshot to return, in ISO 8601 format (e.g. 2023-10-10T12:15:00Z). The API returns the closest snapshot equal to or earlier than this value.

regions

(string, required): The region(s) to pull bookmakers from. Multiple can be specified if comma delimited. Options include:

  • us

  • us2

  • uk

  • eu

  • au

markets

(string, optional): The markets to return. Multiple can be specified if comma delimited. In addition to h2h, spreads, totals and outrights, this endpoint accepts additional markets such as alternate lines and player props. See the betting markets documentation.

odds_format

(string, optional): Format in which to return odds. Options are decimal (default) or american.

date_format

(string, optional): Format of returned timestamps. Options are iso (default) or unix.

bookmakers

(string, optional): Comma-separated list of bookmakers to be returned. If both bookmakers and regions are specified, bookmakers takes precedence. Every group of 10 bookmakers counts as 1 region against the usage quota.

Value

A long-format tibble with one row per bookmaker market outcome:

col_nametypesdescription
timestampcharacterSnapshot timestamp returned (closest at/before date).
previous_timestampcharacterPreceding available snapshot; use as date to page back.
next_timestampcharacterNext available snapshot; use as date to page forward.
idcharacterUnique event id (echoes event_id).
sport_keycharacterSport key, e.g. basketball_nba.
sport_titlecharacterHuman-readable sport title, e.g. NBA.
commence_timecharacterGame start time (ISO 8601 string or unix seconds).
home_teamcharacterHome team name.
away_teamcharacterAway team name.
bookmaker_keycharacterBookmaker slug, e.g. draftkings.
bookmakercharacterBookmaker display title, e.g. DraftKings.
bookmaker_last_updatecharacterWhen this bookmaker's odds were last updated.
market_keycharacterMarket key, e.g. player_points.
market_last_updatecharacterWhen this market's odds were last updated.
outcomes_namecharacterOutcome label (team, Over/Under, player name, etc.).
outcomes_descriptioncharacterOutcome description (player name for props); absent for featured markets.
outcomes_pricenumericThe price/odds for the outcome.
outcomes_pointnumericThe handicap/total/prop line, when applicable.

See also

toa_sports_events_history() to look up historical event_id values, toa_sports_odds_history() for featured-market odds across all events at a snapshot, and toa_event_odds() for current event odds. Part of the SportsDataverse.

Other The Odds API: Historical: toa_sports_events_history(), toa_sports_odds_history()

Examples

# \donttest{
   try(toa_event_odds_history(sport_key = 'basketball_nba',
                              event_id = '93af4b300a4c0dded909234ea32e9abd',
                              date = '2024-01-15T12:15:00Z',
                              regions = 'us',
                              markets = 'h2h',
                              odds_format = 'decimal',
                              date_format = 'iso'))
#> ── Historical Event Odds data from the-odds-api.com ── oddsapiR 1.0.0 ──
#>  Data updated: 2026-06-13 04:17:24 UTC
#>  Odds API quota: 2218 used, 17782 remaining (last call cost 10)
#> # A tibble: 20 × 16
#>    timestamp           previous_timestamp next_timestamp id    sport_key
#>    <chr>               <chr>              <chr>          <chr> <chr>    
#>  1 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  2 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  3 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  4 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  5 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  6 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  7 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  8 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#>  9 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 10 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 11 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 12 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 13 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 14 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 15 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 16 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 17 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 18 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 19 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> 20 2024-01-15T12:10:3… 2024-01-15T12:05:… 2024-01-15T12… 93af… basketba…
#> # ℹ 11 more variables: sport_title <chr>, commence_time <chr>,
#> #   home_team <chr>, away_team <chr>, bookmaker_key <chr>,
#> #   bookmaker <chr>, bookmaker_last_update <chr>, market_key <chr>,
#> #   market_last_update <chr>, outcomes_name <chr>, outcomes_price <dbl>
# }