One game's event timeline: goals with assists, penalties, goaltender changes, revoked goals.
Arguments
- game_id
SIHF game id, 14 digits
<season(4)><competition(4)><sequence(6)>(game_idinnl_schedule(); the same id as the SIHF family'sgame_id), e.g.20261105000325. A whole number or a digit string; 14 digits are exact as a double, so do not format them throughinteger.- return_parsed
Logical.
TRUE(the default) returns thefastRhockey_datatibble;FALSEreturns the raw JSON body as a nested list (api keys already dropped).
Value
A fastRhockey_data tibble (34 columns) with the columns below, or the raw JSON body when return_parsed = FALSE.
A valid but empty payload returns a zero-row tibble with these columns.
| col_name | type | description |
| game_id | numeric | SIHF game id <season(4)><competition(4)><sequence(6)> (whole number; e.g. 20261105000325, 1105 = National League). The same id as the sihf family's game_id; its first four digits are the season END year. |
| event_index | integer | 1-based position of the event in the game's timeline. |
| team_side | character | home or away: the side of the team this row belongs to. |
| game_seconds | integer | Elapsed game time of the event in seconds, from the MMSS time (822 = 8:22 -> 502). |
| team_id | numeric | SIHF team id (whole number; e.g. 101151 = HC Davos). The same key space as the sihf family's team_id. |
| home_team | logical | Event belongs to the home team |
| time | character | Game clock elapsed as an MMSS string without separator ('822' = 8:22, '5954' = 59:54) |
| video_time | integer | Seconds into the game video; 0 when there is no clip |
| video_vimeo_id | numeric | Clip of this event. Vimeo video id (whole number): vimeo.com/<id>. |
| action | character | Event type: goal, foul (penalty), in / out (goaltender enters / leaves), revokedGoal |
| foul_type | integer | SIHF penalty code (116-125 in the sample); 0 on non-penalty events |
| foul_minutes | integer | Penalty minutes; 0 on non-penalty events |
| player_first_name | character | Shooter's first name, from the game's lineup. |
| player_last_name | character | Shooter's last name, from the game's lineup. |
| player_number | character | Shooter's sweater number, from the game's lineup (a string). |
| player_total | integer | Scorer's goals this season including this one; 0 on non-goal events |
| period | integer | Period number, an integer (the parent third is a string) |
| overtime | integer | Overtime period number; 0 in regulation |
| goal_situation | character | Goal kind; 'normal' on every sampled event |
| home_team_result | integer | Home score after the event |
| away_team_result | integer | Away score after the event |
| assist1_first_name | character | First assist: first name |
| assist1_last_name | character | First assist: last name |
| assist1_number | character | First assist: sweater number, a string |
| assist1_total | integer | First assister's assists this season including this one |
| assist2_first_name | character | Second assist: first name |
| assist2_last_name | character | Second assist: last name |
| assist2_number | character | Second assist: sweater number, a string |
| assist2_total | integer | Second assister's assists this season including this one |
| situation | character | Goal tags, comma-separated: EQ (even strength), PP1 (power play), GWG (game-winning goal); null on non-goals |
| revoked_goal_type | integer | Revoked-goal category code (1 on every sampled event) |
| revoked_goal_sub_type | integer | Revoked-goal reason code (1 on the revoked goal, 0 elsewhere) |
| review_successful | character | Video-review outcome; unobserved: null or empty in every sampled row |
| review_goal_counts | logical | Goal stood after review |
Details
Polite use. www.nationalleague.ch/robots.txt disallows /api, so keep use light and incremental. Requests
are spaced at least one second apart (on every attempt, retries included). Check the site's terms of use before
any bulk download or redistribution. Crawl incrementally: fetch a finished game once (keyed by game_id), find new games with one nl_schedule() call
per run, and fetch season tables at most once per game day.
Seasons are END years and go on the wire unchanged. Ids (*_id) are whole-number numeric (a 14-digit
game_id exceeds R's 32-bit integer); every other whole-number column is integer. The club backend key the
API ships in /teams/{id}/info is dropped before parsing and never returned.
Endpoint: GET https://www.nationalleague.ch/api/games/{gameId}.
The six game-page wrappers (nl_game_overview(), nl_pbp(), nl_lineups(), nl_player_box(),
nl_team_stats(), nl_shots()) each read the same /games/{gameId} body, one request each.
Errors
Raises a classed condition (all inherit fastRhockey_error): fastRhockey_no_data for a 404 or an empty answer (no
games or rows for that season, team or phase), fastRhockey_asset_fetch for a failed fetch, an error object in a 200, a body
without the ids it must carry, or an answer for another season, team, game or player, and fastRhockey_bad_request
for a 400/422 or an argument that is not a whole number.
See also
Other National League Functions:
nl_current_games(),
nl_game_overview(),
nl_lineups(),
nl_player_box(),
nl_player_season(),
nl_player_stats(),
nl_playoffs(),
nl_playouts(),
nl_schedule(),
nl_shots(),
nl_standings(),
nl_team_info(),
nl_team_player_stats(),
nl_team_schedule(),
nl_team_stats(),
nl_top_scorers()
Examples
if (FALSE) { # interactive()
# \donttest{
try(nl_pbp(game_id = 20261105000325))
# }
}
