Skip to main content
Version: 0.2.0

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

lba_championships​

Championships of a season, one per phase (Regular Season, Play Off); every season when none is given.

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

Valid URL: https://www.legabasket.it/api/championships/get-championships?cs_id=1&items=1000&s=2027

API ParameterPythonPatternRequiredNullableDescription
sseasonYSeason END year (2027 = 2026-27). Omitted = every season (310 championships).

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.
championship_idInt64Championship id (one season and phase).
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
nameStringChampionship name, e.g. Regular Season A, Play Off A1.
statusInt64Championship status: 1 = in progress, 2 = finished (inferred from the 2026-27 and past samples).
championship_type_idInt64Phase type id: 4 = Regular Season, 2 = Play Off.
championship_series_idInt64Series id, 1 = Serie A.
full_nameStringName with the season, e.g. Regular Season A 2017.
focus_onBooleanHighlighted on the site.
ctype_codeStringPhase type code: RS / PO.
ctype_nameStringPhase type name, as sent in English: Regular Season, Play Off.
cserie_codeStringSeries code, A1 = Serie A.
cserie_nameStringName of the championship series, e.g. Serie A.
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_championships(season=2027)

lba_calendar​

Games of one round of a championship: teams, score, venue, referees and broadcasters.

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

Valid URL: https://www.legabasket.it/api/championships/get-championships-calendar-by-id?id=602&d=1

API ParameterPythonPatternRequiredNullableDescription
idchampionship_idYChampionship id (championship_id in lba_championships): one season AND one phase.
droundYRound number (day_serial, 1, 2, ...). Omitted = the current round (the last played for a finished championship).

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.
game_idInt64Game id (global across seasons); joins lba_calendar and lba_game.
game_statusStringGame status, number sent as a string: 0 scheduled, 1 live, 2 final (per the OSS client; only 2 sampled).
championship_idInt64Championship id (season + phase) of the game.
championships_day_idInt64Round id (championships_day_id key space: one round of one championship; joins filters.days[].id and standings championships_day_id; not the d param).
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
numberInt64Round number of the game, equal to day_serial (the d echo the capture checks).
match_datetimeStringTip-off, ISO-8601 with the Italian offset (1995-96: midnight, no time kept).
match_hhInt64Tip-off hour, local time.
match_mmInt64Tip-off minute, local time.
home_final_scoreInt64Final points of the home team.
visitor_final_scoreInt64Final points of the away team.
target_scoreStringNull in every sample (meaning unverified).
additional_timeInt64Overtime periods played (0 in every sample; reading inferred).
plant_idInt64Arena id (arena key space; joins nothing specced).
websocket_match_idInt64Live-feed game id, number sent as a string; separate from the game id.
ticketing_urlStringTicket shop URL (null for old games).
has_streamingInt641 when a stream exists, else 0.
updated_atStringTimestamp, ISO-8601 with the Italian offset. Last update of the game row.
h_team_idInt64Home team id (team-season).
h_team_nameStringHome team name (sponsor name of that season).
h_club_codeStringHome club code, e.g. TVB; null on the 2017-18 and 1995-96 calendar rows.
h_team_enabledBooleanHome team page enabled on the site.
home_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
v_team_idInt64Away team id (team-season).
v_team_nameStringVisitor team name (the sponsor name of that season).
v_club_codeStringAway club code (BCR); null on the 2017-18 and 1995-96 calendar rows.
v_team_enabledBooleanAway team page enabled on the site.
v_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
town_idInt64Town id of the arena (town key space; joins nothing specced).
plant_nameStringName of the arena where the game is played.
town_nameStringTown of the arena.
day_codeStringRound code (1, 2, ...; string in game rows, integer in standings).
day_serialInt64Round number (event_serial, the d param).
day_nameStringRound name, Italian: 1° Giornata = matchday 1.
match_serie_keyStringThe two team ids joined low_high (1761_1764).
refereesStringJSON list of the game's referees (id, name, surname); null when the site lists none.
broadcastersStringJSON list of the game's broadcasters (name, logo key); null when the site lists none.

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_calendar(championship_id=602, round=1)

lba_game​

Game header: teams, venue, quarter scores, coaches, referees and broadcasters.

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

