Skip to main content

NBA — NBA Stats API (stats.nba.com) — Cumulative stats

nba_stats_cumestatsplayer​

Cume stats player.

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

Valid URL: https://stats.nba.com/stats/cumestatsplayer?GameIDs=0022000756&LeagueID=00&PlayerID=1629611&Season=2020-21&SeasonType=Regular+Season

API ParameterPythonPatternRequiredNullableDescription
GameIDsgame_idsY
LeagueIDleague_idY
PlayerIDplayer_idY
SeasonseasonYSeason year (e.g. 2024).
SeasonTypeseason_type_all_starYSeason type, a label: Regular Season, Pre Season, Playoffs, PlayIn or All Star (each endpoint takes a subset). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs / PlayIn roll over in May (NBA, G League), All Star in March (NBA).

Returns​

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

GameByGameStats

col_nametypedescription
date_estString
visitor_teamString
home_teamStringHome team name.
gpInt64Games played.
gsInt64Games started.
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.
fgaInt64Field goal attempts.
fg_pctFloat64Field goal percentage (0-1).
fg3Int64Three-point field goals made over the aggregated games.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64Three-point field goal percentage (0-1).
ftInt64Free throws made over the aggregated games.
ftaInt64Free throw attempts.
ft_pctFloat64Free throw percentage (0-1).
off_rebInt64Offensive rebounds over the aggregated games.
def_rebInt64Defensive rebounds over the aggregated games.
tot_rebInt64Total rebounds over the aggregated games.
avg_tot_rebFloat64Average total rebounds per game over the aggregated games.
astInt64Assists.
pfInt64Personal fouls.
dqInt64Disqualifications (fouled out) over the aggregated games.
stlInt64Steals.
turnoversInt64Total turnovers.
blkInt64Blocks.
ptsInt64Points scored.
avg_ptsFloat64Average points per game over the aggregated games.

TotalPlayerStats

col_nametypedescription
display_fi_lastStringAbbreviated player name (first initial and last name).
person_idInt64Unique player identifier (V3 endpoints).
jersey_numStringJersey number worn by the player.
gpInt64Games played.
gsInt64Games started.
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.
fgaInt64Field goal attempts.
fg_pctFloat64Field goal percentage (0-1).
fg3Int64Three-point field goals made over the aggregated games.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64Three-point field goal percentage (0-1).
ftInt64Free throws made over the aggregated games.
ftaInt64Free throw attempts.
ft_pctFloat64Free throw percentage (0-1).
off_rebInt64Offensive rebounds over the aggregated games.
def_rebInt64Defensive rebounds over the aggregated games.
tot_rebInt64Total rebounds over the aggregated games.
astInt64Assists.
pfInt64Personal fouls.
dqInt64Disqualifications (fouled out) over the aggregated games.
stlInt64Steals.
turnoversInt64Total turnovers.
blkInt64Blocks.
ptsInt64Points scored.
max_actual_minutesInt64Most whole minutes played in any single aggregated game.
max_actual_secondsInt64Seconds component paired with the single-game maximum minutes.
max_rebInt64Most rebounds recorded in any single aggregated game.
max_astInt64Most assists recorded in any single aggregated game.
max_stlInt64Most steals recorded in any single aggregated game.
max_turnoversInt64Most turnovers recorded in any single aggregated game.
max_blkInt64Most blocked shots recorded in any single aggregated game.
max_ptsInt64Most points recorded in any single aggregated game.
avg_actual_minutesInt64Average whole minutes played per aggregated game.
avg_actual_secondsFloat64Average seconds component of playing time per aggregated game.
avg_tot_rebFloat64Average total rebounds per game over the aggregated games.
avg_astFloat64Average assists per game over the aggregated games.
avg_stlFloat64Average steals per game over the aggregated games.
avg_turnoversFloat64Average turnovers per game over the aggregated games.
avg_blkFloat64Average blocked shots per game over the aggregated games.
avg_ptsFloat64Average points per game over the aggregated games.
per_min_tot_rebFloat64Total rebounds per minute played over the aggregated games.
per_min_astFloat64Assists per minute played over the aggregated games.
per_min_stlFloat64Steals per minute played over the aggregated games.
per_min_turnoversFloat64Turnovers per minute played over the aggregated games.
per_min_blkFloat64Blocked shots per minute played over the aggregated games.
per_min_ptsFloat64Points per minute played over the aggregated games.

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​

nba_stats_cumestatsplayer(league_id='00')

nba_stats_cumestatsplayergames​

Cume stats player games.

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

Valid URL: https://stats.nba.com/stats/cumestatsplayergames?LeagueID=00&Location=&Outcome=&PlayerID=2544&Season=2024-25&SeasonType=Regular+Season&VsConference=&VsDivision=&VsTeamID=0

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
Locationlocation_nullableY
Outcomeoutcome_nullableY
PlayerIDplayer_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. An NBA season tips off in late October and becomes the default in November (2025-26 through October 2026, 2026-27 from November 2026); a G League season (regular season from late December) in January; a Summer League (played in July, which stats.nba.com labels 2026-27 in 2026) in August; a draft combine (May) in June; a draft (drafthistory, a year; late June) in July. With season type Playoffs / PlayIn (or commonplayoffseries) the NBA and the G League roll over in May, after their playoffs start; with All Star the NBA rolls over in March, after the February game (the G League has no All-Star rows and keeps its own rule). A month table cannot follow a lockout or pandemic calendar (1998-99, 2011-12, 2020-21): 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, Playoffs, PlayIn or All Star (each endpoint takes a subset). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs / PlayIn roll over in May (NBA, G League), All Star in March (NBA).
VsConferencevs_conference_nullableY
VsDivisionvs_division_nullableY
VsTeamIDvs_team_id_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
matchupStringMatchup.
game_idStringUnique game identifier.

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​

