Skip to main content

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

nba_stats_commonallplayers​

Common all players.

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

Valid URL: https://stats.nba.com/stats/commonallplayers?IsOnlyCurrentSeason=0&LeagueID=00&Season=2024-25

API ParameterPythonPatternRequiredNullableDescription
IsOnlyCurrentSeasonis_only_current_seasonY
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.

Returns​

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

col_nametypedescription
person_idInt64Unique player identifier (V3 endpoints).
display_last_comma_firstStringPlayer name formatted as "Last, First".
display_first_lastStringPlayer name formatted as "First Last".
rosterstatusInt64Roster status flag (1 = currently on a roster, 0 = not).
from_yearStringFirst season.
to_yearStringMost recent season.
playercodeStringURL-style player code slug used by the league's legacy stats pages.
player_slugStringURL-safe player identifier.
team_idInt64Unique team identifier.
team_cityStringTeam city or region (e.g. 'Las Vegas').
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_codeStringLowercase slug of the player's team used in stats.nba.com URLs (e.g. 'lakers').
team_slugStringURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
games_played_flagStringY/N flag for whether the player has appeared in a league game.
otherleague_experience_chStringCode for the player's experience in another league (e.g. G League), as reported by the stats API.

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

nba_stats_commonplayerinfo​

Common player info.

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

Valid URL: https://stats.nba.com/stats/commonplayerinfo?LeagueID=00&PlayerID=2544

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY
PlayerIDplayer_idY

Returns​

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

CommonPlayerInfo

col_nametypedescription
person_idInt64Unique player identifier (V3 endpoints).
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
display_first_lastStringNBA or WNBA Stats value for display first last in the commonplayerinfo result set.
display_last_comma_firstStringNBA or WNBA Stats value for display last comma first in the commonplayerinfo result set.
display_fi_lastStringNBA or WNBA Stats value for display fi last in the commonplayerinfo result set.
player_slugStringURL-safe player identifier.
birthdateStringPlayer's date of birth as an ISO timestamp string (e.g. '1984-12-30T00:00:00').
schoolStringPlayer school / pre-draft team.
countryStringVenue country.
last_affiliationStringNBA or WNBA Stats value for last affiliation in the commonplayerinfo result set.
heightStringPlayer height (string e.g. '6-2' or inches).
weightStringPlayer weight in pounds.
season_expInt64NBA or WNBA Stats value for season exp in the commonplayerinfo result set.
jerseyStringJersey number worn by the player.
positionStringListed roster position (G, F, C, etc.).
rosterstatusStringNBA or WNBA Stats value for rosterstatus in the commonplayerinfo result set.
games_played_current_season_flagStringFlag indicating games played current season flag for the requested NBA or WNBA Stats context.
team_idInt64Unique team identifier.
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_codeStringLowercase slug of the player's current team used in stats.nba.com URLs (e.g. 'lakers').
team_cityStringTeam city or region (e.g. 'Las Vegas').
playercodeStringNBA or WNBA Stats value for playercode in the commonplayerinfo result set.
from_yearInt64First season.
to_yearInt64Most recent season.
dleague_flagStringFlag indicating dleague flag for the requested NBA or WNBA Stats context.
nba_flagStringFlag indicating NBA flag for the requested NBA or WNBA Stats context.
games_played_flagStringFlag indicating games played flag for the requested NBA or WNBA Stats context.
draft_yearStringDraft year (4-digit).
draft_roundStringRound of the draft selection.
draft_numberStringOverall pick the player was selected with, as a string; 'Undrafted' when never drafted.
greatest_75_flagStringFlag indicating greatest 75 flag for the requested NBA or WNBA Stats context.

PlayerHeadlineStats

col_nametypedescription
player_idInt64Unique player identifier.
player_nameStringPlayer name.
time_frameString
ptsFloat64Points scored.
astFloat64Assists.
rebFloat64Rebounds per game.
pieInt64Player Impact Estimate (0-1).

AvailableSeasons

col_nametypedescription
season_idStringUnique season 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_commonplayerinfo(league_id='00')

nba_stats_commonplayoffseries​

Common playoff series.

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

Valid URL: https://stats.nba.com/stats/commonplayoffseries?LeagueID=00&Season=2024-25&SeriesID=

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. 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.
SeriesIDseries_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
game_idStringUnique game identifier.
home_team_idInt64Unique identifier for the home team.
visitor_team_idInt64Unique identifier for visitor team.
series_idStringPlayoff series id, the game id stem without the game sequence digit (e.g. '004230010' for the 2023-24 playoffs' first series).
game_numInt64NBA or WNBA Stats value for game number in the commonplayoffseries result set.

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

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.
ImportErrorcurl_cffi is not installed -- stats.nba.com / stats.wnba.com block plain requests, so the transport needs it (pip install curl_cffi or sportsdataverse[all]).

Example​

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

nba_stats_commonteamroster​

Common team roster.

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

Valid URL: https://stats.nba.com/stats/commonteamroster?LeagueID=00&Season=2024-25&TeamID=1610612739

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. 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.
TeamIDteam_idY

Returns​

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

CommonTeamRoster

col_nametypedescription
team_idInt64Unique team identifier.
seasonStringSeason year.
league_idStringLeague identifier from the stats API ("00" = NBA, "10" = WNBA, "20" = G League).
playerStringPlayer name.
nicknameStringTeam or athlete nickname.
player_slugStringURL-safe player identifier.
numStringJersey number as printed on the roster (string; may be blank or carry a suffix).
positionStringListed roster position (G, F, C, etc.).
heightStringPlayer height (string e.g. '6-2' or inches).
weightStringPlayer weight in pounds.
birth_dateStringDate of birth (YYYY-MM-DD).
ageFloat64Player age (in years).
expStringExp.
schoolStringPlayer school / pre-draft team.
player_idInt64Unique player identifier.
how_acquiredStringHow the team acquired the player (e.g. draft, trade, free agency).

Coaches

col_nametypedescription
team_idInt64Unique team identifier.
seasonStringSeason year.
coach_idInt64ESPN coach id.
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
coach_nameString
is_assistantInt64
coach_typeString
sort_sequenceInt64
sub_sort_sequenceInt64

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

nba_stats_commonteamyears​

Common team years.

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

Valid URL: https://stats.nba.com/stats/commonteamyears?LeagueID=00

API ParameterPythonPatternRequiredNullableDescription
LeagueIDleague_idY

Returns​

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

col_nametypedescription
league_idStringLeague identifier ('10' = WNBA).
team_idInt64Unique team identifier.
min_yearStringMinimum year queried (echoes min_year).
max_yearStringMaximum year queried (echoes max_year).
abbreviationStringShort abbreviation.

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_commonteamyears(league_id='00')