Skip to main content

NBA G League — G League Stats API (stats.nba.com, LeagueID=20) — Other: alltimeleadersgrids–playbyplayv2

nbagl_stats_alltimeleadersgrids​

All time leaders grids.

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

Valid URL: https://stats.nba.com/stats/alltimeleadersgrids?LeagueID=20&PerMode=PerGame&SeasonType=Regular+Season&TopX=10

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PerModeper_mode_simpleY
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.
TopXtopxY

Returns​

return_parsed=True (default) — A dict of DataFrames keyed by result-set name (GPLeaders, PTSLeaders, ASTLeaders, STLLeaders, OREBLeaders, DREBLeaders, REBLeaders, BLKLeaders, FGMLeaders, FGALeaders, FG_PCTLeaders, TOVLeaders, FG3MLeaders, FG3ALeaders, FG3_PCTLeaders, PFLeaders, FTMLeaders, FTALeaders, FT_PCTLeaders) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

GPLeaders

col_nametypedescription
player_idInt64
player_nameString
gpInt64
gp_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

PTSLeaders

col_nametypedescription
player_idInt64
player_nameString
ptsFloat64
pts_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

ASTLeaders

col_nametypedescription
player_idInt64
player_nameString
astFloat64
ast_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

STLLeaders

col_nametypedescription
player_idInt64
player_nameString
stlFloat64
stl_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

OREBLeaders

col_nametypedescription
player_idInt64
player_nameString
orebFloat64
oreb_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

DREBLeaders

col_nametypedescription
player_idInt64
player_nameString
drebFloat64
dreb_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

REBLeaders

col_nametypedescription
player_idInt64
player_nameString
rebFloat64
reb_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

BLKLeaders

col_nametypedescription
player_idInt64
player_nameString
blkFloat64
blk_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FGMLeaders

col_nametypedescription
player_idInt64
player_nameString
fgmFloat64
fgm_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FGALeaders

col_nametypedescription
player_idInt64
player_nameString
fgaFloat64
fga_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FG_PCTLeaders

col_nametypedescription
player_idInt64
player_nameString
fg_pctFloat64
fg_pct_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

TOVLeaders

col_nametypedescription
player_idInt64
player_nameString
tovFloat64
tov_rankInt64All-time league rank of the player's career turnover total on the leaders grid.
is_active_flagStringFlag indicating whether the player is currently active in the league.

FG3MLeaders

col_nametypedescription
player_idInt64
player_nameString
fg3_mFloat64Three-point field goals made.
fg3_m_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FG3ALeaders

col_nametypedescription
player_idInt64
player_nameString
fg3_aFloat64Three-point field goal attempts.
fg3_a_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FG3_PCTLeaders

col_nametypedescription
player_idInt64
player_nameString
fg3_pctFloat64
fg3_pct_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

PFLeaders

col_nametypedescription
player_idInt64
player_nameString
pfFloat64
pf_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FTMLeaders

col_nametypedescription
player_idInt64
player_nameString
ftmFloat64
ftm_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FTALeaders

col_nametypedescription
player_idInt64
player_nameString
ftaFloat64
fta_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

FT_PCTLeaders

col_nametypedescription
player_idInt64
player_nameString
ft_pctFloat64
ft_pct_rankInt64
is_active_flagStringFlag indicating whether the player is currently active in the league.

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

nbagl_stats_assistleaders​

Assist leaders.

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

Valid URL: https://stats.nba.com/stats/assistleaders?LeagueID=20&PerMode=PerGame&PlayerOrTeam=Team&Season=2024-25&SeasonType=Regular+Season

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PerModeper_mode_simpleY
PlayerOrTeamplayer_or_teamY
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_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.

Returns​

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

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
astFloat64

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

nbagl_stats_assisttracker​

Assist tracker.

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

Valid URL: https://stats.nba.com/stats/assisttracker?LeagueID=20&OpponentTeamID=0&PerMode=PerGame&Season=2024-25&SeasonType=Regular+Season&TeamID=0

