Find odds for the sports which are accessible through the Odds API
Source:R/toa_sports_odds.R
toa_sports_odds.Rd
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. Seetoa_sports()
for a full lookup ofsport_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_name | types |
id | character |
sport_key | character |
sport_title | character |
commence_time | character |
home_team | character |
away_team | character |
bookmaker_key | character |
bookmaker | character |
last_update | character |
market_key | character |
outcomes_name | character |
outcomes_price | numeric |
outcomes_point | numeric |
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
# }