Skip to main content
Version: 0.2.0

KZS — KZS FMS public API (Basketball Federation of Slovenia) — Team

kzs_team_leaderboard​

Team leaderboard of a competition for one stat category (total, per-game average and single-game best).

Endpoint URL: GET https://api.kzs.si/api/v1/public/competitions/{competition_id}/teamStats

Valid URL: https://api.kzs.si/api/v1/public/competitions/579/teamStats?limit=1000&statsCategory=PTS&orderType=AVERAGE&sortBy=avg&sort=DESC

API ParameterPythonPatternRequiredNullableDescription
competition_idcompetition_idYCompetition id (competition_id in kzs_competitions): one per competition per season, e.g. 579 (men's first league 2025/26).
statsCategorystats_categoryYStat 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.
orderTypeorder_typeYFigure the leaderboard is built on: AVERAGE (per game), SUM (season total) or BEST_PERFORMANCE.
sortBysort_byYRow column the board is ordered by: avg (average), sum or max. The runtime checks the order.
sortsortYSort direction.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
competition_idInt64Competition id: one per competition per season (men's first league 2025/26 = 579, 2026/27 = 608).
stats_categoryStringStat category of the board (PTS points, R rebounds, ASS assists ...): the request's, the rows do not echo it.
club_idInt64Club id: the club across seasons and categories (Ilirija = 16). No captured route is keyed by it.
club_fullnameStringClub's full legal name.
club_logo_uuidStringClub logo: image file id, served at https://api.kzs.si/public/images/{uuid}.
club_codeStringClub 3-letter code.
team_idInt64Team 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_nameStringTeam name for the season, sponsor included.
games_playedInt64Games the team played in the competition.
sumFloat64Season total of the requested statsCategory.
averageFloat64Per-game average of the statsCategory.
maxFloat64Single-game best of the statsCategory.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API has nothing for the request (an empty list, a competition without standings, a final game with no play-by-play or box score).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API answered HTTP 400 (its only error status: an unknown id or a bad parameter).
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. The fetch failed or the answer is unknown or partial: a full list page, a game that is not final, an envelope whose status is not OK, or a body for another competition, match, team, player or season than the one asked for.

Example​

kzs_team_leaderboard(competition_id=579)

kzs_team_box_score​

Team totals of a final game's box score, one row per side.

Endpoint URL: GET https://api.kzs.si/api/v1/public/matches/{match_id}/stats

Valid URL: https://api.kzs.si/api/v1/public/matches/101839/stats

API ParameterPythonPatternRequiredNullableDescription
match_idmatch_idYMatch id (match_id in kzs_matches), e.g. 101839. Global across seasons.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
match_idInt64Match id: the federation key of a game, global across seasons (joins kzs_matches and kzs_match).
team_sideStringWhich side of the match the row belongs to: home (the organiser, firstTeam on the wire) or away.
team_idInt64Team id: one club team in one season (joins kzs_teams); not the match-team id and not the club id.
team_nameStringName of the team for the season, sponsor included.
minutesFloat64Team minutes: the sum of its players (200.0 = 5 x 40; 0.0 on 2015-16 team lines).
two_pmInt64The team's two-point field goals made.
two_paInt64The team's two-point field goals attempted.
two_p_percFloat64The team's two-point percentage, 0-100.
three_pmInt64The team's three-point field goals made.
three_paInt64The team's three-point field goals attempted.
three_p_percFloat64The team's three-point percentage, 0-100.
f_tmInt64The team's free throws made.
f_taInt64The team's free throws attempted.
f_t_percFloat64The team's free-throw percentage, 0-100.
fg_mInt64The team's field goals made.
fg_aInt64The team's field goals attempted.
fg_percFloat64The team's field-goal percentage, 0-100.
offensive_reboundsInt64The team's offensive rebounds.
defensive_reboundsInt64The team's defensive rebounds.
total_reboundsInt64The team's total rebounds.
assistsInt64The team's assists.
stealsInt64The team's steals.
turnoversInt64The team's turnovers.
blocks_in_favorInt64The team's shots blocked (blocks made).
blocks_againstInt64The team's own shots that were blocked.
foul_commitedInt64The team's fouls committed.
foul_receivedInt64The team's fouls drawn.
p_irInt64The team's PIR, performance index rating ((points + rebounds + assists + steals + blocks + fouls drawn) - (missed field goals + missed free throws + turnovers + shots blocked + fouls committed)).
plus_minusInt64The team's plus-minus: points scored minus allowed while on court (team line: the final margin).
assists_turnover_ratioFloat64The team's assist-to-turnover ratio (0 in every sample: not computed).
defensive_ratingFloat64The team's defensive rating (0 in every sample: not computed).
efficiencyInt64Team efficiency (PIR); -1 on 2015-16 team lines (not computed).
pointsInt64The team's points.
efficiency_customFloat64The team's custom efficiency as the federation computes it (equal to efficiency on player rows; 0 on team lines).
efficiency_game_scoreFloat64The team's game score (0 in every sample: not computed).
fast_break_points_attemptedInt64The team's fast-break attempts (0 in every sample: not computed).
fast_break_points_madeInt64The team's fast-break makes (0 in every sample: not computed).
usage_percentageFloat64The team's usage percentage (0 in every sample: not computed).
m_vp_votesInt64The team's MVP votes (0 in every sample).
minusInt64The team's points allowed on court (0 in every sample: not computed).
offensive_ratingFloat64The team's offensive rating (0 in every sample: not computed).
p_erFloat64The team's PER (0 in every sample: not computed).
plusInt64The team's points scored on court (0 in every sample: not computed).
points_fast_breakInt64The team's fast-break points.
points_in_the_paintInt64The team's points in the paint.
points_in_the_paint_attemptedInt64The team's paint attempts (0 in every sample: not computed).
points_in_the_paint_madeInt64The team's paint makes (0 in every sample: not computed).
points_second_chanceInt64The team's second-chance points.
second_chance_points_attemptedInt64The team's second-chance attempts (0 in every sample: not computed).
second_chance_points_madeInt64The team's second-chance makes (0 in every sample: not computed).
true_shooting_attemptsInt64The team's true-shooting attempts (0 in every sample: not computed).
true_shooting_percentageFloat64The team's true-shooting percentage (0 in every sample: not computed).
bench_pointsInt64Points by players who did not start.
biggest_leadInt64Biggest lead, points.
biggest_scoring_runInt64Biggest unanswered scoring run, points.
fouls_bench_technicalInt64Technical fouls charged to the bench (not the coach).
fouls_coach_disqualifyingInt64Disqualifying fouls charged to the head coach.
fouls_coach_technicalInt64Technical fouls charged to the head coach.
fouls_disqualifyingInt64Disqualifying fouls by players (ejections).
fouls_offensiveInt64Offensive (charging) fouls by players.
fouls_onInt64Fouls drawn by the team.
fouls_personalInt64Personal fouls by players, all kinds that count toward fouling out.
fouls_teamInt64Team fouls (0 in every sample).
fouls_technicalInt64Technical fouls by players.
fouls_technical_otherInt64Other technical fouls (0 in every sample).
fouls_throw_inInt64Throw-in fouls (0 in every sample).
fouls_totalInt64All fouls committed.
fouls_unsportsmanlikeInt64Unsportsmanlike (flagrant) fouls by players.
fouled_outInt64Players fouled out (0 in every sample).
lead_changesInt64Lead changes in the game.
points_from_turnoversInt64Points off opponent turnovers.
time_leadingFloat64Time the team led, decimal minutes.
times_scores_levelInt64Times the score was tied.
rebounds_teamInt64Team rebounds (not credited to a player).
rebounds_team_defensiveInt64Defensive rebounds credited to the team, not a player.
rebounds_team_offensiveInt64Offensive rebounds credited to the team, not a player.
turnovers_teamInt64Team turnovers (not credited to a player).

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API has nothing for the request (an empty list, a competition without standings, a final game with no play-by-play or box score).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API answered HTTP 400 (its only error status: an unknown id or a bad parameter).
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. The fetch failed or the answer is unknown or partial: a full list page, a game that is not final, an envelope whose status is not OK, or a body for another competition, match, team, player or season than the one asked for.

Example​

kzs_team_box_score(match_id=101839)

kzs_teams​

Teams entered in a competition.

Endpoint URL: GET https://api.kzs.si/api/v1/public/teams/

Valid URL: https://api.kzs.si/api/v1/public/teams/?limit=1000&competitionId=579

API ParameterPythonPatternRequiredNullableDescription
competitionIdcompetition_idYCompetition id (competition_id in kzs_competitions): one per competition per season, e.g. 579 (men's first league 2025/26).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
competition_idInt64Competition id: one per competition per season (men's first league 2025/26 = 579, 2026/27 = 608).
team_idInt64Team-application id: the team's registration (entry) for the season; play-by-play teamApplicationId is the same key space.
team_application_idInt64Team-application id: the team's registration (entry) for the season; play-by-play teamApplicationId is the same key space.
club_idInt64Club id: the club across seasons and categories (Ilirija = 16). No captured route is keyed by it.
club_memberBooleanTrue when the club is a KZS member (false on nested copies that omit it).
team_internal_rankingStringThe club's internal team letter for the category (A = first team, B = second team).
categoryStringAge category: ABSOLUTE (senior) or U8-U23 / ANY (code table in kzs-returns.md).
rankStringTier: FIRST-FOURTH or TOURNAMENT (code table).
genderStringMALE or FEMALE.
sport_hall_idInt64Sport hall (venue) id. /sportHalls/{id} is in the site bundle, not captured.
sport_hall_nameStringName of the venue (sports hall) where the game is played or the team is based.
nameStringTeam name for the season (sponsor name included).
codeStringTeam 3-letter code.
home_jersey_colorStringHome jersey colour, hex '#RRGGBB'.
guest_jersey_colorStringAway jersey colour, hex.
logo_uuidStringTeam logo: image file id, served at https://api.kzs.si/public/images/{uuid}.
home_team_colorStringHome colour, hex.
guest_team_colorStringAway colour, hex.
short_nameStringTeam short name ('' when none).

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API has nothing for the request (an empty list, a competition without standings, a final game with no play-by-play or box score).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API answered HTTP 400 (its only error status: an unknown id or a bad parameter).
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. The fetch failed or the answer is unknown or partial: a full list page, a game that is not final, an envelope whose status is not OK, or a body for another competition, match, team, player or season than the one asked for.

Example​

kzs_teams(competition_id=579)

kzs_team​

Team profile: club, home hall, colours and the competitions the team entered.

Endpoint URL: GET https://api.kzs.si/api/v1/public/teams/{team_id}

Valid URL: https://api.kzs.si/api/v1/public/teams/17551

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYTeam id (team_id in kzs_teams): one club team in one season, e.g. 17551. Not the match-team id nor the club id.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
team_idInt64Team-application id: the team's registration (entry) for the season; play-by-play teamApplicationId is the same key space.
team_application_idInt64Team-application id: the team's registration (entry) for the season; play-by-play teamApplicationId is the same key space.
club_idInt64Club id: the club across seasons and categories (Ilirija = 16). No captured route is keyed by it.
club_memberBooleanTrue when the club is a KZS member (false on nested copies that omit it).
categoryStringAge category: ABSOLUTE (senior) or U8-U23 / ANY (code table in kzs-returns.md).
rankStringTier: FIRST-FOURTH or TOURNAMENT (code table).
genderStringMALE or FEMALE.
sport_hall_idInt64Sport hall (venue) id. /sportHalls/{id} is in the site bundle, not captured.
sport_hall_nameStringName of the venue (sports hall) where the game is played or the team is based.
sport_hall_address_idInt64Id of the venue's address record.
sport_hall_address_post_office_idInt64Post-office id (FMS internal).
sport_hall_address_post_office_zip_codeStringPostal code (REDACTED under a club addresses[] row; kept for venues).
sport_hall_address_post_office_nameStringPost-office town.
sport_hall_address_post_office_municipalityStringMunicipality, upper case.
sport_hall_address_post_office_countryStringCountry, ISO 3166-1 alpha-2 (SI).
sport_hall_address_streetStringVenue street (a public sports hall).
sport_hall_address_house_numberStringVenue house number, a string ('6 A').
nameStringTeam name for the season (sponsor name included).
codeStringTeam 3-letter code.
season_idInt64Season id: OPAQUE, not a year (1 = 2000/2001 ... 27 = 2026/2027, 31 = 1991/1992). The season name is 'START/END'; the sdv season is the END year (the second half of name).
season_nameStringSeason, 'START/END' (2025/2026); sdv season = the END year.
season_is_activeBooleanTrue for the current season only (2026/2027 on 2026-10-12).
season_activeBooleanSame as isActive.
short_nameStringTeam short name ('' when none).
home_jersey_colorStringHome jersey colour, hex '#RRGGBB'.
guest_jersey_colorStringAway jersey colour, hex.
logo_uuidStringLogo: image file id, served at https://api.kzs.si/public/images/{uuid}.
seasonInt64Season of the registration.
competitionsStringCompetitions of the team this season (id, name, rule, phases).

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API has nothing for the request (an empty list, a competition without standings, a final game with no play-by-play or box score).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API answered HTTP 400 (its only error status: an unknown id or a bad parameter).
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. The fetch failed or the answer is unknown or partial: a full list page, a game that is not final, an envelope whose status is not OK, or a body for another competition, match, team, player or season than the one asked for.

Example​

kzs_team(team_id=17551)

kzs_team_general​

A team's record, form and best players in one competition (the body echoes neither id).

Endpoint URL: GET https://api.kzs.si/api/v1/public/teams/{team_id}/general

Valid URL: https://api.kzs.si/api/v1/public/teams/17551/general?competitionId=579

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYTeam id (team_id in kzs_teams): one club team in one season, e.g. 17551. Not the match-team id nor the club id.
competitionIdcompetition_idYCompetition id (competition_id in kzs_competitions): one per competition per season, e.g. 579 (men's first league 2025/26).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
team_idInt64Team id: one club team in one season (joins kzs_teams); not the match-team id and not the club id.
competition_idInt64Competition id: one per competition per season (men's first league 2025/26 = 579, 2026/27 = 608).
wonInt64Wins in the competition (all phases).
lostInt64Losses in the competition.
last_gamesStringRecent results, 'W' or 'L' per game (order unverified).
best_points_player_idInt64Player id (KZS player registry). Joins to /players/{playerId}, box-score and play-by-play playerId.
best_points_player_identification_numberInt64Player's KZS registration (licence) number; a different key space from the player id, used by no captured route.
best_points_player_person_idInt64Person id: the federation's person record behind a player, coach or official; a different key space from player, coach and official ids.
best_points_player_person_first_nameStringThe player's given name.
best_points_player_person_last_nameStringThe player's family name.
best_points_player_person_year_of_birthInt64Year of birth (players: public bio).
best_points_player_nationality_idInt64Country id (FMS internal; use the ISO codes).
best_points_player_nationality_alpha2_codeStringISO 3166-1 alpha-2 country code.
best_points_player_nationality_alpha3_codeStringISO 3166-1 alpha-3 country code.
best_points_player_nationality_nameStringCountry name in Slovenian (e.g. 'Združene države' = United States); use engName or the ISO codes.
best_points_player_nationality_eng_nameStringCountry name in English.
best_points_player_homegrownBooleanTrue when the player counts as homegrown (domači igralec) for roster limits.
best_points_player_photo_uuidStringPlayer photo: image file id, served at https://api.kzs.si/public/images/{uuid}.
best_points_player_positionsStringUnobserved: null, or an empty array, in every sample, so its type and meaning are unconfirmed.
best_average_pointsFloat64That player's points per game.
best_rebounds_player_idInt64Player id (KZS player registry). Joins to /players/{playerId}, box-score and play-by-play playerId.
best_rebounds_player_identification_numberInt64Player's KZS registration (licence) number; a different key space from the player id, used by no captured route.
best_rebounds_player_person_idInt64Person id: the federation's person record behind a player, coach or official; a different key space from player, coach and official ids.
best_rebounds_player_person_first_nameStringThe player's given name.
best_rebounds_player_person_last_nameStringThe player's family name.
best_rebounds_player_person_year_of_birthInt64Year of birth (players: public bio).
best_rebounds_player_nationality_idInt64Country id (FMS internal; use the ISO codes).
best_rebounds_player_nationality_alpha2_codeStringISO 3166-1 alpha-2 country code.
best_rebounds_player_nationality_alpha3_codeStringISO 3166-1 alpha-3 country code.
best_rebounds_player_nationality_nameStringCountry name in Slovenian (e.g. 'Združene države' = United States); use engName or the ISO codes.
best_rebounds_player_nationality_eng_nameStringCountry name in English.
best_rebounds_player_homegrownBooleanTrue when the player counts as homegrown (domači igralec) for roster limits.
best_rebounds_player_photo_uuidStringPlayer photo: image file id, served at https://api.kzs.si/public/images/{uuid}.
best_rebounds_player_positionsStringUnobserved: null, or an empty array, in every sample, so its type and meaning are unconfirmed.
best_average_reboundsFloat64That player's rebounds per game.
best_assists_player_idInt64Player id (KZS player registry). Joins to /players/{playerId}, box-score and play-by-play playerId.
best_assists_player_identification_numberInt64Player's KZS registration (licence) number; a different key space from the player id, used by no captured route.
best_assists_player_person_idInt64Person id: the federation's person record behind a player, coach or official; a different key space from player, coach and official ids.
best_assists_player_person_first_nameStringThe player's given name.
best_assists_player_person_last_nameStringThe player's family name.
best_assists_player_person_year_of_birthInt64Year of birth (players: public bio).
best_assists_player_nationality_idInt64Country id (FMS internal; use the ISO codes).
best_assists_player_nationality_alpha2_codeStringISO 3166-1 alpha-2 country code.
best_assists_player_nationality_alpha3_codeStringISO 3166-1 alpha-3 country code.
best_assists_player_nationality_nameStringCountry name in Slovenian (e.g. 'Združene države' = United States); use engName or the ISO codes.
best_assists_player_nationality_eng_nameStringCountry name in English.
best_assists_player_homegrownBooleanTrue when the player counts as homegrown (domači igralec) for roster limits.
best_assists_player_photo_uuidStringPlayer photo: image file id, served at https://api.kzs.si/public/images/{uuid}.
best_assists_player_positionsStringUnobserved: null, or an empty array, in every sample, so its type and meaning are unconfirmed.
best_average_assistsFloat64That player's assists per game.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API has nothing for the request (an empty list, a competition without standings, a final game with no play-by-play or box score).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API answered HTTP 400 (its only error status: an unknown id or a bad parameter).
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. The fetch failed or the answer is unknown or partial: a full list page, a game that is not final, an envelope whose status is not OK, or a body for another competition, match, team, player or season than the one asked for.

Example​

kzs_team_general(competition_id=579, team_id=17551)