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-06-13 04:17:26 UTC
#>  Odds API quota: 2231 used, 17769 remaining (last call cost 0)
#> # A tibble: 1 × 6
#>   id             sport_key sport_title commence_time home_team away_team
#>   <chr>          <chr>     <chr>       <chr>         <chr>     <chr>    
#> 1 6cc5c3b9cfcb1… basketba… NBA         2026-06-14T0… San Anto… New York…
# }