Skip to contents

Get the list of in-play and pre-match events for a sport.

Returns a list of events without odds. The id returned here is the event_id consumed by toa_event_odds() and toa_event_markets().

Usage quota cost: Free. This endpoint does not count against your quota.

Usage

toa_sports_events(
  sport_key,
  date_format = "iso",
  event_ids = NULL,
  commence_time_from = NULL,
  commence_time_to = NULL,
  include_rotation_numbers = FALSE
)

Arguments

sport_key

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

date_format

(string, optional): Format of returned timestamps. Options are iso (default) or unix.

event_ids

(string, optional): Comma-separated list of event ids to filter the response to. Defaults to NULL (all events).

commence_time_from

(string, optional): Filter to events that commence on and after this ISO 8601 timestamp (e.g. 2023-09-09T00:00:00Z).

commence_time_to

(string, optional): Filter to events that commence on and before this ISO 8601 timestamp (e.g. 2023-09-09T00:00:00Z).

include_rotation_numbers

(logical, optional): If TRUE, include the home_rotation and away_rotation columns when available. Defaults to FALSE.

Value

A tibble with one row per event:

col_nametypesdescription
idcharacterUnique event id. Use as event_id elsewhere.
sport_keycharacterSport key, e.g. basketball_nba.
sport_titlecharacterHuman-readable sport title, e.g. NBA.
commence_timecharacterEvent start time (ISO 8601 string or unix seconds).
home_teamcharacterHome team name.
away_teamcharacterAway team name.
home_rotationintegerHome rotation number (only when include_rotation_numbers = TRUE).
away_rotationintegerAway rotation number (only when include_rotation_numbers = TRUE).

See also

toa_sports() to discover sport_key values, toa_event_odds() to pull odds for a specific event by its id, and toa_event_markets() to see available market keys per bookmaker. Part of the SportsDataverse.

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

Examples

# \donttest{
   try(toa_sports_events(sport_key = 'basketball_nba'))
#> ── Sports Events data from the-odds-api.com ────────── oddsapiR 1.0.0 ──
#>  Data updated: 2026-08-24 08:27:41 UTC
#>  Odds API quota: 10535 used, 4989465 remaining (last call cost 0)
#> # A tibble: 41 × 6
#>    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 2b042ddad3d3… basketba… NBA         2026-10-20T2… New York… Philadel…
#>  3 bccd283de569… basketba… NBA         2026-10-21T0… San Anto… Oklahoma…
#>  4 85e6e4e2404e… basketba… NBA         2026-10-21T2… Orlando … Atlanta …
#>  5 164cc0396837… basketba… NBA         2026-10-21T2… Washingt… Milwauke…
#>  6 47cc511bb5ce… basketba… NBA         2026-10-21T2… Brooklyn… Charlott…
#>  7 93cdd8e4ade5… basketba… NBA         2026-10-21T2… Miami He… Minnesot…
#>  8 fd33c09c84ab… basketba… NBA         2026-10-22T0… New Orle… Indiana …
#>  9 e6769c813dd6… basketba… NBA         2026-10-22T0… Memphis … Utah Jazz
#> 10 af2f08407539… basketba… NBA         2026-10-22T0… Houston … Dallas M…
#> # ℹ 31 more rows
# }