Skip to contents

Wraps GET https://www.shl.se/api/gameday/play-by-play/{game_uuid} of the SHL site API (www.shl.se). Unofficial use of a public source; seasons are END years (2026 = 2025/26) and are mapped to the site's ssgt uuids through /statistics-v2/layout-info.

Usage

shl_pbp(game_uuid, return_parsed = TRUE)

Arguments

game_uuid

Game uuid (gameInfo[].uuid from /sports-v2/game-schedule). gameday/* has data from 2023/24 on; older games answer 200 with an empty body.

return_parsed

Parse the payload into a tibble (default TRUE); FALSE returns the raw decoded JSON as a list.

Value

A fastRhockey_data tibble (the raw JSON list when return_parsed = FALSE) with the following columns:

col_nametypedescription
game_source_idcharacterStatNet game key, date-HOME-AWAY (e.g. 20250913-FHC-LHC); the same game as gameId.
game_idintegerStatNet game number (StatNet key space, e.g. 22003); keys stats-info games and equals sports-v2 game-info extId. Not the game uuid.
event_idintegerStatNet event sequence number; unique within one game only (pair it with gameId or gameUuid).
event_uuidcharacterEvent uuid (platform key space), unique across games. eventId is the StatNet per-game sequence number.
roundintegerSchedule round of the game (1 = first game day).
game_typecharacterStatNet league label: Elitserien (SHL's name until 2013).
arenacharacterName of the arena hosting the game.
attendanceintegerSpectators at the game.
start_date_and_timecharacterScheduled start (local).
periodintegerPeriod (1-3, 4 = overtime, 5 = shootout).
timecharacterGame clock in the period (MM:SS, counting up from 00:00). Clock/duration as an mm:ss string.
game_statecharacterGame state (e.g. GameEnded).
revisionintegerEvent revision counter.
typecharacterEvent type: goal, shot, penalty, goalkeeper (goalie in / out), period (start / end), timeout.
real_world_timecharacterWall-clock time of the event (local).
updated_timecharacterLast update time of the event.
home_team_idcharacterTeam code (e.g. FHC) in gameday and standings payloads; not the team uuid.
home_team_namecharacterTeam display name (e.g. Frölunda HC).
home_team_codecharacterTeam code (FHC, LHC, ...).
home_scoreintegerGoals scored by the team in the game.
away_team_idcharacterTeam code (e.g. FHC) in gameday and standings payloads; not the team uuid.
away_team_namecharacterTeam display name (e.g. Frölunda HC).
away_team_codecharacterTeam code (FHC, LHC, ...).
away_scoreintegerGoals scored by the team in the game.
event_team_idcharacterTeam code (e.g. FHC) in gameday and standings payloads; not the team uuid.
event_placecharacterSide of the game: home or away.
event_team_codecharacterTeam code (FHC, LHC, ...).
event_team_namecharacterTeam display name (e.g. Frölunda HC).
player_idintegerisa (StatNet) player id, integer. Play-by-play sends it as a string, every other route as an integer; it is cast here so the frames join.
player_first_namecharacterGiven (first) name of the player.
player_family_namecharacterSurname (family name) of the player.
player_jersey_todaycharacterJersey number in this game. Numeric value sent as a string.
is_enteringlogicalGoalie event, true when the goalie enters the ice and false when leaving.
game_uuidcharacterPlatform game uuid (bdhvuc5tex); every gameday route takes it.
location_xintegerShot x coordinate. Units, origin and orientation unverified; range -29..481 over the 118 located events of game bdhvuc5tex (discovery download, 2026-10-12).
location_yintegerShot y coordinate. Units, origin and orientation unverified; range -140..129 over the 118 located events of game bdhvuc5tex (discovery download, 2026-10-12).
goal_sectionintegerGoal-mouth section of the shot/goal (-3 lines up with blocked shots; unverified).
is_penalty_shotlogicalWhether the shot/goal was a penalty shot.
variant_short_namecharacterPenalty type (Minor, Major, ...).
variant_minor_timecharacterMinor-penalty minutes. Numeric value sent as a string.
variant_double_minor_timecharacterDouble-minor minutes in the penalty. Numeric value sent as a string.
variant_bench_timecharacterBench minor minutes in the penalty. Numeric value sent as a string.
variant_major_timecharacterMajor-penalty minutes. Numeric value sent as a string.
variant_misconduct_timecharacterMisconduct minutes. Numeric value sent as a string.
variant_g_m_timecharacterGame-misconduct minutes in the penalty. Numeric value sent as a string.
variant_m_p_timecharacterMatch-penalty minutes. Numeric value sent as a string.
variant_descriptioncharacterText description (penalty, media).
offencecharacterPenalty offence code (e.g. CROSS, HOOK, TRIP).
did_render_in_penalty_shotlogicalWhether the penalty led to a penalty shot.
home_goalsintegerHome goals after this event (running score).
away_goalsintegerAway goals after this event (running score).
is_empty_net_goallogicalWhether the goal went into an empty net.
pop_player_idslistisa ids of the scoring side's players on the ice for the goal (list of integers).
nep_player_idslistisa ids of the conceding side's players on the ice for the goal (list of integers).
assist1_player_idintegerisa id of the first assist.
assist1_first_namecharacterFirst assist: given name.
assist1_family_namecharacterFirst assist: surname.
assist1_jersey_todaycharacterFirst assist: jersey number in this game (string).
assist2_player_idintegerisa id of the second assist.
assist2_first_namecharacterSecond assist: given name.
assist2_family_namecharacterSecond assist: surname.
assist2_jersey_todaycharacterSecond assist: jersey number in this game (string).
goal_statuscharacterGoal strength (e.g. EQ, PP1, SH1).
startedlogicalWhether the period has started.
started_atcharacterPeriod start time (ISO 8601 UTC).
finishedlogicalWhether the period is finished.
finished_atcharacterPeriod end time (ISO 8601 UTC).

Errors

fastRhockey_no_data: the host answered 404, an empty body (gameday routes before 2023/24), a table with no rows, or the season and game type are not in layout-info. fastRhockey_asset_fetch: any other non-2xx answer or a dead connection after retries, a non-JSON or error-envelope 200, a stats-info page that reaches count or falls short of its totalCount, or a body for another game, team, athlete or ssgt than the one asked for. fastRhockey_bad_request: a 400 / 422, a season that is not a year, or an argument outside its choices.

Examples

# \donttest{
  shl_pbp(game_uuid = "bdhvuc5tex")
#> ── SHL Pbp Information from www.shl.se ─────────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:59:19 UTC
#> # A tibble: 131 × 67
#>    game_source_id   game_id event_id event_uuid round game_type arena attendance
#>    <chr>              <int>    <int> <chr>      <int> <chr>     <chr>      <int>
#>  1 20250913-FHC-LHC   22003      133 4209fd58-…     1 Elitseri… Scan…      12044
#>  2 20250913-FHC-LHC   22003      132 067896e4-…     1 Elitseri… Scan…      12044
#>  3 20250913-FHC-LHC   22003      131 2281833f-…     1 Elitseri… Scan…      12044
#>  4 20250913-FHC-LHC   22003      130 8d9c78ae-…     1 Elitseri… Scan…      12044
#>  5 20250913-FHC-LHC   22003      129 1d9e0e35-…     1 Elitseri… Scan…      12044
#>  6 20250913-FHC-LHC   22003      128 aa5f72c3-…     1 Elitseri… Scan…      12044
#>  7 20250913-FHC-LHC   22003      127 7a2afb7d-…     1 Elitseri… Scan…      12044
#>  8 20250913-FHC-LHC   22003      126 881dcda8-…     1 Elitseri… Scan…      12044
#>  9 20250913-FHC-LHC   22003      125 84cf31d2-…     1 Elitseri… Scan…      12044
#> 10 20250913-FHC-LHC   22003      124 f1d7d1a9-…     1 Elitseri… Scan…      12044
#> # ℹ 121 more rows
#> # ℹ 59 more variables: start_date_and_time <chr>, period <int>, time <chr>,
#> #   game_state <chr>, revision <int>, type <chr>, real_world_time <chr>,
#> #   updated_time <chr>, home_team_id <chr>, home_team_name <chr>,
#> #   home_team_code <chr>, home_score <int>, away_team_id <chr>,
#> #   away_team_name <chr>, away_team_code <chr>, away_score <int>,
#> #   event_team_id <chr>, event_place <chr>, event_team_code <chr>, …
# }