Skip to main content

NBA G League — G League Stats API (stats.nba.com, LeagueID=20) — Franchise

nbagl_stats_franchisehistory​

Franchise history.

Endpoint URL: GET https://stats.nba.com/stats/franchisehistory

Valid URL: https://stats.nba.com/stats/franchisehistory?LeagueID=20

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY

Returns​

return_parsed=True (default) — A dict of DataFrames keyed by result-set name (FranchiseHistory, DefunctTeams) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

FranchiseHistory

col_nametypedescription
league_idString
team_idInt64
team_cityString
team_nameString
start_yearStringFirst season (start year) of the franchise span, as a string (e.g. '1949').
end_yearStringLast season (start year) of the franchise span, as a string; the current season for an active franchise.
yearsInt64
gamesInt64
winsInt64
lossesInt64
win_pctFloat64
po_appearancesInt64NBA or WNBA Stats value for playoff appearances in the franchisehistory result set.
div_titlesInt64NBA or WNBA Stats value for div titles in the franchisehistory result set.
conf_titlesInt64NBA or WNBA Stats value for conf titles in the franchisehistory result set.
league_titlesInt64NBA or WNBA Stats value for league titles in the franchisehistory result set.

DefunctTeams

col_nametypedescription
league_idString
team_idInt64
team_cityString
team_nameString
start_yearStringFirst season (start year) of the franchise span, as a string (e.g. '1949').
end_yearStringLast season (start year) of the franchise span, as a string; the current season for an active franchise.
yearsInt64
gamesInt64
winsInt64
lossesInt64
win_pctFloat64
po_appearancesInt64NBA or WNBA Stats value for playoff appearances in the franchisehistory result set.
div_titlesInt64NBA or WNBA Stats value for div titles in the franchisehistory result set.
conf_titlesInt64NBA or WNBA Stats value for conf titles in the franchisehistory result set.
league_titlesInt64NBA or WNBA Stats value for league titles in the franchisehistory result set.

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
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.
ImportErrorcurl_cffi is not installed -- stats.nba.com / stats.wnba.com block plain requests, so the transport needs it (pip install curl_cffi or sportsdataverse[all]).

Example​

nbagl_stats_franchisehistory(league_id='20')

nbagl_stats_franchiseleaders​

Franchise leaders.

Endpoint URL: GET https://stats.nba.com/stats/franchiseleaders

Valid URL: https://stats.nba.com/stats/franchiseleaders?LeagueID=20&TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
TeamIDteam_idY

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_idInt64
ptsInt64
pts_person_idInt64Stats API identifier for points person identifier associated with this NBA or WNBA Stats row.
pts_playerStringScoring or score-margin metric for points player in the requested NBA or WNBA Stats split.
astInt64
ast_person_idInt64Stats API identifier for assists person identifier associated with this NBA or WNBA Stats row.
ast_playerStringNBA or WNBA Stats value for assists player in the franchiseleaders result set.
rebInt64
reb_person_idInt64Stats API identifier for rebounds person identifier associated with this NBA or WNBA Stats row.
reb_playerStringRebounding metric for rebounds player in the requested NBA or WNBA Stats split.
blkInt64
blk_person_idInt64Stats API identifier for blocks person identifier associated with this NBA or WNBA Stats row.
blk_playerStringNBA or WNBA Stats value for blocks player in the franchiseleaders result set.
stlInt64
stl_person_idInt64Stats API identifier for steals person identifier associated with this NBA or WNBA Stats row.
stl_playerStringNBA or WNBA Stats value for steals player in the franchiseleaders result set.

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
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.
ImportErrorcurl_cffi is not installed -- stats.nba.com / stats.wnba.com block plain requests, so the transport needs it (pip install curl_cffi or sportsdataverse[all]).

Example​

nbagl_stats_franchiseleaders(league_id='20')

nbagl_stats_franchiseleaderswrank​

Franchise leaders w rank.

Endpoint URL: GET https://stats.nba.com/stats/franchiseleaderswrank

