
Find odds for the sports which are accessible through the Odds API
Source:R/toa_sports_odds.R
toa_sports_odds.RdGet the featured-market odds for a sport which The Odds API covers.
Returns a list of upcoming and live games with featured bookmaker odds for
the specified markets and regions. For player props and other additional
markets, use toa_event_odds() instead.
Usage quota cost: [number of markets] x [number of regions].
Usage
toa_sports_odds(
sport_key,
regions = "us",
markets = "spreads",
odds_format = "decimal",
date_format = "iso"
)Arguments
- sport_key
(string, required): The
sport_keyto look up odds for. Seetoa_sports()for a full lookup ofsport_keyvalues.- regions
(string, required): The region(s) to pull bookmakers from. Multiple can be specified if comma delimited. Options include:
usus2ukeuau
- markets
(string, optional): The featured markets to return. Multiple can be specified if comma delimited. Options include:
h2h(moneyline)spreads(points handicaps)totals(over/under)outrights(futures, select sports only)
- odds_format
(string, optional): Format in which to return odds. Options are
decimal(default) oramerican.- date_format
(string, optional): Format of returned timestamps. Options are
iso(default) orunix.
Value
A long-format tibble with one row per bookmaker market outcome:
| col_name | types | description |
| id | character | Unique event id. |
| sport_key | character | Sport key, e.g. basketball_nba. |
| sport_title | character | Human-readable sport title, e.g. NBA. |
| commence_time | character | Game start time (ISO 8601 string or unix seconds). |
| home_team | character | Home team name. |
| away_team | character | Away team name. |
| bookmaker_key | character | Bookmaker slug, e.g. draftkings. |
| bookmaker | character | Bookmaker display title, e.g. DraftKings. |
| bookmaker_last_update | character | When this bookmaker's odds were last updated. |
| market_key | character | Market key, e.g. spreads. |
| market_last_update | character | When this market's odds were last updated. |
| outcomes_name | character | Outcome label (team name, Over/Under, etc.). |
| outcomes_price | numeric | The price/odds for the outcome. |
| outcomes_point | numeric | The handicap/total line, when applicable. |
See also
toa_event_odds() for a single event's odds (including player props
and alternate lines), toa_event_markets() to list a game's available
market keys, and toa_sports() to find sport_key values. Part of the
SportsDataverse.
Other The Odds API: Odds & Markets:
toa_event_markets(),
toa_event_odds()
Examples
# \donttest{
try(toa_sports_odds(sport_key = 'basketball_nba',
regions = 'us',
markets = 'spreads',
odds_format = 'decimal',
date_format = 'iso'))
#> ── Sports Odds data from the-odds-api.com ──────────── oddsapiR 1.0.0 ──
#> ℹ Data updated: 2026-08-24 08:27:42 UTC
#> ℹ Odds API quota: 10539 used, 4989461 remaining (last call cost 1)
#> # A tibble: 252 × 14
#> id sport_key sport_title commence_time home_team away_team
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 2 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 3 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 4 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 5 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 6 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 7 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 8 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 9 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> 10 26b036ff107f… basketba… NBA 2026-10-20T1… Detroit … Boston C…
#> # ℹ 242 more rows
#> # ℹ 8 more variables: bookmaker_key <chr>, bookmaker <chr>,
#> # bookmaker_last_update <chr>, market_key <chr>,
#> # market_last_update <chr>, outcomes_name <chr>,
#> # outcomes_price <dbl>, outcomes_point <dbl>
# }