API ParameterPythonPatternRequiredNullableDescription
Collegecollege_nullableY
Conferenceconference_nullableY
Countrycountry_nullableY
DateFromdate_from_nullableY
DateTodate_to_nullableY
Divisiondivision_simple_nullableY
DraftPickdraft_pick_nullableY
DraftYeardraft_year_nullableY
GameScopegame_scope_simple_nullableY
Heightheight_nullableY
LastNGameslast_n_games_nullableY
LeagueIDleague_idY
Locationlocation_nullableY
Monthmonth_nullableY
OpponentTeamIDopponent_team_id_nullableY
Outcomeoutcome_nullableY
PORoundpo_round_nullableY
PerModeper_mode_simple_nullableY
PlayerExperienceplayer_experience_nullableY
PlayerPositionplayer_position_abbreviation_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_all_star_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.
StarterBenchstarter_bench_nullableY
TeamIDteam_id_nullableY
VsConferencevs_conference_nullableY
VsDivisionvs_division_nullableY
Weightweight_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
assistsFloat64

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

nbagl_stats_cumestatsteam​

Cume stats team.

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

Valid URL: https://stats.nba.com/stats/cumestatsteam?GameIDs=2022500137&LeagueID=20&Season=2024-25&SeasonType=Regular+Season&TeamID=1612709925

API ParameterPythonPatternRequiredNullableDescription
GameIDsgame_idsY
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 dict of DataFrames keyed by result-set name (GameByGameStats, TotalTeamStats, GLeagueFreeThrows) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

GameByGameStats

col_nametypedescription
jersey_numString
playerString
person_idString
team_idString
gpString
gsString
actual_minutesStringWhole minutes of actual playing time accumulated over the aggregated games.
actual_secondsStringLeftover seconds of actual playing time beyond the whole minutes.
fgStringField goals made over the aggregated games.
fgaString
fg_pctString
fg3StringThree-point field goals made over the aggregated games.
fg3_aStringThree-point field goal attempts.
fg3_pctString
ftStringFree throws made over the aggregated games.
ftaString
ft_pctString
off_rebStringOffensive rebounds over the aggregated games.
def_rebStringDefensive rebounds over the aggregated games.
tot_rebStringTotal rebounds over the aggregated games.
astString
pfString
dqStringDisqualifications (fouled out) over the aggregated games.
stlString
turnoversString
blkString
ptsString
max_actual_minutesStringMost whole minutes played in any single aggregated game.
max_actual_secondsStringSeconds component paired with the single-game maximum minutes.
max_rebStringMost rebounds recorded in any single aggregated game.
max_astStringMost assists recorded in any single aggregated game.
max_stlStringMost steals recorded in any single aggregated game.
max_turnoversStringMost turnovers recorded in any single aggregated game.
max_blkpStringMost blocked shots recorded in any single aggregated game.
max_ptsStringMost points recorded in any single aggregated game.
avg_actual_minutesStringAverage whole minutes played per aggregated game.
avg_actual_secondsStringAverage seconds component of playing time per aggregated game.
avg_rebStringAverage rebounds per game over the aggregated games.
avg_astStringAverage assists per game over the aggregated games.
avg_stlStringAverage steals per game over the aggregated games.
avg_turnoversStringAverage turnovers per game over the aggregated games.
avg_blkpStringAverage blocked shots per game over the aggregated games.
avg_ptsStringAverage points per game over the aggregated games.
per_min_rebStringRebounds per minute played over the aggregated games.
per_min_astStringAssists per minute played over the aggregated games.
per_min_stlStringSteals per minute played over the aggregated games.
per_min_turnoversStringTurnovers per minute played over the aggregated games.
per_min_blkStringBlocked shots per minute played over the aggregated games.
per_min_ptsStringPoints per minute played over the aggregated games.

TotalTeamStats

col_nametypedescription
cityString
nicknameString
team_idInt64
wInt64
lInt64
w_homeInt64
l_homeInt64
w_roadInt64
l_roadInt64
team_turnoversInt64
team_reboundsInt64Team rebounds (rebounds credited to the team rather than a player).
gpInt64
gsInt64
actual_minutesInt64Whole minutes of actual playing time accumulated over the aggregated games.
actual_secondsInt64Leftover seconds of actual playing time beyond the whole minutes.
fgInt64Field goals made over the aggregated games.
fgaInt64
fg_pctFloat64
fg3Int64Three-point field goals made over the aggregated games.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64
ftInt64Free throws made over the aggregated games.
ftaInt64
ft_pctFloat64
off_rebInt64Offensive rebounds over the aggregated games.
def_rebInt64Defensive rebounds over the aggregated games.
tot_rebInt64Total rebounds over the aggregated games.
astInt64
pfInt64
stlInt64
total_turnoversInt64
blkInt64
ptsInt64
avg_rebFloat64Average rebounds per game over the aggregated games.
avg_ptsFloat64Average points per game over the aggregated games.
dqInt64Disqualifications (fouled out) over the aggregated games.

