Skip to main content

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

nbagl_stats_teamdetails​

Team details.

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

Valid URL: https://stats.nba.com/stats/teamdetails?TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
TeamIDteam_idY

Returns​

return_parsed=True (default) — A dict of DataFrames keyed by result-set name (TeamBackground, TeamHistory, TeamSocialSites, TeamAwardsChampionships, TeamAwardsConf, TeamAwardsDiv, TeamHof, TeamRetired, TeamAwardsCommCup) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

TeamBackground

col_nametypedescription
team_idInt64
abbreviationString
nicknameString
yearfoundedInt64Year the franchise was founded.
cityString
arenaString
arenacapacityStringSeating capacity of the team's home arena.
ownerStringName of the team's owner or ownership group.
generalmanagerStringName of the team's general manager.
headcoachStringName of the team's head coach.
dleagueaffiliationStringName of the team's G League (formerly D-League) affiliate.

TeamHistory

col_nametypedescription
team_idInt64
cityString
nicknameString
yearfoundedInt64Year the franchise was founded.
yearactivetillInt64

TeamSocialSites

col_nametypedescription
accounttypeString
website_linkString

TeamAwardsChampionships

col_nametypedescription
yearawardedInt64
oppositeteamString

TeamAwardsConf

col_nametypedescription
yearawardedInt64
oppositeteamString

TeamAwardsDiv

col_nametypedescription
yearawardedInt64
oppositeteamString

TeamHof

col_nametypedescription
playeridInt64
playerString
positionString
jerseyString
seasonswithteamString
yearInt64

TeamRetired

col_nametypedescription
playeridInt64
playerString
positionString
jerseyString
seasonswithteamString
yearInt64

TeamAwardsCommCup

col_nametypedescription
yearawardedInt64
oppositeteamString

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_teamdetails()

nbagl_stats_teamestimatedmetrics​

Team estimated metrics.

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

Valid URL: https://stats.nba.com/stats/teamestimatedmetrics?LeagueID=20&Season=2024-25&SeasonType=Regular+Season

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
SeasonseasonYSeason label, e.g. 2024-25. Defaults at call time by a calendar cutoff, the month after a season's first games, so it can lag the newest rows by a few weeks. A G League regular season starts in late December and becomes the default in January (2025-26 from January 2026); a draft combine (May) in June. With season type Playoffs (or commonplayoffseries) it rolls over in May, after the late-March playoffs start; the G League has no All-Star rows. A month table cannot follow a lockout or pandemic calendar: pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
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.

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_nameString
team_idInt64
gpInt64
wInt64
lInt64
w_pctFloat64
minFloat64
e_off_ratingFloat64Estimated offensive rating for the requested NBA or WNBA Stats split.
e_def_ratingFloat64Estimated defensive rating for the requested NBA or WNBA Stats split.
e_net_ratingFloat64Estimated net rating for the requested NBA or WNBA Stats split.
e_paceFloat64Estimated pace for the requested NBA or WNBA Stats split.
e_ast_ratioFloat64Estimated assist ratio for the requested NBA or WNBA Stats split.
e_oreb_pctFloat64Estimated offensive rebound percentage for the requested NBA or WNBA Stats split.
e_dreb_pctFloat64Estimated defensive rebound percentage for the requested NBA or WNBA Stats split.
e_reb_pctFloat64Estimated rebound percentage for the requested NBA or WNBA Stats split.
e_tm_tov_pctFloat64Estimated team turnover percentage for the requested NBA or WNBA Stats split.
gp_rankInt64Rank for games played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
w_rankInt64Rank for wins within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
l_rankInt64Rank for losses within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
w_pct_rankInt64Rank for winning percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
min_rankInt64Rank for minutes played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_off_rating_rankInt64Rank for e offensive rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_def_rating_rankInt64Rank for e defensive rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_net_rating_rankInt64Rank for e net rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_ast_ratio_rankInt64Rank for e assists ratio within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_oreb_pct_rankInt64Rank for e offensive rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_dreb_pct_rankInt64Rank for e defensive rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_reb_pct_rankInt64Rank for e rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_tm_tov_pct_rankInt64Rank for e team turnovers percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
e_pace_rankInt64Rank for e pace within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.

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_teamestimatedmetrics(league_id='20', season='2024-25')

nbagl_stats_teamgamelog​

Team game log.

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

