Player leaderboard of a competition for one stat category (total, per-game average and single-game best).
Endpoint: GET https://api.kzs.si/api/v1/public/competitions/{competition_id}/playerStats
Usage
kzs_player_leaderboard(
competition_id,
stats_category = "PTS",
order_type = "AVERAGE",
sort_by = "avg",
sort = "DESC"
)Arguments
- competition_id
(required) Competition id (competition_id in kzs_competitions): one per competition per season, e.g. 579 (men's first league 2025/26).
- stats_category
Stat category (the site's statsCategory): PTS points, M_2/A_2/PERC_2 two-pointers, M_3/A_3/PERC_3 three-pointers, M_FG/A_FG/PERC_FG field goals, M_FT/A_FT/PERC_FT free throws, R rebounds (R_D defensive, R_O offensive), ASS assists, ST steals, TOV turnovers, PF_CM/PF_RV fouls committed/received, ASS_TOV and ST_TOV ratios. Competitions without live stats offer only PTS, M_2, M_3, M_FT, A_FT, PERC_FT. One of "PTS", "M_2", "A_2", "PERC_2", "M_3", "A_3", "PERC_3", "M_FG", "A_FG", "PERC_FG", "M_FT", "A_FT", "PERC_FT", "R", "R_D", "R_O", "ASS", "ST", "TOV", "PF_CM", "PF_RV", "ASS_TOV", "ST_TOV".
- order_type
Figure the leaderboard is built on: AVERAGE (per game), SUM (season total) or BEST_PERFORMANCE. One of "AVERAGE", "SUM", "BEST_PERFORMANCE".
- sort_by
Row column the board is ordered by: avg (average), sum or max. The runtime checks the order. One of "avg", "sum", "max".
- sort
Sort direction. One of "ASC", "DESC".
Value
A hoopR_data tibble: Player leaderboard of a competition for one stat category (total, per-game average and
single-game best). An empty valid answer raises hoopR_no_data; the columns are always these, in this order
(sportsdataverse-py kzs_player_leaderboard):
| col_name | type | description |
| competition_id | integer | Competition id: one per competition per season (men's first league 2025/26 = 579, 2026/27 = 608). |
| stats_category | character | Stat category of the board (PTS points, R rebounds, ASS assists ...): the request's, the rows do not echo it. |
| club_id | integer | Club id: the club across seasons and categories (Ilirija = 16). No captured route is keyed by it. |
| club_fullname | character | Club's full legal name. |
| club_logo_uuid | character | Club logo: image file id, served at https://api.kzs.si/public/images/{uuid}. |
| club_code | character | Club 3-letter code. |
| team_id | integer | Team id: one club team in one season (Ilirija 2025-26 = 17551). Joins to /teams/{teamId}, standings teamId, box-score teamId and the teamId query params. |
| team_name | character | Team name for the season, sponsor included. |
| games_played | integer | Games the player played in the competition. |
| sum | double | Season total of the requested statsCategory. |
| average | double | Per-game average of the statsCategory. |
| max | double | Single-game best of the statsCategory. |
| player_id | integer | Player id (KZS player registry). Joins to /players/{playerId}, box-score and play-by-play playerId. |
| player_firstname | character | The player's given name as registered with KZS (lower-case n in this route). |
| player_lastname | character | The player's family name as registered with KZS (lower-case n in this route). |
| photo_uuid | character | Player photo: image file id, served at https://api.kzs.si/public/images/{uuid}. |
Details
Source, terms of use, request pacing, seasons, ids, coverage and error classes of this family: see the notes in kzs_seasons().
kzs_player_leaderboard(competition_id = 579)See also
Other KZS Functions:
kzs_box_score(),
kzs_competition(),
kzs_competitions(),
kzs_match(),
kzs_matches(),
kzs_pbp(),
kzs_pbp_players(),
kzs_period_scores(),
kzs_phases(),
kzs_player(),
kzs_player_stats(),
kzs_playing_days(),
kzs_roster(),
kzs_rounds(),
kzs_score_changes(),
kzs_seasons(),
kzs_standings(),
kzs_team(),
kzs_team_box_score(),
kzs_team_general(),
kzs_team_leaderboard(),
kzs_teams()
