NBA — NBA Stats API (stats.nba.com) — Team
nba_stats_teamdetails
Team details.
Endpoint URL: GET https://stats.nba.com/stats/teamdetails
Valid URL: https://stats.nba.com/stats/teamdetails?TeamID=1610612749
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
TeamID | team_id | Y |
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_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
abbreviation | String | Short abbreviation. |
nickname | String | Team or athlete nickname. |
yearfounded | Int64 | Year the franchise was founded. |
city | String | Venue city. |
arena | String | Arena. |
arenacapacity | String | Seating capacity of the team's home arena. |
owner | String | Name of the team's owner or ownership group. |
generalmanager | String | Name of the team's general manager. |
headcoach | String | Name of the team's head coach. |
dleagueaffiliation | String | Name of the team's G League (formerly D-League) affiliate. |
TeamHistory
| col_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
city | String | Venue city. |
nickname | String | Team or athlete nickname. |
yearfounded | Int64 | Year the franchise was founded. |
yearactivetill | Int64 |
TeamSocialSites
| col_name | type | description |
|---|---|---|
accounttype | String | |
website_link | String |
TeamAwardsChampionships
| col_name | type | description |
|---|---|---|
yearawarded | Int64 | |
oppositeteam | String |
TeamAwardsConf
| col_name | type | description |
|---|---|---|
yearawarded | Int64 | |
oppositeteam | String |
TeamAwardsDiv
| col_name | type | description |
|---|---|---|
yearawarded | Int64 | |
oppositeteam | String |
TeamHof
| col_name | type | description |
|---|---|---|
playerid | Int64 | Playerid. |
player | String | Player name. |
position | String | Listed roster position (G, F, C, etc.). |
jersey | String | Jersey number worn by the player. |
seasonswithteam | String | |
year | Int64 | 4-digit year. |
TeamRetired
| col_name | type | description |
|---|---|---|
playerid | Int64 | Playerid. |
player | String | Player name. |
position | String | Listed roster position (G, F, C, etc.). |
jersey | String | Jersey number worn by the player. |
seasonswithteam | String | |
year | Int64 | 4-digit year. |
TeamAwardsCommCup
| col_name | type | description |
|---|---|---|
yearawarded | Int64 | |
oppositeteam | String |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamdetails()
nba_stats_teamestimatedmetrics
Team estimated metrics.
Endpoint URL: GET https://stats.nba.com/stats/teamestimatedmetrics
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
LeagueID | league_id | Y | |||
Season | season | Y | Season 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. | ||
SeasonType | season_type | Y | Season 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 tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.
| col_name | type | description |
|---|---|---|
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_id | Int64 | Unique team identifier. |
gp | Int64 | Games played. |
w | Int64 | Wins. |
l | Int64 | Losses. |
w_pct | Float64 | Wins percentage (0-1 decimal). |
min | Float64 | Minutes played. |
e_off_rating | Float64 | Estimated offensive rating for the requested NBA or WNBA Stats split. |
e_def_rating | Float64 | Estimated defensive rating for the requested NBA or WNBA Stats split. |
e_net_rating | Float64 | Estimated net rating for the requested NBA or WNBA Stats split. |
e_pace | Float64 | Estimated pace for the requested NBA or WNBA Stats split. |
e_ast_ratio | Float64 | Estimated assist ratio for the requested NBA or WNBA Stats split. |
e_oreb_pct | Float64 | Estimated offensive rebound percentage for the requested NBA or WNBA Stats split. |
e_dreb_pct | Float64 | Estimated defensive rebound percentage for the requested NBA or WNBA Stats split. |
e_reb_pct | Float64 | Estimated rebound percentage for the requested NBA or WNBA Stats split. |
e_tm_tov_pct | Float64 | Estimated team turnover percentage for the requested NBA or WNBA Stats split. |
gp_rank | Int64 | Rank for games played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
w_rank | Int64 | Rank for wins within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
l_rank | Int64 | Rank for losses within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
w_pct_rank | Int64 | Rank for winning percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
min_rank | Int64 | Rank for minutes played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_off_rating_rank | Int64 | Rank for e offensive rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_def_rating_rank | Int64 | Rank for e defensive rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_net_rating_rank | Int64 | Rank for e net rating within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_ast_ratio_rank | Int64 | Rank for e assists ratio within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_oreb_pct_rank | Int64 | Rank for e offensive rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_dreb_pct_rank | Int64 | Rank for e defensive rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_reb_pct_rank | Int64 | Rank for e rebounds percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_tm_tov_pct_rank | Int64 | Rank for e team turnovers percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
e_pace_rank | Int64 | Rank 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
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamestimatedmetrics(league_id='00', season='2024-25')
nba_stats_teamgamelog
Team game log.
Endpoint URL: GET https://stats.nba.com/stats/teamgamelog
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
DateFrom | date_from_nullable | Y | |||
DateTo | date_to_nullable | Y | |||
LeagueID | league_id | Y | |||
Season | season | Y | Season 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. | ||
SeasonType | season_type_all_star | Y | Season 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). | ||
TeamID | team_id | Y |
Returns
return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.
| col_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
game_id | String | Unique game identifier. |
game_date | String | Game date (YYYY-MM-DD). |
matchup | String | Matchup. |
wl | String | Wl. |
w | Int64 | Wins. |
l | Int64 | Losses. |
w_pct | Float64 | Wins percentage (0-1 decimal). |
min | Int64 | Minutes played. |
fgm | Int64 | Field goals made. |
fga | Int64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
fg3_m | Int64 | Three-point field goals made. |
fg3_a | Int64 | Three-point field goal attempts. |
fg3_pct | Float64 | Three-point field goal percentage (0-1). |
ftm | Int64 | Free throws made. |
fta | Int64 | Free throw attempts. |
ft_pct | Float64 | Free throw percentage (0-1). |
oreb | Int64 | Offensive rebounds. |
dreb | Int64 | Defensive rebounds. |
reb | Int64 | Rebounds per game. |
ast | Int64 | Assists. |
stl | Int64 | Steals. |
blk | Int64 | Blocks. |
tov | Int64 | Turnovers. |
pf | Int64 | Personal fouls. |
pts | Int64 | Points scored. |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamgamelog(league_id='00', season='2024-25')
nba_stats_teamgamelogs
Team game logs.
Endpoint URL: GET https://stats.nba.com/stats/teamgamelogs
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
DateFrom | date_from_nullable | Y | |||
DateTo | date_to_nullable | Y | |||
GameSegment | game_segment_nullable | Y | |||
LastNGames | last_n_games_nullable | Y | |||
LeagueID | league_id | Y | |||
Location | location_nullable | Y | |||
MeasureType | measure_type_player_game_logs_nullable | Y | |||
Month | month_nullable | Y | |||
OppTeamID | opp_team_id_nullable | Y | |||
Outcome | outcome_nullable | Y | |||
PORound | po_round_nullable | Y | |||
PerMode | per_mode_simple_nullable | Y | |||
Period | period_nullable | Y | |||
PlayerID | player_id_nullable | Y | |||
Season | season_nullable | Y | Season 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. | ||
SeasonSegment | season_segment_nullable | Y | |||
SeasonType | season_type_nullable | Y | Season 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). | ||
ShotClockRange | shot_clock_range_nullable | Y | |||
TeamID | team_id_nullable | Y | |||
VsConference | vs_conference_nullable | Y | |||
VsDivision | vs_division_nullable | Y |
Returns
return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.
| col_name | type | description |
|---|---|---|
season_year | String | Season year string ('YYYY-YY' format). |
team_id | Int64 | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
game_id | String | Unique game identifier. |
game_date | String | Game date (YYYY-MM-DD). |
matchup | String | Matchup. |
wl | String | Wl. |
min | Float64 | Minutes played. |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
fg3_m | Float64 | Three-point field goals made. |
fg3_a | Float64 | Three-point field goal attempts. |
fg3_pct | Float64 | Three-point field goal percentage (0-1). |
ftm | Float64 | Free throws made. |
fta | Float64 | Free throw attempts. |
ft_pct | Float64 | Free throw percentage (0-1). |
oreb | Float64 | Offensive rebounds. |
dreb | Float64 | Defensive rebounds. |
reb | Float64 | Rebounds per game. |
ast | Float64 | Assists. |
tov | Float64 | Turnovers. |
stl | Float64 | Steals. |
blk | Float64 | Blocks. |
blka | Float64 | Blocked field-goal attempts against for the requested NBA or WNBA Stats split. |
pf | Float64 | Personal fouls. |
pfd | Float64 | Personal fouls drawn for the requested NBA or WNBA Stats split. |
pts | Float64 | Points scored. |
plus_minus | Float64 | Plus/minus point differential while on court. |
gp_rank | Int64 | Rank for games played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
w_rank | Int64 | Rank for wins within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
l_rank | Int64 | Rank for losses within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
w_pct_rank | Int64 | Rank for winning percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
min_rank | Int64 | Rank for minutes played within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fgm_rank | Int64 | Rank for field goals made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fga_rank | Int64 | Rank for field goals attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fg_pct_rank | Int64 | Rank for field-goal percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fg3_m_rank | Int64 | Rank for three-point field goals made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fg3_a_rank | Int64 | Rank for three-point field goals attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fg3_pct_rank | Int64 | Rank for three-point field-goal percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
ftm_rank | Int64 | Rank for free throws made within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
fta_rank | Int64 | Rank for free throws attempted within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
ft_pct_rank | Int64 | Rank for free-throw percentage within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
oreb_rank | Int64 | Rank for offensive rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
dreb_rank | Int64 | Rank for defensive rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
reb_rank | Int64 | Rank for total rebounds within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
ast_rank | Int64 | Rank for assists within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
tov_rank | Int64 | Rank for turnovers within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
stl_rank | Int64 | Rank for steals within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
blk_rank | Int64 | Rank for blocks within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
blka_rank | Int64 | Rank for blocked field-goal attempts against within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
pf_rank | Int64 | Rank for personal fouls within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
pfd_rank | Int64 | Rank for personal fouls drawn within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
pts_rank | Int64 | Rank for points within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
plus_minus_rank | Int64 | Rank for plus-minus within the requested NBA or WNBA Stats leaderboard or split, where 1 is the leader. |
available_flag | Int64 | Flag indicating whether the requested NBA or WNBA Stats video or data asset is available. |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamgamelogs(league_id='00', season_nullable='2024-25')
nba_stats_teaminfocommon
Team info common.
Endpoint URL: GET https://stats.nba.com/stats/teaminfocommon
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
LeagueID | league_id | Y | |||
Season | season_nullable | Y | Season 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. | ||
SeasonType | season_type_nullable | Y | Season 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). | ||
TeamID | team_id | Y |
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_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
season_year | String | Season year string ('YYYY-YY' format). |
team_city | String | Team city or region (e.g. 'Las Vegas'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_conference | String | Conference the team belongs to. |
team_division | String | Division the team belongs to. |
team_code | String | Lowercase slug of the team used in stats.nba.com URLs (e.g. 'lakers'). |
team_slug | String | URL-safe team identifier (e.g. 'lasvegas-aces' / 'aces'). |
w | Int64 | Wins. |
l | Int64 | Losses. |
pct | Float64 | Win percentage. |
conf_rank | Int64 | Team's current rank within its conference. |
div_rank | Int64 | Team's current rank within its division. |
min_year | String | Minimum year queried (echoes min_year). |
max_year | String | Maximum year queried (echoes max_year). |
TeamSeasonRanks
| col_name | type | description |
|---|---|---|
league_id | String | League identifier ('10' = WNBA). |
season_id | String | Unique season identifier. |
team_id | Int64 | Unique team identifier. |
pts_rank | Int64 | |
pts_pg | Float64 | |
reb_rank | Int64 | |
reb_pg | Float64 | |
ast_rank | Int64 | |
ast_pg | Float64 | |
opp_pts_rank | Int64 | |
opp_pts_pg | Float64 |
AvailableSeasons
| col_name | type | description |
|---|---|---|
season_id | String | Unique season identifier. |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teaminfocommon(league_id='00', season_nullable='2024-25')
nba_stats_teamvsplayer
Team vs player.
Endpoint URL: GET https://stats.nba.com/stats/teamvsplayer
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
DateFrom | date_from_nullable | Y | |||
DateTo | date_to_nullable | Y | |||
GameSegment | game_segment_nullable | Y | |||
LastNGames | last_n_games | Y | |||
LeagueID | league_id | Y | |||
Location | location_nullable | Y | |||
MeasureType | measure_type_detailed_defense | Y | |||
Month | month | Y | |||
OpponentTeamID | opponent_team_id | Y | |||
Outcome | outcome_nullable | Y | |||
PaceAdjust | pace_adjust | Y | |||
PerMode | per_mode_detailed | Y | |||
Period | period | Y | |||
PlayerID | player_id_nullable | Y | |||
PlusMinus | plus_minus | Y | |||
Rank | rank | Y | |||
Season | season | Y | Season 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. | ||
SeasonSegment | season_segment_nullable | Y | |||
SeasonType | season_type_playoffs | Y | Season 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). | ||
TeamID | team_id | Y | |||
VsConference | vs_conference_nullable | Y | |||
VsDivision | vs_division_nullable | Y | |||
VsPlayerID | vs_player_id | Y |
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_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
team_id | Int64 | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
gp | Int64 | Games played. |
w | Int64 | Wins. |
l | Int64 | Losses. |
w_pct | Float64 | Wins percentage (0-1 decimal). |
min | Float64 | Minutes played. |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
fg3_m | Float64 | Three-point field goals made. |
fg3_a | Float64 | Three-point field goal attempts. |
fg3_pct | Float64 | Three-point field goal percentage (0-1). |
ftm | Float64 | Free throws made. |
fta | Float64 | Free throw attempts. |
ft_pct | Float64 | Free throw percentage (0-1). |
oreb | Float64 | Offensive rebounds. |
dreb | Float64 | Defensive rebounds. |
reb | Float64 | Rebounds per game. |
ast | Float64 | Assists. |
tov | Float64 | Turnovers. |
stl | Float64 | Steals. |
blk | Float64 | Blocks. |
blka | Float64 | Shot attempts blocked by opponents (blocks against). |
pf | Float64 | Personal fouls. |
pfd | Float64 | Personal fouls drawn. |
pts | Float64 | Points scored. |
plus_minus | Float64 | Plus/minus point differential while on court. |
gp_rank | Int64 | League rank of the row's games played for the season and split. |
w_rank | Int64 | League rank of the row's wins for the season and split. |
l_rank | Int64 | League rank of the row's losses for the season and split. |
w_pct_rank | Int64 | League rank of the row's win percentage for the season and split. |
min_rank | Int64 | League rank of the row's minutes played for the season and split. |
fgm_rank | Int64 | League rank of the row's field goals made for the season and split. |
fga_rank | Int64 | League rank of the row's field goals attempted for the season and split. |
fg_pct_rank | Int64 | League rank of the row's field goal percentage for the season and split. |
fg3_m_rank | Int64 | League rank of the row's three-point field goals made for the season and split. |
fg3_a_rank | Int64 | League rank of the row's three-point field goals attempted for the season and split. |
fg3_pct_rank | Int64 | League rank of the row's three-point field goal percentage for the season and split. |
ftm_rank | Int64 | League rank of the row's free throws made for the season and split. |
fta_rank | Int64 | League rank of the row's free throws attempted for the season and split. |
ft_pct_rank | Int64 | League rank of the row's free throw percentage for the season and split. |
oreb_rank | Int64 | League rank of the row's offensive rebounds for the season and split. |
dreb_rank | Int64 | League rank of the row's defensive rebounds for the season and split. |
reb_rank | Int64 | League rank of the row's total rebounds for the season and split. |
ast_rank | Int64 | League rank of the row's assists for the season and split. |
tov_rank | Int64 | League rank of the row's turnovers for the season and split. |
stl_rank | Int64 | League rank of the row's steals for the season and split. |
blk_rank | Int64 | League rank of the row's blocked shots for the season and split. |
blka_rank | Int64 | League rank of the row's shot attempts blocked by opponents (blocks against) for the season and split. |
pf_rank | Int64 | League rank of the row's personal fouls committed for the season and split. |
pfd_rank | Int64 | League rank of the row's personal fouls drawn for the season and split. |
pts_rank | Int64 | League rank of the row's points scored for the season and split. |
plus_minus_rank | Int64 | League rank of the row's plus-minus point differential while on the floor for the season and split. |
vsPlayerOverall
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
player_id | Int64 | Unique player identifier. |
gp | Int64 | Games played. |
w | Int64 | Wins. |
l | Int64 | Losses. |
w_pct | Float64 | Wins percentage (0-1 decimal). |
min | Float64 | Minutes played. |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
fg3_m | Float64 | Three-point field goals made. |
fg3_a | Float64 | Three-point field goal attempts. |
fg3_pct | Float64 | Three-point field goal percentage (0-1). |
ftm | Float64 | Free throws made. |
fta | Float64 | Free throw attempts. |
ft_pct | Float64 | Free throw percentage (0-1). |
oreb | Float64 | Offensive rebounds. |
dreb | Float64 | Defensive rebounds. |
reb | Float64 | Rebounds per game. |
ast | Float64 | Assists. |
tov | Float64 | Turnovers. |
stl | Float64 | Steals. |
blk | Float64 | Blocks. |
blka | Float64 | Shot attempts blocked by opponents (blocks against). |
pf | Float64 | Personal fouls. |
pfd | Float64 | Personal fouls drawn. |
pts | Float64 | Points scored. |
plus_minus | Float64 | Plus/minus point differential while on court. |
nba_fantasy_pts | Float64 | Fantasy points under the NBA's fantasy scoring formula. |
dd2 | Int64 | Double-doubles recorded over the split. |
td3 | Int64 | Triple-doubles recorded over the split. |
wnba_fantasy_pts | Float64 | Fantasy points under the WNBA's fantasy scoring formula. |
gp_rank | Int64 | League rank of the row's games played for the season and split. |
w_rank | Int64 | League rank of the row's wins for the season and split. |
l_rank | Int64 | League rank of the row's losses for the season and split. |
w_pct_rank | Int64 | League rank of the row's win percentage for the season and split. |
min_rank | Int64 | League rank of the row's minutes played for the season and split. |
fgm_rank | Int64 | League rank of the row's field goals made for the season and split. |
fga_rank | Int64 | League rank of the row's field goals attempted for the season and split. |
fg_pct_rank | Int64 | League rank of the row's field goal percentage for the season and split. |
fg3_m_rank | Int64 | League rank of the row's three-point field goals made for the season and split. |
fg3_a_rank | Int64 | League rank of the row's three-point field goals attempted for the season and split. |
fg3_pct_rank | Int64 | League rank of the row's three-point field goal percentage for the season and split. |
ftm_rank | Int64 | League rank of the row's free throws made for the season and split. |
fta_rank | Int64 | League rank of the row's free throws attempted for the season and split. |
ft_pct_rank | Int64 | League rank of the row's free throw percentage for the season and split. |
oreb_rank | Int64 | League rank of the row's offensive rebounds for the season and split. |
dreb_rank | Int64 | League rank of the row's defensive rebounds for the season and split. |
reb_rank | Int64 | League rank of the row's total rebounds for the season and split. |
ast_rank | Int64 | League rank of the row's assists for the season and split. |
tov_rank | Int64 | League rank of the row's turnovers for the season and split. |
stl_rank | Int64 | League rank of the row's steals for the season and split. |
blk_rank | Int64 | League rank of the row's blocked shots for the season and split. |
blka_rank | Int64 | League rank of the row's shot attempts blocked by opponents (blocks against) for the season and split. |
pf_rank | Int64 | League rank of the row's personal fouls committed for the season and split. |
pfd_rank | Int64 | League rank of the row's personal fouls drawn for the season and split. |
pts_rank | Int64 | League rank of the row's points scored for the season and split. |
plus_minus_rank | Int64 | League rank of the row's plus-minus point differential while on the floor for the season and split. |
nba_fantasy_pts_rank | Int64 | League rank of the row's NBA fantasy points (league scoring formula) for the season and split. |
dd2_rank | Int64 | League rank of the row's double-doubles for the season and split. |
td3_rank | Int64 | League rank of the row's triple-doubles for the season and split. |
wnba_fantasy_pts_rank | Int64 | League rank of the row's WNBA fantasy points (league scoring formula) for the season and split. |
team_count | Int64 | Number of distinct teams aggregated into the split row. |
OnOffCourt
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
team_id | String | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
vs_player_id | String | |
vs_player_name | String | |
court_status | String | |
gp | String | Games played. |
w | String | Wins. |
l | String | Losses. |
w_pct | String | Wins percentage (0-1 decimal). |
min | String | Minutes played. |
fgm | String | Field goals made. |
fga | String | Field goal attempts. |
fg_pct | String | Field goal percentage (0-1). |
fg3_m | String | Three-point field goals made. |
fg3_a | String | Three-point field goal attempts. |
fg3_pct | String | Three-point field goal percentage (0-1). |
ftm | String | Free throws made. |
fta | String | Free throw attempts. |
ft_pct | String | Free throw percentage (0-1). |
oreb | String | Offensive rebounds. |
dreb | String | Defensive rebounds. |
reb | String | Rebounds per game. |
ast | String | Assists. |
tov | String | Turnovers. |
stl | String | Steals. |
blk | String | Blocks. |
blka | String | Shot attempts blocked by opponents (blocks against). |
pf | String | Personal fouls. |
pfd | String | Personal fouls drawn. |
pts | String | Points scored. |
plus_minus | String | Plus/minus point differential while on court. |
gp_rank | String | League rank of the row's games played for the season and split. |
w_rank | String | League rank of the row's wins for the season and split. |
l_rank | String | League rank of the row's losses for the season and split. |
w_pct_rank | String | League rank of the row's win percentage for the season and split. |
min_rank | String | League rank of the row's minutes played for the season and split. |
fgm_rank | String | League rank of the row's field goals made for the season and split. |
fga_rank | String | League rank of the row's field goals attempted for the season and split. |
fg_pct_rank | String | League rank of the row's field goal percentage for the season and split. |
fg3_m_rank | String | League rank of the row's three-point field goals made for the season and split. |
fg3_a_rank | String | League rank of the row's three-point field goals attempted for the season and split. |
fg3_pct_rank | String | League rank of the row's three-point field goal percentage for the season and split. |
ftm_rank | String | League rank of the row's free throws made for the season and split. |
fta_rank | String | League rank of the row's free throws attempted for the season and split. |
ft_pct_rank | String | League rank of the row's free throw percentage for the season and split. |
oreb_rank | String | League rank of the row's offensive rebounds for the season and split. |
dreb_rank | String | League rank of the row's defensive rebounds for the season and split. |
reb_rank | String | League rank of the row's total rebounds for the season and split. |
ast_rank | String | League rank of the row's assists for the season and split. |
tov_rank | String | League rank of the row's turnovers for the season and split. |
stl_rank | String | League rank of the row's steals for the season and split. |
blk_rank | String | League rank of the row's blocked shots for the season and split. |
blka_rank | String | League rank of the row's shot attempts blocked by opponents (blocks against) for the season and split. |
pf_rank | String | League rank of the row's personal fouls committed for the season and split. |
pfd_rank | String | League rank of the row's personal fouls drawn for the season and split. |
pts_rank | String | League rank of the row's points scored for the season and split. |
plus_minus_rank | String | League rank of the row's plus-minus point differential while on the floor for the season and split. |
ShotDistanceOverall
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
team_id | Int64 | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
ShotDistanceOnCourt
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
team_id | String | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
vs_player_id | String | |
vs_player_name | String | |
court_status | String | |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
fgm | String | Field goals made. |
fga | String | Field goal attempts. |
fg_pct | String | Field goal percentage (0-1). |
ShotDistanceOffCourt
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
team_id | String | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
vs_player_id | String | |
vs_player_name | String | |
court_status | String | |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
fgm | String | Field goals made. |
fga | String | Field goal attempts. |
fg_pct | String | Field goal percentage (0-1). |
ShotAreaOverall
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
team_id | Int64 | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
ShotAreaOnCourt
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
team_id | String | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
vs_player_id | String | |
vs_player_name | String | |
court_status | String | |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
fgm | String | Field goals made. |
fga | String | Field goal attempts. |
fg_pct | String | Field goal percentage (0-1). |
ShotAreaOffCourt
| col_name | type | description |
|---|---|---|
group_set | String | Name of the split group the row belongs to (e.g. Overall, By Opponent, By Month). |
team_id | String | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
vs_player_id | String | |
vs_player_name | String | |
court_status | String | |
group_value | String | Value of the split within the group (e.g. a specific opponent, month, or result). |
fgm | String | Field goals made. |
fga | String | Field goal attempts. |
fg_pct | String | Field goal percentage (0-1). |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamvsplayer(league_id='00', season='2024-25')
nba_stats_teamyearbyyearstats
Team year by year stats.
Endpoint URL: GET https://stats.nba.com/stats/teamyearbyyearstats
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
LeagueID | league_id | Y | |||
PerMode | per_mode_simple | Y | |||
SeasonType | season_type_all_star | Y | Season 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). | ||
TeamID | team_id | Y |
Returns
return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.
| col_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
team_city | String | Team city or region (e.g. 'Las Vegas'). |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
year | String | 4-digit year. |
gp | Int64 | Games played. |
wins | Int64 | Total wins. |
losses | Int64 | Total losses. |
win_pct | Float64 | Win percentage (0-1 decimal). |
conf_rank | Int64 | Team's final rank within its conference for the season. |
div_rank | Int64 | Team's final rank within its division for the season. |
po_wins | Int64 | Playoff wins recorded by the team that season. |
po_losses | Int64 | Playoff losses recorded by the team that season. |
conf_count | Int64 | Number of teams in the team's conference that season. |
div_count | Int64 | Number of teams in the team's division that season. |
nba_finals_appearance | String | Whether the team reached the league finals that season (e.g. "FINALS APPEARANCE" or "N/A"). |
fgm | Float64 | Field goals made. |
fga | Float64 | Field goal attempts. |
fg_pct | Float64 | Field goal percentage (0-1). |
fg3_m | Float64 | Three-point field goals made. |
fg3_a | Float64 | Three-point field goal attempts. |
fg3_pct | Float64 | Three-point field goal percentage (0-1). |
ftm | Float64 | Free throws made. |
fta | Float64 | Free throw attempts. |
ft_pct | Float64 | Free throw percentage (0-1). |
oreb | Float64 | Offensive rebounds. |
dreb | Float64 | Defensive rebounds. |
reb | Float64 | Rebounds per game. |
ast | Float64 | Assists. |
pf | Float64 | Personal fouls. |
stl | Float64 | Steals. |
tov | Float64 | Turnovers. |
blk | Float64 | Blocks. |
pts | Float64 | Points scored. |
pts_rank | Int64 | League rank of the team's points scored for the season. |
return_parsed=False — the raw JSON Dict payload, unparsed.
Raises
| Exception | Description |
|---|---|
NoDataError | The host answered 404 -- the requested resource does not exist. |
ValueError | The host answered 400 / 422 -- the request is wrong; retrying cannot help. |
AssetFetchError | The 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. |
ImportError | curl_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_teamyearbyyearstats(league_id='00')