Valid URL: https://stats.nba.com/stats/teamgamelog?DateFrom=&DateTo=&LeagueID=20&Season=2024-25&SeasonType=Regular+Season&TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
DateFromdate_from_nullableY
DateTodate_to_nullableY
LeagueIDleague_idY
SeasonseasonYSeason label, e.g. 2024-25. Defaults at call time by a calendar cutoff, the month after a season's first games, so it can lag the newest rows by a few weeks. A G League regular season starts in late December and becomes the default in January (2025-26 from January 2026); a draft combine (May) in June. With season type Playoffs (or commonplayoffseries) it rolls over in May, after the late-March playoffs start; the G League has no All-Star rows. A month table cannot follow a lockout or pandemic calendar: pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
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
team_idInt64
game_idString
game_dateString
matchupString
wlString
wInt64
lInt64
w_pctFloat64
minInt64
fgmInt64
fgaInt64
fg_pctFloat64
fg3_mInt64Three-point field goals made.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64
ftmInt64
ftaInt64
ft_pctFloat64
orebInt64
drebInt64
rebInt64
astInt64
stlInt64
blkInt64
tovInt64
pfInt64
ptsInt64

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_teamgamelog(league_id='20', season='2024-25')

nbagl_stats_teamgamelogs​

Team game logs.

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

Valid URL: https://stats.nba.com/stats/teamgamelogs?DateFrom=&DateTo=&GameSegment=&LastNGames=0&LeagueID=20&Location=&MeasureType=Base&Month=0&OppTeamID=0&Outcome=&PORound=&PerMode=Totals&Period=0&PlayerID=&Season=2024-25&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&VsConference=&VsDivision=

API ParameterPythonPatternRequiredNullableDescription
DateFromdate_from_nullableY
DateTodate_to_nullableY
GameSegmentgame_segment_nullableY
LastNGameslast_n_games_nullableY
LeagueIDleague_idY
Locationlocation_nullableY
MeasureTypemeasure_type_player_game_logs_nullableY
Monthmonth_nullableY
OppTeamIDopp_team_id_nullableY
Outcomeoutcome_nullableY
PORoundpo_round_nullableY
PerModeper_mode_simple_nullableY
Periodperiod_nullableY
PlayerIDplayer_id_nullableY
Seasonseason_nullableYSeason label, e.g. 2024-25. Defaults at call time by a calendar cutoff, the month after a season's first games, so it can lag the newest rows by a few weeks. A G League regular season starts in late December and becomes the default in January (2025-26 from January 2026); a draft combine (May) in June. With season type Playoffs (or commonplayoffseries) it rolls over in May, after the late-March playoffs start; the G League has no All-Star rows. A month table cannot follow a lockout or pandemic calendar: pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
SeasonSegmentseason_segment_nullableY
SeasonTypeseason_type_nullableYSeason 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.
ShotClockRangeshot_clock_range_nullableY
TeamIDteam_id_nullableY
VsConferencevs_conference_nullableY
VsDivisionvs_division_nullableY

Returns​

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

col_nametypedescription
season_yearString
team_idInt64
team_abbreviationString
team_nameString
game_idString
game_dateString
matchupString
wlString
minFloat64
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
tovFloat64
stlFloat64
blkFloat64
blkaFloat64Blocked field-goal attempts against for the requested NBA or WNBA Stats split.
pfFloat64
pfdFloat64Personal fouls drawn for the requested NBA or WNBA Stats split.
ptsFloat64
plus_minusFloat64
gp_rankInt64Rank for games played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
w_rankInt64Rank for wins within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
l_rankInt64Rank for losses within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
w_pct_rankInt64Rank for winning percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
min_rankInt64Rank for minutes played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fgm_rankInt64Rank for field goals made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fga_rankInt64Rank for field goals attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fg_pct_rankInt64Rank for field-goal percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fg3_m_rankInt64Rank for three-point field goals made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fg3_a_rankInt64Rank for three-point field goals attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fg3_pct_rankInt64Rank for three-point field-goal percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
ftm_rankInt64Rank for free throws made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
fta_rankInt64Rank for free throws attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
ft_pct_rankInt64Rank for free-throw percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
oreb_rankInt64Rank for offensive rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
dreb_rankInt64Rank for defensive rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
reb_rankInt64Rank for total rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
ast_rankInt64Rank for assists within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
tov_rankInt64Rank for turnovers within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
stl_rankInt64Rank for steals within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
blk_rankInt64Rank for blocks within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
blka_rankInt64Rank for blocked field-goal attempts against within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
pf_rankInt64Rank for personal fouls within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
pfd_rankInt64Rank for personal fouls drawn within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
pts_rankInt64Rank for points within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
plus_minus_rankInt64Rank for plus-minus within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader.
available_flagInt64Flag indicating whether the requested NBA or WNBA Stats video or data asset is available.

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_teamgamelogs(league_id='20', season_nullable='2024-25')