Valid URL: https://www.legabasket.it/api/championships/get-championships-matches-by-id?sc=1&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
seasonInt64Season END year (2027 = 2026-27): the row's START year + 1.
game_idInt64Game id (global across seasons); joins lba_calendar and lba_game.
game_statusStringGame status, number sent as a string: 0 scheduled, 1 live, 2 final (per the OSS client; only 2 sampled).
championship_idInt64Championship id (season + phase) of the game.
competition_nameStringChampionship full name, e.g. Regular Season 2026/27.
championships_day_idInt64Round id (championships_day_id key space: one round of one championship; joins filters.days[].id and standings championships_day_id; not the d param).
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
numberInt64Round number of the game, equal to day_serial (the d echo the capture checks).
match_datetimeStringTip-off, ISO-8601 with the Italian offset (1995-96: midnight, no time kept).
match_hhInt64Tip-off hour, local time.
match_mmInt64Tip-off minute, local time.
target_scoreStringNull in every sample (meaning unverified).
home_final_scoreInt64Final points of the home team.
visitor_final_scoreInt64Final points of the away team.
q1_hsInt64Home points in the 1st quarter (null in the 1995-96 sample: no period scores then).
q1_vsInt64Away points in the 1st quarter.
q2_hsInt64Home points in the 2nd quarter.
q2_vsInt64Away points in the 2nd quarter.
q3_hsInt64Home points in the 3rd quarter (0 in the 1995-96 sample: a placeholder, not a score).
q3_vsInt64Away points in the 3rd quarter (0 placeholder in 1995-96).
q4_hsInt64Home points in the 4th quarter (0 placeholder in 1995-96).
q4_vsInt64Away points in the 4th quarter (0 placeholder in 1995-96).
ot_hsInt64Home overtime points (0 without overtime).
ot_vsInt64Away overtime points.
home_coach_idInt64Home head coach id.
home_coach_codeStringHome head coach code SURNAME3-NAME3.
home_coach_fullnameStringHome head coach, Surname Name.
visitor_coach_idInt64Away head coach id.
visitor_coach_codeStringAway head coach code.
visitor_coach_fullnameStringAway head coach, Surname Name.
additional_timeInt64Overtime periods played (0 in every sample; reading inferred).
plant_idInt64Arena id (arena key space; joins nothing specced).
websocket_match_idInt64Live-feed game id, number sent as a string; separate from the game id.
has_streamingInt641 when a stream exists, else 0.
live_match_dataStringNull in every sample (meaning unverified).
quarterStringLast period played, number sent as a string (4; 5 = overtime).
ticketing_urlStringTicket shop URL (null for old games).
match_serieStringAll-time head-to-head as home wins-away wins (6-18; inferred from match_hw / match_vw).
match_hwInt64All-time head-to-head wins of the home club (inferred).
match_vwInt64All-time head-to-head wins of the away club (inferred).
updated_atStringTimestamp, ISO-8601 with the Italian offset. Last update of the game row.
h_team_idInt64Home team id (team-season).
h_team_nameStringHome team name (sponsor name of that season).
h_team_enabledBooleanHome team page enabled on the site.
home_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
v_team_idInt64Away team id (team-season).
v_team_nameStringVisitor team name (the sponsor name of that season).
v_team_enabledBooleanAway team page enabled on the site.
v_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
plant_nameStringName of the arena where the game is played.
day_codeStringRound code (1, 2, ...; string in game rows, integer in standings).
day_serialInt64Round number (event_serial, the d param).
day_nameStringRound name, Italian: 1° Giornata = matchday 1.
competition_type_idInt64Phase type id: 4 = Regular Season, 2 = Play Off.
competition_type_codeStringPhase type code: RS / PO.
competition_typeStringPhase type name: Regular Season / Play Off.
competition_serie_idInt64Series id, 1 = Serie A.
competition_serieStringSeries name, Serie A.
day_phase_idInt64Phase id: 1 = Andata (first half of the season), 2 = Ritorno (second half).
spectatorsInt64Attendance: spectators at the game.
refereesStringJSON list of the game's referees (id, name, surname); null when the site lists none.
broadcastersStringJSON list of the game's broadcasters (name, logo key); null when the site lists none.

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_game(game_id=25602)

lba_box_score​

