Skip to contents

Stats filter options: seasons, tournaments, position groups and clubs (one row per option).

Usage

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

Arguments

season

Season by its END year (2026 = 2025-26), mapped to the KHL tournament id (tnId) through the webcaster season table (khl_webcaster_stages). NULL = the site's current season.

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 (6 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
filtercharacterFilter code: season, tournament, amplua_full or clubs_full
filter_namecharacterFilter label as the site prints it
valuecharacterOption code to send for the filter (a tournament id, a season code such as s19, a club slug)
namecharacterOption label (Russian)
defintegerDefault tournament id (tnId) of a season option
activeinteger1 when the option is selectable

Details

Endpoint: POST https://www.khl.ru/rest/filters/statplayers/.

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_stat_filters(season = 2026))
#> ── KHL Stat Filters from khl.ru ────────────────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:55:02 UTC
#> # A tibble: 51 × 6
#>    filter filter_name value name         def active
#>    <chr>  <chr>       <chr> <chr>      <int>  <int>
#>  1 season Сезон       all   Все сезоны    NA     NA
#>  2 season Сезон       s19   2026-2027   1436     NA
#>  3 season Сезон       s18   2025-2026   1370      1
#>  4 season Сезон       s17   2024-2025   1289     NA
#>  5 season Сезон       s16   2023-2024   1218     NA
#>  6 season Сезон       s15   2022-2023   1155     NA
#>  7 season Сезон       s13   2021-2022   1098     NA
#>  8 season Сезон       s12   2020-2021   1046     NA
#>  9 season Сезон       s11   2019-2020    854     NA
#> 10 season Сезон       s10   2018-2019    674     NA
#> # ℹ 41 more rows
# }