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 = 'basketball_ncaab', 
                       regions = 'us', 
                       markets = 'spreads', 
                       odds_format = 'decimal',
                       date_format = 'iso'))
#> ── Sports Odds data from the-odds-api.com ──────────── oddsapiR 0.0.3 ──
#>  Data updated: 2023-03-19 21:44:07 UTC
#> # A tibble: 280 × 14
#>    id    sport…¹ sport…² comme…³ home_…⁴ away_…⁵ bookm…⁶ bookm…⁷ bookm…⁸
#>    <chr> <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1 cee2… basket… NCAAB   2023-0… North … Sam Ho… draftk… DraftK… 2023-0…
#>  2 cee2… basket… NCAAB   2023-0… North … Sam Ho… draftk… DraftK… 2023-0…
#>  3 cee2… basket… NCAAB   2023-0… North … Sam Ho… willia… Willia… 2023-0…
#>  4 cee2… basket… NCAAB   2023-0… North … Sam Ho… willia… Willia… 2023-0…
#>  5 cee2… basket… NCAAB   2023-0… North … Sam Ho… fanduel FanDuel 2023-0…
#>  6 cee2… basket… NCAAB   2023-0… North … Sam Ho… fanduel FanDuel 2023-0…
#>  7 ee2d… basket… NCAAB   2023-0… Marque… Michig… fanduel FanDuel 2023-0…
#>  8 ee2d… basket… NCAAB   2023-0… Marque… Michig… fanduel FanDuel 2023-0…
#>  9 ee2d… basket… NCAAB   2023-0… Marque… Michig… draftk… DraftK… 2023-0…
#> 10 ee2d… basket… NCAAB   2023-0… Marque… Michig… draftk… DraftK… 2023-0…
#> # … with 270 more rows, 5 more variables: market_key <chr>,
#> #   market_last_update <chr>, outcomes_name <chr>,
#> #   outcomes_price <dbl>, outcomes_point <dbl>, and abbreviated
#> #   variable names ¹​sport_key, ²​sport_title, ³​commence_time,
#> #   ⁴​home_team, ⁵​away_team, ⁶​bookmaker_key, ⁷​bookmaker,
#> #   ⁸​bookmaker_last_update
# }