Box score of a final game: one row per player of both teams (Italian-named stat columns).

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.
player_idInt64Player id (global).
player_numInt64Jersey number the player wore in the game.
player_surnameStringFamily name, upper case.
player_nameStringPlayer's given name.
player_codeStringPlayer code SURNAME3-NAME3-YY.
player_p_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
punInt64Points (punti).
minInt64Minutes played, whole minutes (minuti); 200 in totals = 5 × 40.
secInt64Seconds played (secondi) = min × 60 in every sample.
sfStringStarter flag (starting five), number sent as a string: 1 = started.
falli_cInt64Fouls committed (falli commessi).
falli_sfInt64Fouls drawn (falli subiti).
falli_tc1Int64Technical fouls (falli tecnici; reading tc1 as category-1 technicals is inferred).
falli_flaInt64Unsportsmanlike / flagrant fouls (falli antisportivi).
t2_rInt642-point field goals made (tiri da 2 realizzati).
t2_tInt642-point field goals attempted (tiri da 2 tentati).
t2_percFloat642-point field-goal percentage, 0-100 (number; 0 when no attempt).
scInt64Dunks (schiacciate).
t3_rInt643-point field goals made.
t3_tInt643-point field goals attempted.
t3_percFloat643-point field-goal percentage, 0-100.
tl_rInt64Free throws made (tiri liberi realizzati).
tl_tInt64Free throws attempted (tiri liberi tentati).
tl_percFloat64Free-throw percentage, 0-100.
rimbalzi_oInt64Offensive rebounds (rimbalzi offensivi).
rimbalzi_dInt64Defensive rebounds (rimbalzi difensivi).
rimbalzi_tInt64Total rebounds (rimbalzi totali).
stoppate_datInt64Blocks (stoppate date).
stoppate_subInt64Own shots blocked (stoppate subite).
palle_pInt64Turnovers (palle perse).
palle_rInt64Steals (palle recuperate).
assInt64Assists credited to the player in the game.
val_legaInt64LBA efficiency rating (valutazione Lega).
val_oerFloat64OER = points / (FGA + turnovers + FTA / 2); verified on every 2026-27 sample row.
plus_minusInt64Plus-minus: point margin while on court.

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_box_score(game_id=25602)

lba_pbp​

Play-by-play of a final game (2017-18 on), one row per action with x/y; coordinate frame by era.

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

Valid URL: https://www.legabasket.it/api/championships/get-championships-matches-play-by-play?info=true&sort=asc&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.
home_team_idInt64Home team-season id of the game (the play-by-play ht_id).
visitor_team_idInt64Visitor team-season id of the game (the play-by-play vt_id).
team_sideStringSide of the acting team, home or visitor; null for a clock action without a team.
home_scoreInt64Home points after the action, parsed from the score text (2021-22 on; else null).
visitor_scoreInt64Visitor points after the action, parsed from the score text (2021-22 on; else null).
coord_frameStringFrame of x and y: half_court_px (2017-18 and 2018-19 image pixels) or court_pct (2019-20 on, 0-100).
action_idInt64Action id within the game (ascending in time from 2021-22; not ordered before).
descriptionStringAction type in Italian, e.g. 2 punti segnato (2-pointer made); full translation table in the Divergence notes.
player_idInt64Player id (null for team and clock actions).
team_idInt64Team id (team-season) of the actor.
home_clubInt641 = the home team acted, 0 = the away team; null for clock actions, and on every action in 2018-19 and 2019-20 (use side there).
in_areaBooleanTrue on shots from the paint (zone 3).
dunkInt641 = dunk, 0 otherwise.
secondsInt64Elapsed seconds within minute (0-59); 0 before 2019-20. Elapsed = minute × 60 + seconds; print_time = period length minus that.
minuteInt64Elapsed minute of the period (2019-20 on: 0-9, with seconds); 2017-18 / 2018-19: 1-10, the minute in progress, seconds 0.
periodInt64Period: 1-4, 5+ = overtime.
orderInt64Sort key; sort=asc orders by it.
sideInt64Basket the row's side_area_zone is measured from, as sent: 0 = the basket at x = 0, 1 = the one at x = 100 (zone A is that basket's half: x < 50 for 0, x >= 50 for 1). It is NOT the team of the game (that is team_side): on shots, assists, fouls committed, turnovers and offensive rebounds it is the actor's attacking basket, which changes at half-time; on defensive rebounds, steals, blocks and fouls drawn it is the opponent's.
xInt64Court x; frame by era (see the coordinates section): 2019-20 on, 0-100 % of the 28 m length; 2017-18 / 2018-19, half-court image pixels; null (2019-20 on) or 0 (earlier) when unlocated.
yInt64Court y; 2019-20 on, 0-100 % of the 15 m width; 2017-18 / 2018-19, image pixels (see the coordinates section).
scoreStringScore after the action, home - away string (0 - 0); 2020-21 on scoring actions only, null before.
linked_action_idInt64action_id of the related action: the shot an assist or rebound belongs to, the foul a drawn foul answers, the player swapped in a substitution.
print_timeStringGame clock remaining, MM:SS (10:00 at a period start); null before 2021-22.
action_1_qualifier_codeStringFirst qualifier code, number sent as a string (shot type, turnover type, foul type; see legend).
action_2_qualifier_codeStringSecond qualifier code (fast break 500, blocked 1005, tip-ins 1001-1004, ...).
action_1_qualifier_descriptionStringlegend label of action_1_qualifier_code, Italian.
action_2_qualifier_descriptionStringlegend label of action_2_qualifier_code, Italian.
side_area_zoneStringA = in the actor's attacking half, D = its defensive half (2021-22 on).
side_area_codeStringCourt zone 1-10, number sent as a string (see the coordinates section; 2021-22 on).
player_nameStringGiven name of the acting player.
player_surnameStringFamily name of the acting player.
player_numberStringJersey number, number sent as a string.
team_nameStringTeam name in that season, with its sponsor (Nutribullet Treviso Basket); changes with the sponsor.
idInt64Always null (not a key).

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_pbp(game_id=25602)