nba_stats_cumestatsplayergames(league_id='00', season='2024-25')

nba_stats_cumestatsteam​

Cume stats team.

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

Valid URL: https://stats.nba.com/stats/cumestatsteam?GameIDs=0022201094&LeagueID=00&Season=2024-25&SeasonType=Regular+Season&TeamID=1610612739

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. An NBA season tips off in late October and becomes the default in November (2025-26 through October 2026, 2026-27 from November 2026); a G League season (regular season from late December) in January; a Summer League (played in July, which stats.nba.com labels 2026-27 in 2026) in August; a draft combine (May) in June; a draft (drafthistory, a year; late June) in July. With season type Playoffs / PlayIn (or commonplayoffseries) the NBA and the G League roll over in May, after their playoffs start; with All Star the NBA rolls over in March, after the February game (the G League has no All-Star rows and keeps its own rule). A month table cannot follow a lockout or pandemic calendar (1998-99, 2011-12, 2020-21): 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, Playoffs, PlayIn or All Star (each endpoint takes a subset). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs / PlayIn roll over in May (NBA, G League), All Star in March (NBA).
TeamIDteam_idY

Returns​

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

GameByGameStats

col_nametypedescription
jersey_numStringJersey number worn by the player.
playerStringPlayer name.
person_idStringUnique player identifier (V3 endpoints).
team_idStringUnique team identifier.
gpStringGames played.
gsStringGames started.
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.
fgaStringField goal attempts.
fg_pctStringField goal percentage (0-1).
fg3StringThree-point field goals made over the aggregated games.
fg3_aStringThree-point field goal attempts.
fg3_pctStringThree-point field goal percentage (0-1).
ftStringFree throws made over the aggregated games.
ftaStringFree throw attempts.
ft_pctStringFree throw percentage (0-1).
off_rebStringOffensive rebounds over the aggregated games.
def_rebStringDefensive rebounds over the aggregated games.
tot_rebStringTotal rebounds over the aggregated games.
astStringAssists.
pfStringPersonal fouls.
dqStringDisqualifications (fouled out) over the aggregated games.
stlStringSteals.
turnoversStringTotal turnovers.
blkStringBlocks.
ptsStringPoints scored.
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
cityStringVenue city.
nicknameStringTeam or athlete nickname.
team_idInt64Unique team identifier.
wInt64Wins.
lInt64Losses.
w_homeInt64
l_homeInt64
w_roadInt64
l_roadInt64
team_turnoversInt64Team turnovers (turnovers credited to the team rather than a player).
team_reboundsInt64Team rebounds (rebounds credited to the team rather than a player).
gpInt64Games played.
gsInt64Games started.
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.
fgaInt64Field goal attempts.
fg_pctFloat64Field goal percentage (0-1).
fg3Int64Three-point field goals made over the aggregated games.
fg3_aInt64Three-point field goal attempts.
fg3_pctFloat64Three-point field goal percentage (0-1).
ftInt64Free throws made over the aggregated games.
ftaInt64Free throw attempts.
ft_pctFloat64Free throw percentage (0-1).
off_rebInt64Offensive rebounds over the aggregated games.
def_rebInt64Defensive rebounds over the aggregated games.
tot_rebInt64Total rebounds over the aggregated games.
astInt64Assists.
pfInt64Personal fouls.
stlInt64Steals.
total_turnoversInt64Total turnovers (player + team).
blkInt64Blocks.
ptsInt64Points scored.
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.

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​

nba_stats_cumestatsteam(league_id='00', season='2024-25')

nba_stats_cumestatsteamgames​

Cume stats team games.

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

Valid URL: https://stats.nba.com/stats/cumestatsteamgames?LeagueID=00&Location=&Outcome=&Season=2024-25&SeasonID=&SeasonType=Regular+Season&TeamID=1610612739&VsConference=&VsDivision=&VsTeamID=0

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
Locationlocation_nullableY
Outcomeoutcome_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. An NBA season tips off in late October and becomes the default in November (2025-26 through October 2026, 2026-27 from November 2026); a G League season (regular season from late December) in January; a Summer League (played in July, which stats.nba.com labels 2026-27 in 2026) in August; a draft combine (May) in June; a draft (drafthistory, a year; late June) in July. With season type Playoffs / PlayIn (or commonplayoffseries) the NBA and the G League roll over in May, after their playoffs start; with All Star the NBA rolls over in March, after the February game (the G League has no All-Star rows and keeps its own rule). A month table cannot follow a lockout or pandemic calendar (1998-99, 2011-12, 2020-21): pass a season then. Without one stats.nba.com answers an empty HTTP 500 or every season summed.
SeasonIDseason_id_nullableY
SeasonTypeseason_type_all_starYSeason type, a label: Regular Season, Pre Season, Playoffs, PlayIn or All Star (each endpoint takes a subset). Not ESPN's numeric code: 3 is HTTP 400. A default season follows it: Playoffs / PlayIn roll over in May (NBA, G League), All Star in March (NBA).
TeamIDteam_idY
VsConferencevs_conference_nullableY
VsDivisionvs_division_nullableY
VsTeamIDvs_team_id_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
matchupStringMatchup.
game_idStringUnique game identifier.

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​

nba_stats_cumestatsteamgames(league_id='00', season='2024-25')