Skip to main content
Version: 0.2.0

Lega Basket Serie A — Lega Basket Serie A site API (www.legabasket.it/api, Italy) — Team

lba_team_box_score​

Team lines of a final game's box score: the team-booked stats and the totals of each side.

Endpoint URL: GET https://www.legabasket.it/api/championships/get-championships-matches-scores-by-id

Valid URL: https://www.legabasket.it/api/championships/get-championships-matches-scores-by-id?info=true&id=25602

API ParameterPythonPatternRequiredNullableDescription
idgame_idYGame id (game_id in lba_calendar), e.g. 25602. 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
game_idInt64Game id (global across seasons); joins lba_calendar and lba_game.
seasonInt64Season END year (2027 = 2026-27): the row's START year + 1.
sideStringWhich team of the game the row belongs to: home or visitor.
team_idInt64Team-season id (re-issued every season); join lba_teams for the stable club_id.
row_typeStringteam = stats booked to the team itself (team rebounds, team turnovers); totals = the whole side.
punInt64Points (punti). (team totals (players + team row))
falli_cInt64Fouls committed (falli commessi). (team totals (players + team row))
falli_sfInt64Fouls drawn (falli subiti). (team totals (players + team row))
falli_tc1Int64Technical fouls (falli tecnici; reading tc1 as category-1 technicals is inferred). (team totals (players + team row))
falli_flaInt64Unsportsmanlike / flagrant fouls (falli antisportivi). (team totals (players + team row))
rimbalzi_oInt64Offensive rebounds (rimbalzi offensivi). (team totals (players + team row))
rimbalzi_dInt64Defensive rebounds (rimbalzi difensivi). (team totals (players + team row))
rimbalzi_tInt64Total rebounds (rimbalzi totali). (team totals (players + team row))
palle_pInt64Turnovers (palle perse). (team totals (players + team row))
palle_rInt64Steals (palle recuperate). (team totals (players + team row))
val_legaInt64LBA efficiency rating (valutazione Lega). (team totals (players + team row))
minInt64Minutes played, whole minutes (minuti); 200 in totals = 5 × 40. (team totals (players + team row))
secInt64Seconds played (secondi) = min × 60 in every sample. (team totals (players + team row))
t2_rInt642-point field goals made (tiri da 2 realizzati). (team totals (players + team row))
t2_tInt642-point field goals attempted (tiri da 2 tentati). (team totals (players + team row))
t2_percFloat642-point field-goal percentage, 0-100 (number; 0 when no attempt). (team totals (players + team row))
scInt64Dunks (schiacciate). (team totals (players + team row))
t3_rInt643-point field goals made. (team totals (players + team row))
t3_tInt643-point field goals attempted. (team totals (players + team row))
t3_percFloat643-point field-goal percentage, 0-100. (team totals (players + team row))
tl_rInt64Free throws made (tiri liberi realizzati). (team totals (players + team row))
tl_tInt64Free throws attempted (tiri liberi tentati). (team totals (players + team row))
tl_percFloat64Free-throw percentage, 0-100. (team totals (players + team row))
stoppate_datInt64Blocks (stoppate date). (team totals (players + team row))
stoppate_subInt64Own shots blocked (stoppate subite). (team totals (players + team row))
assInt64Assists. (team totals (players + team row))
val_oerFloat64OER = points / (FGA + turnovers + FTA / 2); verified on every 2026-27 sample row. (team totals (players + team row))

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site has nothing for the request (an unknown season, a play-by-play before 2017-18, standings of a finished championship without a round, no rows).
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: an unknown id (the site answers HTTP 500), a game that is not final, a truncated page, or a body for another season, championship, game, team or player than the one asked for.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

lba_team_box_score(game_id=25602)

lba_teams​

Teams of a season, one row per team-season with the stable club id.

Endpoint URL: GET https://www.legabasket.it/api/teams/get-teams

Valid URL: https://www.legabasket.it/api/teams/get-teams?items=50&year=2027

API ParameterPythonPatternRequiredNullableDescription
yearseasonYSeason END year (2027 = 2026-27). Omitted = the site's default season (unverified).

Returns​

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

col_nametypedescription
seasonInt64Season END year (2027 = 2026-27): the row's START year + 1.
team_idInt64Team id (one team-season).
nameStringTeam name of that season (sponsor name).
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
club_idInt64Club id: the cross-season join key for team ids (only here and in the team headers); stability across seasons is unverified.
club_codeStringClub code (TVB, TS); whether it is stable across seasons is unverified.
updated_atStringTimestamp, ISO-8601 with the Italian offset.
logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site has nothing for the request (an unknown season, a play-by-play before 2017-18, standings of a finished championship without a round, no rows).
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: an unknown id (the site answers HTTP 500), a game that is not final, a truncated page, or a body for another season, championship, game, team or player than the one asked for.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

lba_teams(season=2027)

lba_team_players_stats​

Season totals of each player of a team-season.

Endpoint URL: GET https://www.legabasket.it/api/teams/get-team-players-stats