lba_pbp_legend​

The play-by-play qualifier code table (59 codes) with its Italian labels.

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

Valid URL: https://www.legabasket.it/api/championships/get-championships-matches-play-by-play?info=true&sort=asc&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
codeInt64Qualifier code, the value of action_1_qualifier_code / action_2_qualifier_code on the actions.
labelStringItalian label of the qualifier code, as sent.

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_pbp_legend(game_id=25602)

lba_shots​

Shooting by court zone per team for a final game (made / attempted aggregates; zone 7 includes free throws).

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

Valid URL: https://www.legabasket.it/api/matches/get-championship-matches-shots-by-id?info=1&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.
zoneInt64Court zone 1-10 (the play-by-play side_area_code); zone 7 also holds the free throws.
madeInt64Shots made in the zone, parsed from num.
attemptsInt64Shots attempted in the zone, parsed from num.
percFloat64Made / attempted × 100.
precisionInt64Decimal places the site shows (1).
numStringMade/attempted as a string (17/21); zone 7 also counts free throws.
opacityInt64Heat-map shading for the site: perc floored, minimum 5.

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_shots(game_id=25602)

lba_standings​

Standings of a championship after a round, one row per team.

Endpoint URL: GET https://www.legabasket.it/api/championships/get-championship-ranking

Valid URL: https://www.legabasket.it/api/championships/get-championship-ranking?id=602&d=3

API ParameterPythonPatternRequiredNullableDescription
idchampionship_idYChampionship id (championship_id in lba_championships; a Regular Season id carries standings).
droundYStandings after this round. Required in practice for a finished championship: without it the site sends none (NoDataError).

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.
standing_idInt64Standings row id (one team after one round; joins nothing else).
championships_day_idInt64Round id the standings are after.
team_idInt64Team id (team-season).
positionInt64Rank in the standings.
winsInt64Games the team has won through the round.
defeatsInt64Games the team has lost through the round.
points_madeInt64Points the team has scored through the round.
points_sufferedInt64Points allowed.
qpInt64Tie-break quotient (quoziente punti?); 1 in the samples (unverified).
lvStringNull in every sample (meaning unverified).
lpStringNull in every sample (meaning unverified).
lpfStringNull in every sample (meaning unverified).
lpsStringNull in every sample (meaning unverified).
lqpStringNull in every sample (meaning unverified).
updated_atStringTimestamp, ISO-8601 with the Italian offset.
pointsInt64Standings points (2 per win).
penalty_pointsInt64Points deducted (0 or null).
game_playedInt64Games the team has played through the round.
home_game_playedInt64Home games played.
home_winsInt64Home games won.
home_defeatsInt64Home games the team has lost through the round.
away_game_playedInt64Away games played.
away_winsInt64Away games won.
away_defeatsInt64Away games the team has lost through the round.
avg_points_madeFloat64Points scored per game.
avg_points_sufferedFloat64Points allowed per game.
home_points_madeInt64Points scored at home.
home_points_sufferedInt64Points allowed at home.
home_avg_points_madeFloat64Points scored per home game.
home_avg_points_sufferedFloat64Points allowed per home game.
away_points_madeInt64Points scored away.
away_points_sufferedInt64Points allowed away.
away_avg_points_madeFloat64Points scored per away game.
away_avg_points_sufferedFloat64Points allowed per away game.
yearInt64Season START year (2026 = 2026-27); sdv END year = year + 1.
tiesInt64Ties (0 or null; basketball has none).
home_tiesInt64Home ties (null).
away_tiesInt64Away ties (null).
play_off_qualifiedBooleanClinched a play-off place (null in old seasons).
relegationBooleanRelegated (null in old seasons).
movementStringPosition change since the previous round, signed string (+2, -1; null for finished seasons).
wins_percentFloat64Win percentage as a string with % (100%).
home_wins_percentFloat64Home win percentage, string with %.
away_wins_percentFloat64Away win percentage, string with %.
max_points_madeInt64Most points scored in a game.
home_max_points_madeInt64Most points scored in a home game.
away_max_points_madeInt64Most points scored in an away game.
day_codeInt64Round code the standings are after (integer).
day_nameStringRound name, Italian (4ª Giornata - 2° fase = matchday 4 of the 2nd phase).
team_nameStringTeam name in that season, with its sponsor (Nutribullet Treviso Basket); changes with the sponsor.
club_codeStringClub code (TVB, TS); whether it is stable across seasons is unverified.
logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
ctpInt64Classification marker; 0 or null in the samples (unverified).
ctp_symbolStringNull in every sample (meaning unverified).
ctp_descriptionStringNull in every sample (meaning unverified).
season_start_yearInt64The wire season field: the season START year (2026 = 2026-27), same as year.

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_standings(championship_id=602, round=3)