Valid URL: https://stats.nba.com/stats/franchiseleaderswrank?LeagueID=20&PerMode=Totals&SeasonType=Regular+Season&TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PerModeper_modeY
SeasonTypeseason_typeYSeason type, a label: Regular Season, Pre Season or Playoffs (each endpoint takes a subset; the G League has no All Star rows). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs rolls over in May.
TeamIDteam_idY

Returns​

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

col_nametypedescription
league_idString
team_idInt64
teamString
person_idInt64
playerString
season_typeString
active_with_teamInt64Flag indicating whether the franchise leader is still active with the team.
gpInt64
minutesFloat64
fgmFloat64
fgaFloat64
fg_pctFloat64
fg3_mFloat64Three-point field goals made.
fg3_aFloat64Three-point field goal attempts.
fg3_pctFloat64
ftmFloat64
ftaFloat64
ft_pctFloat64
orebFloat64
drebFloat64
rebFloat64
astFloat64
pfFloat64
stlFloat64
tovFloat64
blkFloat64
ptsFloat64
f_rank_gpInt64Franchise all-time rank of the player's career games played.
f_rank_minutesInt64Franchise all-time rank of the player's career minutes played.
f_rank_fgmInt64Franchise all-time rank of the player's career field goals made.
f_rank_fgaInt64Franchise all-time rank of the player's career field goals attempted.
f_rank_fg_pctInt64Franchise all-time rank of the player's career field goal percentage.
f_rank_fg3_mInt64Franchise all-time rank of the player's career three-point field goals made.
f_rank_fg3_aInt64Franchise all-time rank of the player's career three-point field goals attempted.
f_rank_fg3_pctInt64Franchise all-time rank of the player's career three-point field goal percentage.
f_rank_ftmInt64Franchise all-time rank of the player's career free throws made.
f_rank_ftaInt64Franchise all-time rank of the player's career free throws attempted.
f_rank_ft_pctInt64Franchise all-time rank of the player's career free throw percentage.
f_rank_orebInt64Franchise all-time rank of the player's career offensive rebounds.
f_rank_drebInt64Franchise all-time rank of the player's career defensive rebounds.
f_rank_rebInt64Franchise all-time rank of the player's career total rebounds.
f_rank_astInt64Franchise all-time rank of the player's career assists.
f_rank_pfInt64Franchise all-time rank of the player's career personal fouls committed.
f_rank_stlInt64Franchise all-time rank of the player's career steals.
f_rank_tovInt64Franchise all-time rank of the player's career turnovers.
f_rank_blkInt64Franchise all-time rank of the player's career blocked shots.
f_rank_ptsInt64Franchise all-time rank of the player's career points scored.

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
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.
ImportErrorcurl_cffi is not installed -- stats.nba.com / stats.wnba.com block plain requests, so the transport needs it (pip install curl_cffi or sportsdataverse[all]).

Example​

nbagl_stats_franchiseleaderswrank(league_id='20')

nbagl_stats_franchiseplayers​

Franchise players.

Endpoint URL: GET https://stats.nba.com/stats/franchiseplayers

Valid URL: https://stats.nba.com/stats/franchiseplayers?LeagueID=20&PerMode=Totals&SeasonType=Regular+Season&TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PerModeper_mode_detailedY
SeasonTypeseason_type_all_starYSeason type, a label: Regular Season, Pre Season or Playoffs (each endpoint takes a subset; the G League has no All Star rows). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs rolls over in May.
TeamIDteam_idY

Returns​

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

col_nametypedescription
league_idString
team_idInt64
teamString
person_idInt64
playerString
season_typeString
active_with_teamInt64Flag indicating whether the player is still active with the franchise.
gpInt64
fgmFloat64
fgaFloat64
fg_pctFloat64
fg3_mFloat64Three-point field goals made.
fg3_aFloat64Three-point field goal attempts.
fg3_pctFloat64
ftmFloat64
ftaFloat64
ft_pctFloat64
orebFloat64
drebFloat64
rebFloat64
astFloat64
pfFloat64
stlFloat64
tovFloat64
blkFloat64
ptsFloat64

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
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.
ImportErrorcurl_cffi is not installed -- stats.nba.com / stats.wnba.com block plain requests, so the transport needs it (pip install curl_cffi or sportsdataverse[all]).

Example​

nbagl_stats_franchiseplayers(league_id='20')