Skip to contents

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

   try(toa_sports_scores(sport_key = 'baseball_mlb', 
                         days_from = NULL,
                         date_format = 'iso'))

Usage

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

Arguments

sport_key

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

days_from

(integer, optional): Integer from 1 to 3. Defaults to 1.

date_format

(string, optional): Date format. Options include:

  • iso

  • unix

Value

Sports scores which The Odds API provides scores information for as a tibble:

col_nametypes
idcharacter
sport_keycharacter
sport_titlecharacter
commence_timecharacter
completedlogical
home_teamcharacter
away_teamcharacter
scoreslogical
last_updatelogical

Examples

# \donttest{
   try(toa_sports_scores(sport_key = 'baseball_mlb', 
                         days_from = NULL,
                         date_format = 'iso'))
#> ── Sports Odds data from the-odds-api.com ──────────── oddsapiR 0.0.2 ──
#>  Data updated: 2022-12-29 04:27:50 UTC
#> # A tibble: 0 × 0
# }