lba_roster​

Players of one team-season with bio, number and role.

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

Valid URL: https://www.legabasket.it/api/teams/get-team-roster?id=1764

API ParameterPythonPatternRequiredNullableDescription
idteam_idYTeam id (team_id in lba_teams), e.g. 1764. One team-season: ids are re-issued every season.

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).
nameStringPlayer's given name.
surnameStringPlayer's family name.
codeStringPlayer code SURNAME3-NAME3-YY.
place_of_birthStringBirthplace (Italian spelling).
birth_dateStringBirth date, Date YYYY-MM-DD.
player_numberStringJersey number, number sent as a string.
countryStringNationality, ISO alpha-3.
uefa_ratioStringEligibility class for the foreign-player quota: I, E or C (7 / 6 / 1 on the Treviso roster; reading as Italian / EU / non-EU is inferred).
heightInt64Player's height in centimetres.
weightInt64Player's weight in kilograms.
yearInt64Season START year of the player entry (2026 = 2026-27).
start_dateStringContract start with the team, Date YYYY-MM-DD.
end_dateStringContract end with the team, Date YYYY-MM-DD.
player_role_idInt64Position id (position key space: the id behind player_role; joins the r_id filter).
player_roleStringPosition, Italian: Playmaker (point guard), Guardia (guard), Ala (forward), Centro (center), - unknown.
team_nameStringTeam name in that season, with its sponsor (Nutribullet Treviso Basket); changes with the sponsor.
player_picture_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
team_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_roster(team_id=1764)

lba_roster_coach​

Head coach of one team-season.

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

Valid URL: https://www.legabasket.it/api/teams/get-team-roster?id=1764

API ParameterPythonPatternRequiredNullableDescription
idteam_idYTeam id (team_id in lba_teams), e.g. 1764. One team-season: ids are re-issued every season.

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.
coach_idInt64Coach id (global coach key space; joins the game header home_coach_id / visitor_coach_id).
nameStringCoach's given name.
surnameStringCoach's family name.
birth_dateStringBirth date, Date YYYY-MM-DD.
place_of_birthStringBirthplace (Italian spelling, e.g. Londra).
coach_type_idInt64Coach role id (1 = head coach).
coach_type_descriptionStringCoach role, Italian: Allenatore = head coach.
coach_type_codeStringCoach role code, number sent as a string.
team_nameStringTeam, short name.
coach_picture_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
team_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_roster_coach(team_id=1764)

lba_game_log​

A player's game log for one season, one row per game.

Endpoint URL: GET https://www.legabasket.it/api/players/get-player-matches

Valid URL: https://www.legabasket.it/api/players/get-player-matches?cs_id=1&id=969&s=2027

