Skip to contents

Get the scores for the sports which The Odds API provides coverage.

Returns live and recently completed games for a sport, including scores for games completed within the last 3 days. Live scores update roughly every 30 seconds.

Usage quota cost: 1 credit when days_from is not supplied; 2 credits when days_from is supplied.

Usage

toa_sports_scores(sport_key, days_from = NULL, date_format = "iso")

Arguments

sport_key

(string, required): The sport_key to look up scores for. See toa_sports() for a full lookup of sport_key values.

days_from

(integer, optional): Number of days in the past from which to return completed games, an integer from 1 to 3. If NULL (default), only live and upcoming games are returned.

date_format

(string, optional): Format of returned timestamps. Options are:

  • iso (ISO 8601, the default)

  • unix (epoch seconds)

Value

A tibble of scores for the sport The Odds API provides coverage for:

col_nametypesdescription
idcharacterUnique event id.
sport_keycharacterSport key, e.g. basketball_nba.
sport_titlecharacterHuman-readable sport title, e.g. NBA.
commence_timecharacterGame start time (ISO 8601 string or unix seconds).
completedlogicalTRUE if the game has finished.
home_teamcharacterHome team name.
away_teamcharacterAway team name.
scoreslistPer-team name/score pairs; NULL/NA before scores post.
last_updatecharacterTime the scores were last updated; NA until a game is live.

See also

toa_sports() to discover sport_key values, toa_sports_events() to list upcoming events, and toa_sports_odds() for live/upcoming betting lines. Part of the SportsDataverse.

Other The Odds API: Sports & Events: toa_sports(), toa_sports_events(), toa_sports_participants()

Examples

# \donttest{
   try(toa_sports_scores(sport_key = 'basketball_nba',
                         days_from = NULL,
                         date_format = 'iso'))
#> ── Sports scores data from the-odds-api.com ────────── oddsapiR 1.0.0 ──
#>  Data updated: 2026-06-24 03:15:43 UTC
#>  Odds API quota: 2448 used, 17552 remaining (last call cost 0)
#> # A tibble: 0 × 0
# }