GLeagueFreeThrows

col_nametypedescription
cityString
nicknameString
team_idInt64
ftInt64Free throws made over the aggregated games.
ftaInt64
ft_pctFloat64
ft_1_ptFloat64
fta_1_ptFloat64
ft_pct_1_ptFloat64
ft_2_ptFloat64
fta_2_ptFloat64
ft_pct_2_ptFloat64
ft_3_ptFloat64
fta_3_ptFloat64
ft_pct_3_ptFloat64

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

nbagl_stats_draftcombinestats​

Draft combine stats.

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

Valid URL: https://stats.nba.com/stats/draftcombinestats?LeagueID=20&SeasonYear=2024-25

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
SeasonYearseason_all_timeYSeason 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.

Returns​

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

col_nametypedescription
seasonString
player_idInt64
first_nameString
last_nameString
player_nameString
positionString
height_wo_shoesFloat64Height measured without shoes, in inches.
height_wo_shoes_ft_inStringHeight without shoes formatted as feet and inches.
height_w_shoesStringHeight measured with shoes, in inches.
height_w_shoes_ft_inStringHeight with shoes formatted as feet and inches.
weightString
wingspanFloat64Wingspan measured at the combine, in inches.
wingspan_ft_inStringWingspan formatted as feet and inches.
standing_reachFloat64Standing reach measured at the combine, in inches.
standing_reach_ft_inStringStanding reach formatted as feet and inches.
body_fat_pctStringBody fat percentage measured at the combine.
hand_lengthFloat64Hand length measured at the combine, in inches.
hand_widthFloat64Hand width measured at the combine, in inches.
standing_vertical_leapFloat64Standing (no-step) vertical leap, in inches.
max_vertical_leapFloat64Maximum (running) vertical leap, in inches.
lane_agility_timeFloat64Lane agility drill time, in seconds.
modified_lane_agility_timeFloat64Modified (shuttle) lane agility drill time, in seconds.
three_quarter_sprintFloat64Three-quarter-court sprint time, in seconds.
bench_pressStringRepetitions of 185 pounds completed on the bench press.
spot_fifteen_corner_leftStringMade-attempted result (e.g. "3-5") from the 15-foot left corner spot-up shooting station at the combine.
spot_fifteen_break_leftStringMade-attempted result (e.g. "3-5") from the 15-foot left wing (break) spot-up shooting station at the combine.
spot_fifteen_top_keyStringMade-attempted result (e.g. "3-5") from the 15-foot top of the key spot-up shooting station at the combine.
spot_fifteen_break_rightStringMade-attempted result (e.g. "3-5") from the 15-foot right wing (break) spot-up shooting station at the combine.
spot_fifteen_corner_rightStringMade-attempted result (e.g. "3-5") from the 15-foot right corner spot-up shooting station at the combine.
spot_college_corner_leftStringMade-attempted result (e.g. "3-5") from the college three-point left corner spot-up shooting station at the combine.
spot_college_break_leftStringMade-attempted result (e.g. "3-5") from the college three-point left wing (break) spot-up shooting station at the combine.
spot_college_top_keyStringMade-attempted result (e.g. "3-5") from the college three-point top of the key spot-up shooting station at the combine.
spot_college_break_rightStringMade-attempted result (e.g. "3-5") from the college three-point right wing (break) spot-up shooting station at the combine.
spot_college_corner_rightStringMade-attempted result (e.g. "3-5") from the college three-point right corner spot-up shooting station at the combine.
spot_nba_corner_leftStringMade-attempted result (e.g. "3-5") from the NBA three-point left corner spot-up shooting station at the combine.
spot_nba_break_leftStringMade-attempted result (e.g. "3-5") from the NBA three-point left wing (break) spot-up shooting station at the combine.
spot_nba_top_keyStringMade-attempted result (e.g. "3-5") from the NBA three-point top of the key spot-up shooting station at the combine.
spot_nba_break_rightStringMade-attempted result (e.g. "3-5") from the NBA three-point right wing (break) spot-up shooting station at the combine.
spot_nba_corner_rightStringMade-attempted result (e.g. "3-5") from the NBA three-point right corner spot-up shooting station at the combine.
off_drib_fifteen_break_leftStringMade-attempted result from the 15-foot left wing (break) off-the-dribble shooting station at the combine.
off_drib_fifteen_top_keyStringMade-attempted result from the 15-foot top of the key off-the-dribble shooting station at the combine.
off_drib_fifteen_break_rightStringMade-attempted result from the 15-foot right wing (break) off-the-dribble shooting station at the combine.
off_drib_college_break_leftStringMade-attempted result from the college three-point left wing (break) off-the-dribble shooting station at the combine.
off_drib_college_top_keyStringMade-attempted result from the college three-point top of the key off-the-dribble shooting station at the combine.
off_drib_college_break_rightStringMade-attempted result from the college three-point right wing (break) off-the-dribble shooting station at the combine.
on_move_fifteenStringMade-attempted result from the 15-foot shooting-on-the-move station at the combine.
on_move_collegeStringMade-attempted result from the college three-point shooting-on-the-move station at the combine.

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

