Skip to contents

Player career: one row per season tournament.

Usage

khl_player_career(player_id, headers = NULL, return_parsed = TRUE)

Arguments

player_id

Required. khl.ru player id (the box score / roster player_id).

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.

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 (40 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
player_idintegerkhl.ru player id; equals webcaster player khl_id
season_labelcharacterSeason label as sent (26/27, 2025/2026)
tournament_idintegerkhl.ru tournament (stage) id, tnId: 1369 = 2025-26 regular season, 1370 its playoff; equals webcaster stage khl_id
team_season_idintegerTeam-season id (tid; one per tournament; joins nothing in the webcaster API)
club_idintegerkhl.ru CLUB id (stable across seasons; joins webcaster team khl_id)
team_namecharacterTeam name as the site prints it
jnintegerJersey number (not an id; 0 on a team event)
gpintegerGames played by the player
gintegerGoals scored by the player
aintegerAssists credited to the player
ptsintegerPoints (goals plus assists)
pmintegerPlus-minus rating of the player
plusintegerPlus (on ice for a goal for)
minusintegerMinus (on ice for a goal against)
pimintegerPenalty minutes
eqgintegerEven-strength goals
ppgintegerPower-play goals
shgintegerShort-handed goals
otgintegerOvertime goals scored by the player
gwgintegerGame-winning goals
sdsintegerShootout-deciding goals
sogintegerShots on goal by the player
sog_pctnumericShooting percentage
sog_avgnumericShots on goal per game
fointegerFaceoffs taken by the player
fowintegerFaceoffs won by the player
fo_pctnumericFaceoff win percentage
toi_avgcharacterAverage time on ice per game (mm:ss)
sft_avgnumericAverage shifts per game
tie_avgcharacterAverage even-strength time on ice per game
sfte_avgnumericAverage even-strength shifts per game
tipp_avgcharacterAverage power-play time on ice per game
sftpp_avgnumericAverage power-play shifts per game
tish_avgcharacterAverage short-handed time on ice per game
sftsh_avgnumericAverage short-handed shifts per game
hitsintegerHits (body checks)
blsintegerShots blocked by the player
foaintegerFaceoffs lost by the player
tkaintegerTakeaways by the player
p_intcintegerPass interceptions

Details

Endpoint: POST https://www.khl.ru/rest/players/stats/.

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_player_career(player_id = 41928))
#> ── KHL Player Career from khl.ru ───────────────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:54:46 UTC
#> # A tibble: 6 × 40
#>   player_id season_label tournament_id team_season_id club_id team_name    jn
#>       <int> <chr>                <int>          <int>   <int> <chr>     <int>
#> 1     41928 26/27                 1436          15558       7 Спартак       4
#> 2     41928 25/26                 1369          14934       7 Спартак       4
#> 3     41928 25/26                 1370          15461       7 Спартак       4
#> 4     41928 23/24                 1217          13612       7 Спартак       4
#> 5     41928 23/24                 1218          14130       7 Спартак       4
#> 6     41928 22/23                 1154          13026       7 Спартак       4
#> # ℹ 33 more variables: gp <int>, g <int>, a <int>, pts <int>, pm <int>,
#> #   plus <int>, minus <int>, pim <int>, eqg <int>, ppg <int>, shg <int>,
#> #   otg <int>, gwg <int>, sds <int>, sog <int>, sog_pct <dbl>, sog_avg <dbl>,
#> #   fo <int>, fow <int>, fo_pct <dbl>, toi_avg <chr>, sft_avg <dbl>,
#> #   tie_avg <chr>, sfte_avg <dbl>, tipp_avg <chr>, sftpp_avg <dbl>,
#> #   tish_avg <chr>, sftsh_avg <dbl>, hits <int>, bls <int>, foa <int>,
#> #   tka <int>, p_intc <int>
# }