Skip to contents

Phases of a league season (regular season, play-in and playoff rounds, playout): the phase_id values the table wrappers take, with each phase's name and game count.

Reads the Swiss Ice Hockey Federation statistics API (data.sihf.ch, keyless JSON). SIHF keys a season by its END year (2026 = 2025-26). An unknown season, league_id or phase_id is never an error upstream (SIHF silently answers another one), so every table answer is checked against the body's own filter echo and refused when it differs. Every request is spaced at least one second from the last one to the host.

Usage

sihf_phases(season, league_id = 1L, table = "results", language = "en")

Arguments

season

Required. Season by its END year (2026 = 2025-26). A season SIHF does not have raises fastRhockey_no_data error (the API itself silently answers another one).

league_id

SIHF league id: 1 = National League, 2 = Swiss League, 100 = MyHockey League, 3 = 1. Liga, 43 = SWHL B, 113 = U21-Elit (the body's League filter lists them). An id SIHF does not have for the season raises fastRhockey_no_data error.

table

SIHF table whose phase list to read; each table lists its own. results (sihf_results) lists every round with its game count; player / goalkeeper (sihf_player_stats / sihf_goalie_stats) add the Playoff Overall and Play-In Overall totals; standing (sihf_standings) lists only the phases played as a table (the regular season, in some seasons a playout round).

language

Response language. Only part of the body is translated: status, position and penalty names stay German.

Value

A fastRhockey_data tibble with 4 columns. A zero-row tibble with these columns when the payload holds no rows.

col_nametypedescription
seasonintegerSeason by its END year (2026 = 2025-26), from the body's echo of the Season filter.
phase_idintegerSIHF phase id (integer), the value the phase_id argument of sihf_results, sihf_standings, sihf_player_stats and sihf_goalie_stats takes. Ids differ by league, season and table.
phase_namecharacterPhase name as SIHF publishes it, without the trailing count (e.g., "Regular Season", "Playoff 1/4 Final", "Playoff Overall").
n_gamesintegerGames played in the phase, from the results table's phase list; null for the other tables and for a phase still in progress.

Errors

  • fastRhockey_no_data: SIHF answered 404 (unknown game), or ignored a requested season, league or phase and served another one.

  • fastRhockey_bad_request: SIHF answered 400 / 422, or an argument is invalid.

  • fastRhockey_asset_fetch: any other non-2xx answer or a dead connection after retries, an empty or unreadable body, a stub or redirect body, a table without its filter echo, a truncated table, or a gameoverview body for another game.

Examples

# \donttest{
  try(sihf_phases(season = 2026, league_id = 1))
#> ── SIHF Phases Information from data.sihf.ch ───────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:59:45 UTC
#> # A tibble: 7 × 4
#>   season phase_id phase_name        n_games
#>    <int>    <int> <chr>               <int>
#> 1   2026     5318 Playoff Final           7
#> 2   2026     5317 Playoff 1/2 Final      10
#> 3   2026     5295 Playoff 1/4 Final      23
#> 4   2026     5307 Play-In Round 2         2
#> 5   2026     5293 Play-In Round 1         4
#> 6   2026     4940 Regular Season        364
#> 7   2026     5294 Playout Final           4
# }