Skip to contents

Game header: status, teams, score, arena (one row).

Usage

khl_game_header(
  game_id,
  season = NULL,
  stage = "regular",
  headers = NULL,
  tournament_id = NULL,
  return_parsed = TRUE
)

Arguments

game_id

Required. khl.ru game id (the schedule's game_id; equals webcaster event khl_id).

season

Season by its END year (2026 = 2025-26), mapped to the KHL tournament id (tnId) through the webcaster season table (khl_webcaster_stages). The game's season; required unless tournament_id is given.

stage

Which stage of the season: regular or playoff. One of regular, playoff.

headers

Named list of extra request headers, merged over the defaults (X-Requested-With, Origin, Referer). The cookie jar and sessid are kept in-process, so nothing needs reusing across calls.

tournament_id

khl.ru tournament id (tnId), sent as is instead of season / stage (1369 = 2025-26 regular season, 1370 its playoff; the schedule's tournament_id column). The All-Star games have their own.

return_parsed

Logical. TRUE (default) returns the parsed fastRhockey_data tibble; FALSE returns the raw khl.ru envelope as a list (status, data, errors; betting fields removed).

Value

A fastRhockey_data tibble (47 columns; zero rows with the same columns when the payload is empty), or the raw body as a list when return_parsed = FALSE. Raises fastRhockey_no_data (nothing there, or an unknown season / stage), fastRhockey_asset_fetch (an error envelope, an answer for another id than the one asked, or a failed fetch) and fastRhockey_bad_request (an invalid argument or an HTTP 400 / 422).

col_nametypesdescription
game_idintegerkhl.ru game id; equals webcaster event khl_id / match_id
tournament_idintegerkhl.ru tournament (stage) id, tnId: 1369 = 2025-26 regular season, 1370 its playoff; equals webcaster stage khl_id
home_club_idintegerHome CLUB id (stable across seasons; joins webcaster team khl_id)
home_team_season_idintegerHome team-season id (one per tournament; joins nothing in the webcaster API)
away_club_idintegerVisitor CLUB id (stable across seasons; joins webcaster team khl_id)
away_team_season_idintegerVisitor team-season id (one per tournament; joins nothing in the webcaster API)
arena_idintegerkhl.ru arena id
home_scoreintegerHome goals (final, shootout winner counted)
away_scoreintegerVisitor goals (final, shootout winner counted)
roundintegerPlayoff round number
roundnamecharacterRound label in Russian ('Nedelya 29' = Week 29)
roundname_encharacterRound label in English
datecharacterGame date YYYY-MM-DD (Moscow time)
dayofweekintegerDay of week, 1 = Sunday (6 = Friday 2026-03-20)
timecharacterStart time hh:mm:ss (Moscow time); not a game clock
changesintegerCount of changes to the game record (0 in the captured bodies; unverified)
numberintegerGame number within the tournament
home_name_l3characterHome club 3-letter code in Russian
home_name_encharacterHome club name in English
home_name_l3_encharacterHome club 3-letter code in English
home_city_encharacterHome club city in English
visitor_name_l3characterVisiting club 3-letter code in Russian
visitor_name_encharacterVisiting club name in English
visitor_name_l3_encharacterVisiting club 3-letter code in English
visitor_city_encharacterVisiting club city in English
arenacharacterArena name in Russian
arena_encharacterArena name in English
arena_citycharacterArena city in Russian
arena_city_encharacterArena city in English
msktime_sftintegerOffset of local time from Moscow time, hours (unverified)
gmttime_sftintegerOffset of Moscow time from GMT, hours (unverified)
tempcharacterUndocumented provider field temp; carried as sent.
scorecharacterFinal score 'home:visitor'
otscharacterHow the game ended: empty = regulation, OT = overtime, SO = shootout
attendanceintegerAttendance (numeric string)
approvedinteger1 = result confirmed by the league
format_date_daycharacterGame date YYYY-MM-DD (Moscow time), as the site formats it
time_formatcharacterStart time hh:mm (Moscow time)
full_dateintegerStart time, unix seconds (UTC)
date_typecharacterFront-end date bucket of the game relative to today ('last' = already played; other values unverified)
typecharacterGame state/type code (sogame = finished in a shootout)
winnercharacterWinning side: A = home, B = visitor
visible_datecharacterShort display date in Russian ('20 mar' = 20 March)
visible_date_fullcharacterDisplay date in Russian without the year ('20 marta')
visible_date_full2characterDisplay date in Russian with the year ('20 marta 2026')
visible_date_daycharacterAbbreviated weekday in Russian ('pt' = Friday)
winintegerTrue when this club won

Details

Endpoint: POST https://www.khl.ru/rest/game/header/.

khl.ru REST needs a primed session (a GET of the site root sets the cookie jar and the Bitrix sessid, then each call POSTs a form); this is done for you, one session per host per R session, re-primed when the site rotates its cookie or the sessid expires. No route takes a year: season (the END year, 2026 = 2025/26) and stage are mapped to the tournament id (tnId) through the webcaster season table, or pass tournament_id (the All-Star games have their own tnId).

Ids and counts are integers (sdv-py Int64); a column holding values past 2^31 (epoch milliseconds) is returned as a whole-number double.

At least one second is left between two requests to a host.

Owner flag (sanctions). The KHL and its webcaster platform are run by Russian operators, some clubs by sanctioned state companies. Fetching on your own machine is fine; any published data release, hosted mirror or redistribution needs owner (sanctions / legal) sign-off first.

Examples

# \donttest{
  try(khl_game_header(game_id = 898236, season = 2026))
#> ── KHL Game Header from khl.ru ─────────────────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:54:38 UTC
#> # A tibble: 1 × 47
#>   game_id tournament_id home_club_id home_team_season_id away_club_id
#>     <int>         <int>        <int>               <int>        <int>
#> 1  898236          1369            7               14934           71
#> # ℹ 42 more variables: away_team_season_id <int>, arena_id <int>,
#> #   home_score <int>, away_score <int>, round <int>, roundname <chr>,
#> #   roundname_en <chr>, date <chr>, dayofweek <int>, time <chr>, changes <int>,
#> #   number <int>, home_name_l3 <chr>, home_name_en <chr>,
#> #   home_name_l3_en <chr>, home_city_en <chr>, visitor_name_l3 <chr>,
#> #   visitor_name_en <chr>, visitor_name_l3_en <chr>, visitor_city_en <chr>,
#> #   arena <chr>, arena_en <chr>, arena_city <chr>, arena_city_en <chr>, …
# }