Skip to contents

Play-by-play commentary of one Tipsport Extraliga game from hokej.cz's S3 bucket (match/{season - 1}/full/{match_id}.json), every entry, oldest first: goals and penalties with team and players.

Ids are onlajny ids (the commentary system), not the hokej.cz ids of elh_shots(): join the two through elh_scoreboard(), which maps games and teams between the id spaces (only for days still in its rolling window). clock is the elapsed game clock mm:ss; a clockless entry names only its phase (0 pre-game, 1INT/2INT intermissions, 3PER, ERT after the game; meanings inferred, the provider documents none). period is derived from the clock (20-minute periods). strength (EQ = even strength, inferred, the only value observed) is set only on goals that carry the on-ice block (not in 2016-17).

Usage

elh_pbp(season, match_id, return_parsed = TRUE)

Arguments

season

Season by its END year (2027 = 2026-27); the bucket files it under the START year (match/2026/), mapped here. Play-by-play starts in 2014-15 (season 2015).

match_id

hokej.cz game id (the S3 file name; hokejcz_game_id of elh_game_ids() / elh_scoreboard()), e.g. 2928321. Not the onlajny game id.

return_parsed

Parse the payload into a tibble (default TRUE). Pass FALSE for the raw JSON as a list (XML-converted: every attribute a string).

Value

A tibble (return_parsed = TRUE; zero rows for a malformed body), else the raw JSON list:

col_nametypedescription
comment_idintegerOnlajny commentary entry id (integer); equals the mobile file's comment id.
sort_ordernumericProvider sort key (integer-valued double: values exceed the 32-bit integer range); ascending = chronological, the order rows are returned in.
event_typecharacterEntry kind: goal, penalty, time (period start/end), important, normal, expertComment.
label2characterSecondary label; empty (null) in every sample.
time_typecharacterFor time entries: begin or end of a period; null otherwise.
phasecharacterPhase of a clockless entry: 0 pre-game, 1INT / 2INT intermissions, 3PER third period, ERT after the game (meanings inferred from the entries, undocumented); null when the entry has a clock.
clockcharacterElapsed game clock mm:ss (00:01 = game start); null on a clockless entry.
game_secondsintegerSeconds from the start of the game.
periodintegerPeriod number derived from the game clock (20-minute periods; 4 = overtime); null on a clockless entry.
home_scoreintegerHome goals (after the entry on play-by-play rows; final on the scoreboard).
away_scoreintegerAway goals (after the entry on play-by-play rows; final on the scoreboard).
home_shootout_scoreintegerHome shootout goals after the entry (0 without a shootout).
away_shootout_scoreintegerAway shootout goals after the entry (0 without a shootout).
event_idintegerOnlajny event id of a goal or penalty (integer); null on other entries.
onlajny_team_idintegerOnlajny team id of the team credited with the goal or penalty (Sparta = 156); NOT the hokej.cz team id. The scoreboard maps it.
onlajny_team_global_idintegerOnlajny global team id (equal to onlajny_team_id in every sample).
team_codecharacterTeam code of the credited team, e.g. SPA (same as the shots / scoreboard codes).
onlajny_player1_idintegerOnlajny player id of slot 1 (goal scorer / penalised player); NOT the hokej.cz id of the shots; null for an unused slot.
onlajny_player1_global_idintegerOnlajny GLOBAL player id of slot 1 (goal scorer / penalised player); can differ from onlajny_player1_id (Hradec 48287 / 76559).
player1_namecharacterDisplay name of slot 1 (goal scorer / penalised player).
player1_first_namecharacterGiven name of slot 1 (goal scorer / penalised player); null in 2016-17.
player1_last_namecharacterFamily name of slot 1 (goal scorer / penalised player); null in 2016-17.
onlajny_player2_idintegerOnlajny player id of slot 2 (first assist); NOT the hokej.cz id of the shots; null for an unused slot.
onlajny_player2_global_idintegerOnlajny GLOBAL player id of slot 2 (first assist); can differ from onlajny_player2_id (Hradec 48287 / 76559).
player2_namecharacterDisplay name of slot 2 (first assist).
player2_first_namecharacterGiven name of slot 2 (first assist); null in 2016-17.
player2_last_namecharacterFamily name of slot 2 (first assist); null in 2016-17.
onlajny_player3_idintegerOnlajny player id of slot 3 (second assist); NOT the hokej.cz id of the shots; null for an unused slot.
onlajny_player3_global_idintegerOnlajny GLOBAL player id of slot 3 (second assist); can differ from onlajny_player3_id (Hradec 48287 / 76559).
player3_namecharacterDisplay name of slot 3 (second assist).
player3_first_namecharacterGiven name of slot 3 (second assist); null in 2016-17.
player3_last_namecharacterFamily name of slot 3 (second assist); null in 2016-17.
no_assistintegerUnassisted flag on slot 1 (0 in every sample; 1 = unassisted is inferred, unobserved). Absent before 2026-27 samples.
penalty_minutesintegerPenalty minutes of the penalised player (player1); two penalties are summed. Null in 2016-17.
penalty_offensecharacterCzech offense code(s), e.g. VYSH (high sticking), PODR (tripping); comma-joined for two penalties. Null in 2016-17.
strengthcharacterStrength of a goal: EQ (read as even strength; inferred, the only value observed). Null where the on-ice block is absent (all of 2016-17).
messagecharacterCzech commentary text (may contain
).
writtencharacterWhen the entry was written, local time YYYY-MM-DD HH:MM:SS.
last_changecharacterLast edit of the entry, local time YYYY-MM-DD HH:MM:SS.

Errors

fastRhockey_no_data: a missing file (404 NoSuchKey) or a stub body without comments. fastRhockey_asset_fetch: an error envelope, an empty or non-JSON 200, or any other non-2xx. fastRhockey_bad_request: HTTP 400/422 or a bad season / match_id.

Examples

# \donttest{
  try(elh_pbp(season = 2027, match_id = 2928321))
#> ── ELH Pbp Information from hokej.cz ───────────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:51:59 UTC
#> # A tibble: 119 × 39
#>    comment_id  sort_order event_type label2 time_type phase clock game_seconds
#>         <int>       <dbl> <chr>      <chr>  <chr>     <chr> <chr>        <int>
#>  1   69014008 69014008000 normal     NA     NA        0     NA              NA
#>  2   70313395 70294613000 normal     NA     NA        0     NA              NA
#>  3   70313401 70294614000 normal     NA     NA        0     NA              NA
#>  4   70313403 70313395000 normal     NA     NA        0     NA              NA
#>  5   70313544 70313401000 normal     NA     NA        0     NA              NA
#>  6   70326165 70326165000 normal     NA     NA        0     NA              NA
#>  7   70328126 70328126000 time       NA     begin     NA    00:01            1
#>  8   70328146 70328146000 normal     NA     NA        NA    00:08            8
#>  9   70328174 70328174000 normal     NA     NA        NA    00:30           30
#> 10   70328231 70328231000 normal     NA     NA        NA    01:43          103
#> # ℹ 109 more rows
#> # ℹ 31 more variables: period <int>, home_score <int>, away_score <int>,
#> #   home_shootout_score <int>, away_shootout_score <int>, event_id <int>,
#> #   onlajny_team_id <int>, onlajny_team_global_id <int>, team_code <chr>,
#> #   onlajny_player1_id <int>, onlajny_player1_global_id <int>,
#> #   player1_name <chr>, player1_first_name <chr>, player1_last_name <chr>,
#> #   onlajny_player2_id <int>, onlajny_player2_global_id <int>, …
# }