Skip to contents

Get the odds 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(
  sport_key,
  regions = "us",
  markets = "spreads",
  odds_format = "decimal",
  date_format = "iso"
)

Arguments

sport_key

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

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

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

Examples

# \donttest{
   try(toa_sports_odds(sport_key = 'baseball_mlb', 
                       regions = 'us', 
                       markets = 'spreads', 
                       odds_format = 'decimal',
                       date_format = 'iso'))
#> ── Sports Odds data from the-odds-api.com ──────────── oddsapiR 0.0.1 ──
#>  Data updated: 2022-06-21 17:38:49 UTC
#> # A tibble: 526 × 13
#>    id            sport_key sport_title commence_time home_team away_team
#>    <chr>         <chr>     <chr>       <chr>         <chr>     <chr>    
#>  1 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  2 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  3 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  4 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  5 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  6 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  7 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  8 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#>  9 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#> 10 142e714d1888… baseball… MLB         2022-06-21T2… Cincinna… Los Ange…
#> # … with 516 more rows, and 7 more variables: bookmaker_key <chr>,
#> #   bookmaker <chr>, last_update <chr>, market_key <chr>,
#> #   outcomes_name <chr>, outcomes_price <dbl>, outcomes_point <dbl>
# }