nbagl_stats_teaminfocommon​

Team info common.

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

Valid URL: https://stats.nba.com/stats/teaminfocommon?LeagueID=20&Season=2024-25&SeasonType=Regular+Season&TeamID=1612709914

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
Seasonseason_nullableYSeason label, e.g. 2024-25. Defaults at call time by a calendar cutoff, the month after a season's first games, so it can lag the newest rows by a few weeks. A G League regular season starts in late December and becomes the default in January (2025-26 from January 2026); a draft combine (May) in June. With season type Playoffs (or commonplayoffseries) it rolls over in May, after the late-March playoffs start; the G League has no All-Star rows. A month table cannot follow a lockout or pandemic calendar: pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
SeasonTypeseason_type_nullableYSeason 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 dict of DataFrames keyed by result-set name (TeamInfoCommon, TeamSeasonRanks, AvailableSeasons) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

TeamInfoCommon

col_nametypedescription
team_idInt64
season_yearString
team_cityString
team_nameString
team_abbreviationString
team_conferenceStringConference the team belongs to.
team_divisionStringDivision the team belongs to.
team_codeStringLowercase slug of the team used in stats.nba.com URLs (e.g. 'lakers').
team_slugString
wInt64
lInt64
pctFloat64
conf_rankInt64Team's current rank within its conference.
div_rankInt64Team's current rank within its division.
min_yearString
max_yearString

TeamSeasonRanks

col_nametypedescription
league_idString
season_idString
team_idInt64
pts_rankInt64
pts_pgFloat64
reb_rankInt64
reb_pgFloat64
ast_rankInt64
ast_pgFloat64
opp_pts_rankInt64
opp_pts_pgFloat64

AvailableSeasons

col_nametypedescription
season_idString

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_teaminfocommon(league_id='20', season_nullable='2024-25')

nbagl_stats_teamvsplayer​

Team vs player.

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

Valid URL: https://stats.nba.com/stats/teamvsplayer?DateFrom=&DateTo=&GameSegment=&LastNGames=0&LeagueID=20&Location=&MeasureType=Base&Month=0&OpponentTeamID=0&Outcome=&PaceAdjust=N&PerMode=Totals&Period=0&PlayerID=&PlusMinus=N&Rank=N&Season=2024-25&SeasonSegment=&SeasonType=Regular+Season&TeamID=1612709914&VsConference=&VsDivision=&VsPlayerID=1631457

API ParameterPythonPatternRequiredNullableDescription
DateFromdate_from_nullableY
DateTodate_to_nullableY
GameSegmentgame_segment_nullableY
LastNGameslast_n_gamesY
LeagueIDleague_idY
Locationlocation_nullableY
MeasureTypemeasure_type_detailed_defenseY
MonthmonthY
OpponentTeamIDopponent_team_idY
Outcomeoutcome_nullableY
PaceAdjustpace_adjustY
PerModeper_mode_detailedY
PeriodperiodY
PlayerIDplayer_id_nullableY
PlusMinusplus_minusY
RankrankY
SeasonseasonYSeason label, e.g. 2024-25. Defaults at call time by a calendar cutoff, the month after a season's first games, so it can lag the newest rows by a few weeks. A G League regular season starts in late December and becomes the default in January (2025-26 from January 2026); a draft combine (May) in June. With season type Playoffs (or commonplayoffseries) it rolls over in May, after the late-March playoffs start; the G League has no All-Star rows. A month table cannot follow a lockout or pandemic calendar: pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
SeasonSegmentseason_segment_nullableY
SeasonTypeseason_type_playoffsYSeason 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
VsConferencevs_conference_nullableY
VsDivisionvs_division_nullableY
VsPlayerIDvs_player_idY

Returns​

return_parsed=True (default) — A dict of DataFrames keyed by result-set name (Overall, vsPlayerOverall, OnOffCourt, ShotDistanceOverall, ShotDistanceOnCourt, ShotDistanceOffCourt, ShotAreaOverall, ShotAreaOnCourt, ShotAreaOffCourt) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