nbagl_stats_fantasywidget​

Fantasy widget.

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

Valid URL: https://stats.nba.com/stats/fantasywidget?ActivePlayers=N&DateFrom=&DateTo=&LastNGames=0&LeagueID=20&Location=&Month=&OpponentTeamID=0&PORound=&PlayerID=&Position=&Season=2024-25&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&TodaysOpponent=0&TodaysPlayers=N&VsConference=&VsDivision=

API ParameterPythonPatternRequiredNullableDescription
ActivePlayersactive_playersY
DateFromdate_from_nullableY
DateTodate_to_nullableY
LastNGameslast_n_gamesY
LeagueIDleague_idY
Locationlocation_nullableY
Monthmonth_nullableY
OpponentTeamIDopponent_team_id_nullableY
PORoundpo_round_nullableY
PlayerIDplayer_id_nullableY
Positionposition_nullableY
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_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_id_nullableY
TodaysOpponenttodays_opponentY
TodaysPlayerstodays_playersY
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
player_idInt64
player_nameString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
team_idInt64
team_abbreviationString
gpInt64
minFloat64
fan_duel_ptsFloat64Fantasy points under FanDuel's scoring formula.
nba_fantasy_ptsFloat64Fantasy points under the NBA's fantasy scoring formula.
ptsFloat64
rebFloat64
astFloat64
blkFloat64
stlFloat64
tovFloat64
fg3_mFloat64Three-point field goals made.
fgaFloat64
fg_pctFloat64
ftaFloat64
ft_pctFloat64

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

nbagl_stats_gamerotation​

Game rotation.

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

Valid URL: https://stats.nba.com/stats/gamerotation?GameID=2022500137&LeagueID=20

API ParameterPythonPatternRequiredNullableDescription
GameIDgame_idY
LeagueIDleague_idY

Returns​

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

AwayTeam

col_nametypedescription
game_idString
team_idInt64
team_cityString
team_nameString
person_idInt64
player_firstStringNBA or WNBA Stats value for player first in the gamerotation result set.
player_lastStringNBA or WNBA Stats value for player last in the gamerotation result set.
in_time_realFloat64Real-time clock value when the player entered the game rotation stint.
out_time_realFloat64Real-time clock value when the player exited the game rotation stint.
player_ptsInt64Scoring or score-margin metric for player points in the requested NBA or WNBA Stats split.
pt_diffFloat64NBA or WNBA Stats value for pt diff in the gamerotation result set.
usg_pctFloat64Percentage or rate for usage percentage in the requested NBA or WNBA Stats split.

HomeTeam

