Get NFL schedule for a specific year from ESPN's API

get_nfl_schedule(season)

Arguments

season

Either numeric or character

Value

Returns a tibble

Examples

# Get all games from 2018 season, note that this will have some overlap
# between seasons, for example 2018 returns 2018-01-01 to 2018-12-31
get_nfl_schedule(season = "2018")
#> Returning data for 2018!
#> # A tibble: 333 × 60
#>    matchup    match…¹ season  type slug  game_id game_…² game_…³ atten…⁴ venue…⁵
#>    <chr>      <chr>    <int> <int> <chr> <chr>   <chr>   <chr>     <int> <chr>  
#>  1 Tennessee… TEN @ …   2017     3 post… 400999… s:20~l… 2018-0…   73319 3622   
#>  2 Atlanta F… ATL @ …   2017     3 post… 400999… s:20~l… 2018-0…   74300 477    
#>  3 Buffalo B… BUF @ …   2017     3 post… 400999… s:20~l… 2018-0…   69442 3712   
#>  4 Carolina … CAR @ …   2017     3 post… 400999… s:20~l… 2018-0…   73186 3493   
#>  5 Atlanta F… ATL @ …   2017     3 post… 400999… s:20~l… 2018-0…   69596 3806   
#>  6 Tennessee… TEN @ …   2017     3 post… 400999… s:20~l… 2018-0…   65878 3738   
#>  7 Jacksonvi… JAX @ …   2017     3 post… 400999… s:20~l… 2018-0…   64524 3752   
#>  8 New Orlea… NO @ M…   2017     3 post… 400999… s:20~l… 2018-0…   66612 5239   
#>  9 Jacksonvi… JAX @ …   2017     3 post… 400999… s:20~l… 2018-0…   65878 3738   
#> 10 Minnesota… MIN @ …   2017     3 post… 400999… s:20~l… 2018-0…   69596 3806   
#> # … with 323 more rows, 50 more variables: venue_name <chr>, venue_city <chr>,
#> #   venue_state <chr>, capacity <int>, indoor <lgl>, home_team_name <chr>,
#> #   home_team_logo <chr>, home_team_abb <chr>, home_team_id <chr>,
#> #   home_team_location <chr>, home_team_full <chr>, home_team_color <chr>,
#> #   home_score <int>, home_win <int>, home_record <chr>, away_team_name <chr>,
#> #   away_team_logo <chr>, away_team_abb <chr>, away_team_id <chr>,
#> #   away_team_location <chr>, away_team_full <chr>, away_team_color <chr>, …