Overall

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
team_idInt64
team_abbreviationString
gpInt64
wInt64
lInt64
w_pctFloat64
minFloat64
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
tovFloat64
stlFloat64
blkFloat64
blkaFloat64Shot attempts blocked by opponents (blocks against).
pfFloat64
pfdFloat64Personal fouls drawn.
ptsFloat64
plus_minusFloat64
gp_rankInt64League rank of the row's games played for the season and split.
w_rankInt64League rank of the row's wins for the season and split.
l_rankInt64League rank of the row's losses for the season and split.
w_pct_rankInt64League rank of the row's win percentage for the season and split.
min_rankInt64League rank of the row's minutes played for the season and split.
fgm_rankInt64League rank of the row's field goals made for the season and split.
fga_rankInt64League rank of the row's field goals attempted for the season and split.
fg_pct_rankInt64League rank of the row's field goal percentage for the season and split.
fg3_m_rankInt64League rank of the row's three-point field goals made for the season and split.
fg3_a_rankInt64League rank of the row's three-point field goals attempted for the season and split.
fg3_pct_rankInt64League rank of the row's three-point field goal percentage for the season and split.
ftm_rankInt64League rank of the row's free throws made for the season and split.
fta_rankInt64League rank of the row's free throws attempted for the season and split.
ft_pct_rankInt64League rank of the row's free throw percentage for the season and split.
oreb_rankInt64League rank of the row's offensive rebounds for the season and split.
dreb_rankInt64League rank of the row's defensive rebounds for the season and split.
reb_rankInt64League rank of the row's total rebounds for the season and split.
ast_rankInt64League rank of the row's assists for the season and split.
tov_rankInt64League rank of the row's turnovers for the season and split.
stl_rankInt64League rank of the row's steals for the season and split.
blk_rankInt64League rank of the row's blocked shots for the season and split.
blka_rankInt64League rank of the row's shot attempts blocked by opponents (blocks against) for the season and split.
pf_rankInt64League rank of the row's personal fouls committed for the season and split.
pfd_rankInt64League rank of the row's personal fouls drawn for the season and split.
pts_rankInt64League rank of the row's points scored for the season and split.
plus_minus_rankInt64League rank of the row's plus-minus point differential while on the floor for the season and split.

vsPlayerOverall

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
player_idInt64
gpInt64
wInt64
lInt64
w_pctFloat64
minFloat64
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
tovFloat64
stlFloat64
blkFloat64
blkaFloat64Shot attempts blocked by opponents (blocks against).
pfFloat64
pfdFloat64Personal fouls drawn.
ptsFloat64
plus_minusFloat64
nba_fantasy_ptsFloat64Fantasy points under the NBA's fantasy scoring formula.
dd2Int64Double-doubles recorded over the split.
td3Int64Triple-doubles recorded over the split.
wnba_fantasy_ptsFloat64Fantasy points under the WNBA's fantasy scoring formula.
gp_rankInt64League rank of the row's games played for the season and split.
w_rankInt64League rank of the row's wins for the season and split.
l_rankInt64League rank of the row's losses for the season and split.
w_pct_rankInt64League rank of the row's win percentage for the season and split.
min_rankInt64League rank of the row's minutes played for the season and split.
fgm_rankInt64League rank of the row's field goals made for the season and split.
fga_rankInt64League rank of the row's field goals attempted for the season and split.
fg_pct_rankInt64League rank of the row's field goal percentage for the season and split.
fg3_m_rankInt64League rank of the row's three-point field goals made for the season and split.
fg3_a_rankInt64League rank of the row's three-point field goals attempted for the season and split.
fg3_pct_rankInt64League rank of the row's three-point field goal percentage for the season and split.
ftm_rankInt64League rank of the row's free throws made for the season and split.
fta_rankInt64League rank of the row's free throws attempted for the season and split.
ft_pct_rankInt64League rank of the row's free throw percentage for the season and split.
oreb_rankInt64League rank of the row's offensive rebounds for the season and split.
dreb_rankInt64League rank of the row's defensive rebounds for the season and split.
reb_rankInt64League rank of the row's total rebounds for the season and split.
ast_rankInt64League rank of the row's assists for the season and split.
tov_rankInt64League rank of the row's turnovers for the season and split.
stl_rankInt64League rank of the row's steals for the season and split.
blk_rankInt64League rank of the row's blocked shots for the season and split.
blka_rankInt64League rank of the row's shot attempts blocked by opponents (blocks against) for the season and split.
pf_rankInt64League rank of the row's personal fouls committed for the season and split.
pfd_rankInt64League rank of the row's personal fouls drawn for the season and split.
pts_rankInt64League rank of the row's points scored for the season and split.
plus_minus_rankInt64League rank of the row's plus-minus point differential while on the floor for the season and split.
nba_fantasy_pts_rankInt64League rank of the row's NBA fantasy points (league scoring formula) for the season and split.
dd2_rankInt64League rank of the row's double-doubles for the season and split.
td3_rankInt64League rank of the row's triple-doubles for the season and split.
wnba_fantasy_pts_rankInt64League rank of the row's WNBA fantasy points (league scoring formula) for the season and split.
team_countInt64Number of distinct teams aggregated into the split row.