col_nametypedescription
game_idString
team_idInt64
team_cityString
team_nameString
person_idInt64
player_firstStringNBA or WNBA Stats value for player first in the gamerotation result set.
player_lastStringNBA or WNBA Stats value for player last in the gamerotation result set.
in_time_realFloat64Real-time clock value when the player entered the game rotation stint.
out_time_realFloat64Real-time clock value when the player exited the game rotation stint.
player_ptsInt64Scoring or score-margin metric for player points in the requested NBA or WNBA Stats split.
pt_diffFloat64NBA or WNBA Stats value for pt diff in the gamerotation result set.
usg_pctFloat64Percentage or rate for usage percentage in the requested NBA or WNBA Stats split.

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

nbagl_stats_homepagev2​

Homepage v2.

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

Valid URL: https://stats.nba.com/stats/homepagev2?GameScope=Season&LeagueID=20&PlayerOrTeam=Team&PlayerScope=All+Players&Season=2024-25&SeasonType=Regular+Season&StatType=Traditional

API ParameterPythonPatternRequiredNullableDescription
GameScopegame_scope_detailedY
LeagueIDleague_idY
PlayerOrTeamplayer_or_teamY
PlayerScopeplayer_scopeY
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_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.
StatTypestat_typeY

Returns​

return_parsed=True (default) — A dict of DataFrames keyed by result-set name (HomePageStat1, HomePageStat2, HomePageStat3, HomePageStat4, HomePageStat5, HomePageStat6, HomePageStat7, HomePageStat8) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

HomePageStat1

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
ptsFloat64

HomePageStat2

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
rebFloat64

HomePageStat3

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
astFloat64

HomePageStat4

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
stlFloat64

HomePageStat5

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
fg_pctFloat64

HomePageStat6

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
ft_pctFloat64

HomePageStat7

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
fg3_pctFloat64

HomePageStat8

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
blkFloat64

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

nbagl_stats_hustlestatsboxscore​

Hustle stats box score.

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

Valid URL: https://stats.nba.com/stats/hustlestatsboxscore?GameID=2022500137

API ParameterPythonPatternRequiredNullableDescription
GameIDgame_idY

Returns​

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

HustleStatsAvailable

col_nametypedescription
game_idString
hustle_statusInt64

PlayerStats

col_nametypedescription
game_idString
team_idString
team_abbreviationString
team_cityString
player_idString
player_nameString
start_positionStringPosition the player started the game at (F, C, or G); empty for reserves.
commentString
minutesInt64
ptsInt64
contested_shotsInt64
contested_shots_2_ptInt64Opponent two-point attempts contested.
contested_shots_3_ptInt64Opponent three-point attempts contested.
deflectionsInt64
charges_drawnInt64
screen_assistsInt64
screen_ast_ptsInt64Points teammates scored directly off the row's screen assists.
off_loose_balls_recoveredInt64Loose balls recovered while on offense.
def_loose_balls_recoveredInt64Loose balls recovered while on defense.
loose_balls_recoveredInt64Total loose balls recovered.
off_boxoutsInt64Box-outs recorded on the offensive glass.
def_boxoutsInt64Box-outs recorded on the defensive glass.
box_out_player_team_rebsInt64Team rebounds secured following the row's box-outs.
box_out_player_rebsInt64Rebounds the player secured directly off their own box-outs.
box_outsInt64

TeamStats

col_nametypedescription
game_idString
team_idString
team_nameString
team_abbreviationString
team_cityString
minutesInt64
ptsInt64
contested_shotsInt64
contested_shots_2_ptInt64Opponent two-point attempts contested.
contested_shots_3_ptInt64Opponent three-point attempts contested.
deflectionsInt64
charges_drawnInt64
screen_assistsInt64
screen_ast_ptsInt64Points teammates scored directly off the row's screen assists.
off_loose_balls_recoveredInt64Loose balls recovered while on offense.
def_loose_balls_recoveredInt64Loose balls recovered while on defense.
loose_balls_recoveredInt64Total loose balls recovered.
off_boxoutsInt64Box-outs recorded on the offensive glass.
def_boxoutsInt64Box-outs recorded on the defensive glass.
box_out_player_team_rebsInt64Team rebounds secured following the row's box-outs.
box_out_player_rebsInt64Rebounds the player secured directly off their own box-outs.
box_outsInt64

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

nbagl_stats_infographicfanduelplayer​

