Skip to contents

Team 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}/teamStats

Usage

kzs_team_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: Team 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_team_leaderboard):

col_nametypedescription
competition_idintegerCompetition id: one per competition per season (men's first league 2025/26 = 579, 2026/27 = 608).
stats_categorycharacterStat category of the board (PTS points, R rebounds, ASS assists ...): the request's, the rows do not echo it.
club_idintegerClub id: the club across seasons and categories (Ilirija = 16). No captured route is keyed by it.
club_fullnamecharacterClub's full legal name.
club_logo_uuidcharacterClub logo: image file id, served at https://api.kzs.si/public/images/{uuid}.
club_codecharacterClub 3-letter code.
team_idintegerTeam 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_namecharacterTeam name for the season, sponsor included.
games_playedintegerGames the team played in the competition.
sumdoubleSeason total of the requested statsCategory.
averagedoublePer-game average of the statsCategory.
maxdoubleSingle-game best of the statsCategory.

Details

Source, terms of use, request pacing, seasons, ids, coverage and error classes of this family: see the notes in kzs_seasons().

 kzs_team_leaderboard(competition_id = 579)