OnOffCourt

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
team_idString
team_abbreviationString
team_nameString
vs_player_idString
vs_player_nameString
court_statusString
gpString
wString
lString
w_pctString
minString
fgmString
fgaString
fg_pctString
fg3_mStringThree-point field goals made.
fg3_aStringThree-point field goal attempts.
fg3_pctString
ftmString
ftaString
ft_pctString
orebString
drebString
rebString
astString
tovString
stlString
blkString
blkaStringShot attempts blocked by opponents (blocks against).
pfString
pfdStringPersonal fouls drawn.
ptsString
plus_minusString
gp_rankStringLeague rank of the row's games played for the season and split.
w_rankStringLeague rank of the row's wins for the season and split.
l_rankStringLeague rank of the row's losses for the season and split.
w_pct_rankStringLeague rank of the row's win percentage for the season and split.
min_rankStringLeague rank of the row's minutes played for the season and split.
fgm_rankStringLeague rank of the row's field goals made for the season and split.
fga_rankStringLeague rank of the row's field goals attempted for the season and split.
fg_pct_rankStringLeague rank of the row's field goal percentage for the season and split.
fg3_m_rankStringLeague rank of the row's three-point field goals made for the season and split.
fg3_a_rankStringLeague rank of the row's three-point field goals attempted for the season and split.
fg3_pct_rankStringLeague rank of the row's three-point field goal percentage for the season and split.
ftm_rankStringLeague rank of the row's free throws made for the season and split.
fta_rankStringLeague rank of the row's free throws attempted for the season and split.
ft_pct_rankStringLeague rank of the row's free throw percentage for the season and split.
oreb_rankStringLeague rank of the row's offensive rebounds for the season and split.
dreb_rankStringLeague rank of the row's defensive rebounds for the season and split.
reb_rankStringLeague rank of the row's total rebounds for the season and split.
ast_rankStringLeague rank of the row's assists for the season and split.
tov_rankStringLeague rank of the row's turnovers for the season and split.
stl_rankStringLeague rank of the row's steals for the season and split.
blk_rankStringLeague rank of the row's blocked shots for the season and split.
blka_rankStringLeague rank of the row's shot attempts blocked by opponents (blocks against) for the season and split.
pf_rankStringLeague rank of the row's personal fouls committed for the season and split.
pfd_rankStringLeague rank of the row's personal fouls drawn for the season and split.
pts_rankStringLeague rank of the row's points scored for the season and split.
plus_minus_rankStringLeague rank of the row's plus-minus point differential while on the floor for the season and split.

ShotDistanceOverall

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
team_idInt64
team_abbreviationString
team_nameString
fgmFloat64
fgaFloat64
fg_pctFloat64

ShotDistanceOnCourt

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
team_idString
team_abbreviationString
team_nameString
vs_player_idString
vs_player_nameString
court_statusString
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
fgmString
fgaString
fg_pctString

ShotDistanceOffCourt

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
team_idString
team_abbreviationString
team_nameString
vs_player_idString
vs_player_nameString
court_statusString
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
fgmString
fgaString
fg_pctString

ShotAreaOverall

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
team_idInt64
team_abbreviationString
team_nameString
fgmFloat64
fgaFloat64
fg_pctFloat64

ShotAreaOnCourt

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
team_idString
team_abbreviationString
team_nameString
vs_player_idString
vs_player_nameString
court_statusString
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
fgmString
fgaString
fg_pctString

ShotAreaOffCourt

col_nametypedescription
group_setStringName of the split group the row belongs to (e.g. Overall, By Opponent, By Month).
team_idString
team_abbreviationString
team_nameString
vs_player_idString
vs_player_nameString
court_statusString
group_valueStringValue of the split within the group (e.g. a specific opponent, month, or result).
fgmString
fgaString
fg_pctString

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_teamvsplayer(league_id='20', season='2024-25')

nbagl_stats_teamyearbyyearstats​

Team year by year stats.

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

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

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PerModeper_mode_simpleY
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
team_idInt64
team_cityString
team_nameString
yearString
gpInt64
winsInt64
lossesInt64
win_pctFloat64
conf_rankInt64Team's final rank within its conference for the season.
div_rankInt64Team's final rank within its division for the season.
po_winsInt64Playoff wins recorded by the team that season.
po_lossesInt64Playoff losses recorded by the team that season.
conf_countInt64Number of teams in the team's conference that season.
div_countInt64Number of teams in the team's division that season.
nba_finals_appearanceStringWhether the team reached the league finals that season (e.g. "FINALS APPEARANCE" or "N/A").
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
pts_rankInt64League rank of the team's points scored for the season.

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_teamyearbyyearstats(league_id='20')