Infographic fanduel player.

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

Valid URL: https://stats.nba.com/stats/infographicfanduelplayer?GameID=2022500137

API ParameterPythonPatternRequiredNullableDescription
GameIDgame_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
player_idInt64
player_nameString
team_idInt64
team_nameString
team_abbreviationString
jersey_numString
player_positionStringPlayer's position abbreviation as stats.nba.com lists it (e.g. 'G', 'F-G', 'C').
locationString
fan_duel_ptsFloat64Scoring or score-margin metric for fan duel points in the requested NBA or WNBA Stats split.
nba_fantasy_ptsFloat64Nba fantasy points for the requested NBA or WNBA Stats split.
usg_pctFloat64Percentage or rate for usage percentage in the requested NBA or WNBA Stats split.
minFloat64
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
tovInt64
stlInt64
blkInt64
blkaInt64Blocked field-goal attempts against for the requested NBA or WNBA Stats split.
pfInt64
pfdInt64Personal fouls drawn for the requested NBA or WNBA Stats split.
ptsInt64
plus_minusInt64

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

nbagl_stats_leaderstiles​

Leaders tiles.

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

Valid URL: https://stats.nba.com/stats/leaderstiles?GameScope=Season&LeagueID=20&PlayerOrTeam=Team&PlayerScope=All+Players&Season=2024-25&SeasonType=Regular+Season&Stat=PTS

API ParameterPythonPatternRequiredNullableDescription
GameScopegame_scope_detailedY
LeagueIDleague_idY
PlayerOrTeamplayer_or_teamY
PlayerScopeplayer_scopeY
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_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.
StatstatY

Returns​

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

LeadersTiles

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
ptsFloat64

AllTimeSeasonHigh

col_nametypedescription
player_idInt64
player_nameString
ptsFloat64
season_yearString
team_idInt64
team_abbreviationString
team_nameString

LastSeasonHigh

col_nametypedescription
rankInt64Rank of the row within the returned leaderboard (1 = best) for the stat the endpoint sorts by.
player_idInt64
playerString
team_idInt64
team_abbreviationString
team_nameString
ptsFloat64

LowSeasonHigh

col_nametypedescription
player_idInt64
player_nameString
ptsFloat64
season_yearString
team_idInt64
team_abbreviationString
team_nameString

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

nbagl_stats_playbyplayv2​

Play by play v2.

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

Valid URL: https://stats.nba.com/stats/playbyplayv2?EndPeriod=0&GameID=2022500137&StartPeriod=0

API ParameterPythonPatternRequiredNullableDescription
EndPeriodend_periodY
GameIDgame_idY
StartPeriodstart_periodY

Returns​

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

PlayByPlay

col_nametypedescription
game_idString
eventnumInt64Sequential event number within the game's play-by-play feed.
eventmsgtypeInt64Numeric event type code (1 = made shot, 2 = missed shot, 3 = free throw, 4 = rebound, 5 = turnover, 6 = foul, ...).
eventmsgactiontypeInt64Numeric sub-type code refining eventmsgtype (e.g. the specific shot, foul, or turnover variety).
periodInt64
wctimestringStringWall-clock time of day when the event occurred.
pctimestringStringGame clock remaining in the period when the event occurred (MM:SS).
homedescriptionStringText description of the event from the home team's perspective; empty when not a home-team action.
neutraldescriptionStringNeutral text description of the event (e.g. period start/end); empty for team actions.
visitordescriptionStringText description of the event from the visiting team's perspective; empty when not a visitor action.
scoreString
scoremarginStringScore margin after the event ('TIE' when tied); empty on non-scoring events.
person1_typeInt64
player1_idInt64
player1_nameString
player1_team_idInt64
player1_team_cityString
player1_team_nicknameString
player1_team_abbreviationString
person2_typeInt64
player2_idInt64
player2_nameString
player2_team_idInt64
player2_team_cityString
player2_team_nicknameString
player2_team_abbreviationString
person3_typeInt64
player3_idInt64
player3_nameString
player3_team_idInt64
player3_team_cityString
player3_team_nicknameString
player3_team_abbreviationString
video_available_flagInt64

AvailableVideo

col_nametypedescription
video_available_flagInt64

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