Skip to contents

Get ESPN NHL Season Weeks (core-v2)

Usage

espn_nhl_season_weeks(season = most_recent_nhl_season(), season_type = 2, ...)

Arguments

season

Season end-year (e.g. 2026). Defaults to most_recent_nhl_season().

season_type

Season type code: 1=pre-season, 2=regular season, 3=post-season. Defaults to 2.

...

Reserved for forward compatibility.

Value

A fastRhockey_data tibble with one row per week, or an empty tibble when the endpoint returns no items. Note: The NHL does not use weekly scheduling in the ESPN core-v2 API - this endpoint consistently returns count=0 for NHL. An empty tibble is returned gracefully:

col_nametypesdescription
refcharacter$ref URL for the week object.
weekintegerWeek number parsed from the $ref URL.
seasonintegerSeason year (echoed from arg).
season_typeintegerSeason type code (echoed from arg).
countintegerTotal weeks in the collection (0 for NHL).
page_countintegerTotal pages in the collection.

See also

family_espn_nhl lists every function in this family.

Author

Saiem Gilani

Examples

# \donttest{
  # NOTE: Returns empty tibble for NHL (ESPN does not populate weeks for hockey)
  try(espn_nhl_season_weeks(season = 2026, season_type = 2))
#> ── NHL Season Weeks data from ESPN core-v2 ──────────────── fastRhockey 1.1.0 ──
#> ℹ Data updated: 2026-11-13 21:27:25 UTC
#> # A tibble: 25 × 6
#>    ref                                  week season season_type count page_count
#>    <chr>                               <int>  <int>       <int> <int>      <int>
#>  1 http://sports.core.api.espn.com/v2…     1   2026           2    28          2
#>  2 http://sports.core.api.espn.com/v2…     2   2026           2    28          2
#>  3 http://sports.core.api.espn.com/v2…     3   2026           2    28          2
#>  4 http://sports.core.api.espn.com/v2…     4   2026           2    28          2
#>  5 http://sports.core.api.espn.com/v2…     5   2026           2    28          2
#>  6 http://sports.core.api.espn.com/v2…     6   2026           2    28          2
#>  7 http://sports.core.api.espn.com/v2…     7   2026           2    28          2
#>  8 http://sports.core.api.espn.com/v2…     8   2026           2    28          2
#>  9 http://sports.core.api.espn.com/v2…     9   2026           2    28          2
#> 10 http://sports.core.api.espn.com/v2…    10   2026           2    28          2
#> # ℹ 15 more rows
# }