Skip to contents

Get the odds history for the sports which the Odds API provides coverage

   try(toa_sports_odds(sport_key = 'baseball_mlb', 
                       regions = 'us', 
                       markets = 'spreads', 
                       odds_format = 'decimal',
                       date_format = 'iso'))

Usage

toa_sports_odds_history(
  sport_key,
  event_ids,
  date,
  regions = "us",
  markets = "spreads",
  odds_format = "decimal",
  date_format = "iso",
  bookmakers = NULL
)

Arguments

sport_key

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

event_ids

The event_id's to look up odds for. See toa_sports_odds() for a full lookup of event_id values.

date

The timestamp of the data snapshot to be returned, specified in ISO8601 format. The historical odds API will return the closest snapshot equal to or earlier than the provided date parameter Example : 2022-10-10T12:15:00Z

regions

The region to pull odds from. Options include:

  • us

  • uk

  • us

  • eu

  • au Multiple can be specified if comma delimited.

markets

The type of odds to return. Multiple can be specified if comma delimited. Options include:

  • h2h

  • spreads

  • totals

odds_format

The format in which to return odds. Options include:

  • decimal

  • american

date_format

Date format. Options include:

  • iso

  • unix

bookmakers

Comma-separated list of bookmakers to be returned. If both bookmakers and regions are specified, bookmakers takes precendence. Bookmakers can be from any region. Every group of 10 bookmakers counts as 1 request. For example for a single market, specifying up to 10 bookmakers counts as 1 request. Specifying between 11 and 20 bookmakers counts as 2 requests

Value

Sports for which The Odds API provides betting information for as a tibble:

col_nametypes
idcharacter
sport_keycharacter
sport_titlecharacter
commence_timecharacter
home_teamcharacter
away_teamcharacter
bookmaker_keycharacter
bookmakercharacter
last_updatecharacter
market_keycharacter
outcomes_namecharacter
outcomes_pricenumeric
outcomes_pointnumeric

Details

try(toa_sports_odds_history(sport_key = 'basketball_ncaab', 
                               event_ids = '48db9c3293a52baab881d95d38f37a98',
                               date = '2023-03-18T12:15:00Z',
                               regions = 'us', 
                               markets = 'spreads', 
                               odds_format = 'decimal',
                               date_format = 'iso',
                               bookmakers = NULL))