
Find scores for the sports which are accessible through the Odds API
Source:R/toa_sports_scores.R
toa_sports_scores.RdGet 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.
Arguments
- sport_key
(string, required): The
sport_keyto look up scores for. Seetoa_sports()for a full lookup ofsport_keyvalues.- 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_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). |
| completed | logical | TRUE if the game has finished. |
| home_team | character | Home team name. |
| away_team | character | Away team name. |
| scores | list | Per-team name/score pairs; NULL/NA before scores post. |
| last_update | character | Time 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
# }