API ParameterPythonPatternRequiredNullableDescription
idplayer_idYPlayer id (player_id in lba_players or a box score), e.g. 969. Global: one id for a whole career.
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.
stat_line_idInt64Id of the player's stat line for the game (one per player and game).
championship_idInt64Championship id of the game.
championships_match_idInt64Game id (global across seasons); joins lba_calendar and lba_game.
player_idInt64Player id (global, one per career).
team_idInt64Team id (team-season) of the player.
numberInt64Jersey number the player wore in the game.
played_minutesInt64Minutes played, in that game.
pointsInt64Points, in that game.
suffered_foulsInt64Fouls drawn, in that game.
done_foulsInt64Fouls committed, in that game.
shots_2p_realizedInt642-point field goals made, in that game.
shots_2p_totalInt642-point field goals attempted, in that game.
shots_3p_realizedInt643-point field goals made, in that game.
shots_3p_totalInt643-point field goals attempted, in that game.
free_throws_realizedInt64Free throws made, in that game.
free_throws_totalInt64Free throws attempted, in that game.
restricted_area_p1StringNull in every sample (meaning unverified).
restricted_area_p2StringNull in every sample (meaning unverified).
restricted_area_p3StringNull in every sample (meaning unverified).
slam_dunkInt64Dunks, in that game.
offensive_reboundInt64Offensive rebounds, in that game.
defensive_reboundInt64Defensive rebounds, in that game.
ball_stop_givenInt64Blocks, in that game.
ball_stop_receivedInt64Own shots blocked, in that game.
lost_ballsInt64Turnovers, in that game.
regain_ballsInt64Steals, in that game.
assistsInt64Assists, in that game.
technical_foulsStringTechnical fouls (null in old seasons).
minute5_foulsInt64Minute of the fifth foul (0 = did not foul out; inferred, unverified).
time5_foulsInt64Game time of the fifth foul (0 = did not foul out; inferred, unverified).
rating_legaInt64LBA efficiency rating (valutazione), in that game.
quintetInt64Starts (in the starting five), in that game.
rating_oerFloat64OER (points / (FGA + turnovers + FTA / 2)), in that game.
avg_pointsInt64The player's plus-minus in the game (the site's name is misleading).
wp_idInt64Null in every sample (meaning unverified).
deleted_atStringNull in every sample (meaning unverified).
created_atStringTimestamp, ISO-8601 with the Italian offset.
updated_atStringTimestamp, ISO-8601 with the Italian offset.
player_role_idInt64Position id (position key space: the id behind player_role; joins the r_id filter).
orderInt64Row order in the box score.
captainBooleanTeam captain in that game.
shots_2p_percInt642-point field-goal percentage, 0-100, in that game.
shots_3p_percInt643-point field-goal percentage, 0-100, in that game.
free_throws_percInt64Free-throw percentage, 0-100, in that game.
total_reboundInt64Total rebounds, in that game.
ext_codeString`<websocket_match_id>\
fouls_first_categoryInt64Category-1 technical fouls (null in old seasons; reading inferred).
fouls_flagrantInt64Unsportsmanlike / flagrant fouls.
championship_day_nameStringRound code, number sent as a string.
home_scoreInt64Home points after the action, parsed from the score text (2021-22 on; else null).
visitor_scoreInt64Visitor points after the action, parsed from the score text (2021-22 on; else null).
match_dateStringTip-off in UTC, ISO-8601 Z (local time in match_hh / match_mm).
match_hhInt64Tip-off hour, local time.
match_mmInt64Tip-off minute, local time.
championship_match_idInt64Game id (repeated).
player_team_idInt64Team id (team-season) of the player (repeated).
player_team_nameStringShort name of the player's team in the game (without the season sponsor).
player_team_codeString`\
visitor_team_idInt64Visitor team-season id of the game (the play-by-play vt_id).
visitor_team_nameStringAway team short name.
visitor_team_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
home_team_idInt64Home team-season id of the game (the play-by-play ht_id).
home_team_nameStringHome team short name.
home_team_logo_keyStringImage key: the image is {cdn_url}/{key}, resized copies {cdn_url}/variants/{key}/thumb or /large (the site's getApiImageUrl).
phase_descriptionStringPhase code: And (Andata, 1st half of the season) / Rit (Ritorno).
match_adpInt64The player's plus-minus in the game (the site's name is misleading).
home_match_resultStringw / l for the home team when the player was on it, else null.
visitor_match_resultStringw / l for the away team when the player was on it, else null.

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_game_log(player_id=969, season=2027)