
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'))
#> ✖ 2026-06-24 03:15:41.64634: Invalid arguments or no odds data available for basketball_nba!
#> ✖ Error:
#> Error in UseMethod("unnest"): no applicable method for 'unnest' applied to an object of class "list"
#> data frame with 0 columns and 0 rows
# }