Valid URL: https://www.legabasket.it/api/teams/get-team-players-stats?cs_id=1&id=1764&s=2027

API ParameterPythonPatternRequiredNullableDescription
idteam_idYTeam id (team_id in lba_teams), e.g. 1764. One team-season: ids are re-issued every season.
sseasonYSeason END year (2027 = 2026-27) of the team id. Omitted = the site's default (unverified).

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-season id (re-issued every season); join lba_teams for the stable club_id.
club_idInt64Club id: the cross-season join key for team ids (only here and in the team headers); stability across seasons is unverified.
club_codeStringClub code (TVB, TS); whether it is stable across seasons is unverified.
seasonInt64Season END year (2027 = 2026-27): the row's START year + 1.
player_idInt64Player id (global, one per career).
player_nameStringPlayer's given name.
player_surnameStringPlayer's family name.
player_seasonInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
player_photo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
played_matchesInt64Games the player appeared in, in the request's championship series.
total_matchesInt64Team games while the player was listed (inferred).
start_formationInt64Games the player started, in the request's championship series.
points_sumInt64Season total of points.
played_minutes_sumInt64Season total of minutes played.
rating_lega_sumInt64Season total of LBA efficiency rating (valutazione).
rating_oer_sumFloat64Sum of the per-game OER values (3.34 over 3 games), not a season OER.
offensive_rebound_sumInt64Season total of offensive rebounds.
defensive_rebound_sumInt64Season total of defensive rebounds.
total_rebound_sumInt64Season total of total rebounds.
assists_sumInt64Season total of assists.
regain_balls_sumInt64Season total of steals.
lost_balls_sumInt64Season total of turnovers.
ball_stop_given_sumInt64Season total of blocks.
ball_stop_received_sumInt64Season total of own shots blocked.
done_fouls_sumInt64Season total of fouls committed.
suffered_fouls_sumInt64Season total of fouls drawn.
plus_minus_sumInt64Season total of plus-minus.
aplus_dp_sumInt64Season total of aplus_dp, an unverified metric (not plus-minus or assists: Macura 2026-27 has 9 against plus-minus 8 and 3 assists).
slam_dunk_sumInt64Season total of dunks.
shots_2p_realized_sumInt64Season total of 2-point field goals made.
shots_2p_total_sumInt64Season total of 2-point field goals attempted.
shots_2p_perc_sumFloat64Season 2-point percentage, 0-100 (a rate despite _sum).
shots_3p_realized_sumInt64Season total of 3-point field goals made.
shots_3p_total_sumInt64Season total of 3-point field goals attempted.
shots_3p_perc_sumFloat64Season 3-point percentage, 0-100 (a rate despite _sum).
free_throws_realized_sumInt64Season total of free throws made.
free_throws_total_sumInt64Season total of free throws attempted.
free_throws_perc_sumFloat64Season free-throw percentage, 0-100 (a rate despite _sum).

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site has nothing for the request (an unknown season, a play-by-play before 2017-18, standings of a finished championship without a round, no rows).
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: an unknown id (the site answers HTTP 500), a game that is not final, a truncated page, or a body for another season, championship, game, team or player than the one asked for.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

lba_team_players_stats(season=2027, team_id=1764)

lba_teams_leaderboard​

Season team leaderboards, offensive or defensive, one row per team and category.

Endpoint URL: GET https://www.legabasket.it/api/statistics/get-teams-statistics-by-type

Valid URL: https://www.legabasket.it/api/statistics/get-teams-statistics-by-type?cs_id=1&type=teams_offensive&s=2027

API ParameterPythonPatternRequiredNullableDescription
typeboardYBoard: teams_offensive or teams_defensive.
sseasonYSeason END year (2027 = 2026-27). Omitted = the site's default season (unverified).

Returns​

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

col_nametypedescription
seasonInt64Season END year (2027 = 2026-27): the row's START year + 1.
categoryStringCategory of this row (the cat param, e.g. points).
nameStringGiven name (players) / team name (teams).
sponsor_nameStringSponsor name (empty or null in the samples).
short_nameStringShort name of the team, e.g. BC Roma.
tv_nameStringShort team name for TV graphics.
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
attemptsInt64Shots attempted in the zone, parsed from num.
total_played_matchesInt64Games the team has played, counted for the leaderboard.
total_pointsInt64Points scored (offensive) or allowed (defensive) in the season.
minutesInt64Minutes per game (players: decimal string 28.67) / total minutes (teams: integer).
score_40_minFloat64Value per 40 minutes.
scoreFloat64Value in the category under the ob order (default avg = per game); players send a decimal string, teams a number.
team_idInt64Team id (team-season).

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The site has nothing for the request (an unknown season, a play-by-play before 2017-18, standings of a finished championship without a round, no rows).
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: an unknown id (the site answers HTTP 500), a game that is not final, a truncated page, or a body for another season, championship, game, team or player than the one asked for.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.

Example​

lba_teams_leaderboard(board='teams_offensive', season=2027)