Skip to main content

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

nba_stats_videodetailsasset​

Video details asset.

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

Valid URL: https://stats.nba.com/stats/videodetailsasset?ContextMeasure=FGA&LastNGames=0&Month=0&OpponentTeamID=0&Period=0&PlayerID=2544&Season=2024-25&SeasonType=Regular+Season&TeamID=1610612747&VsDivision=&VsConference=&StartRange=&StartPeriod=&SeasonSegment=&RookieYear=&RangeType=&Position=&PointDiff=&Outcome=&Location=&LeagueID=00&GameSegment=&GameID=&EndRange=&EndPeriod=&DateTo=&DateFrom=&ContextFilter=&ClutchTime=&AheadBehind=

API ParameterPythonPatternRequiredNullableDescription
ContextMeasurecontext_measure_detailedY
LastNGameslast_n_gamesY
MonthmonthY
OpponentTeamIDopponent_team_idY
PeriodperiodY
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).
TeamIDteam_idY
VsDivisionvs_division_nullableY
VsConferencevs_conference_nullableY
StartRangestart_range_nullableY
StartPeriodstart_period_nullableY
SeasonSegmentseason_segment_nullableY
RookieYearrookie_year_nullableY
RangeTyperange_type_nullableY
Positionposition_nullableY
PointDiffpoint_diff_nullableY
Outcomeoutcome_nullableY
Locationlocation_nullableY
LeagueIDleague_idY
GameSegmentgame_segment_nullableY
GameIDgame_id_nullableY
EndRangeend_range_nullableY
EndPeriodend_period_nullableY
DateTodate_to_nullableY
DateFromdate_from_nullableY
ContextFiltercontext_filter_nullableY
ClutchTimeclutch_time_nullableY
AheadBehindahead_behind_nullableY

Returns​

return_parsed=True (default) — A dict of two DataFrames keyed videoUrls (clip URLs, durations, thumbnails) and playlist (per-event game metadata) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

videoUrls

col_nametypedescription
uuidStringUuid.
sdurInt64Sdur.
surlStringSurl.
sthStringSth.
mdurInt64Mdur.
murlStringMurl.
mthStringMth.
ldurInt64Ldur.
lurlStringLurl.
lthStringLth.
vttStringVtt.
sccStringScc.
srtStringSrt.

playlist

col_nametypedescription
giStringGi.
eiInt64Ei.
yInt64Y.
mStringM.
dStringD.
gcStringGc.
pInt64P.
dscStringDsc.
haStringHa.
hidInt64Hid.
vaStringVa.
vidInt64Vid.
hpbInt64Hpb.
hpaInt64Hpa.
vpbInt64Vpb.
vpaInt64Vpa.
ptaInt64Pta.

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

nba_stats_videoevents​

Video events.

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

Valid URL: https://stats.nba.com/stats/videoevents?GameEventID=10&GameID=0021700807

API ParameterPythonPatternRequiredNullableDescription
GameEventIDgame_event_idY
GameIDgame_idY

Returns​

return_parsed=True (default) — A dict of two DataFrames keyed videoUrls (clip URLs, durations, thumbnails) and playlist (per-event game metadata) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

videoUrls

col_nametypedescription
uuidStringUuid.
durStringDur.
sttStringStt.
stpStringStp.
sthStringSth.
stwStringStw.
mttStringMtt.
mtpStringMtp.
mthStringMth.
mtwStringMtw.
lttStringLtt.
ltpStringLtp.
lthStringLth.
ltwStringLtw.

playlist

col_nametypedescription
giStringGi.
eiInt64Ei.
yInt64Y.
mStringM.
dStringD.
gcStringGc.
pInt64P.
dscStringDsc.
haStringHa.
vaStringVa.
hpbInt64Hpb.
hpaInt64Hpa.
vpbInt64Vpb.
vpaInt64Vpa.
ptaInt64Pta.

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

nba_stats_videoeventsasset​

Video events asset.

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

Valid URL: https://stats.nba.com/stats/videoeventsasset?GameEventID=0&GameID=0021700807

API ParameterPythonPatternRequiredNullableDescription
GameEventIDgame_event_idY
GameIDgame_idY

Returns​

return_parsed=True (default) — A dict of two DataFrames keyed videoUrls (clip URLs, durations, thumbnails) and playlist (per-event game metadata) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

videoUrls

col_nametypedescription
uuidStringUuid.
sdurInt64Sdur.
surlStringSurl.
sthStringSth.
mdurInt64Mdur.
murlStringMurl.
mthStringMth.
ldurInt64Ldur.
lurlStringLurl.
lthStringLth.
vttStringVtt.
sccStringScc.
srtStringSrt.

playlist

col_nametypedescription
giStringGi.
eiInt64Ei.
yInt64Y.
mStringM.
dStringD.
gcStringGc.
pInt64P.
dscStringDsc.
haStringHa.
hidInt64Hid.
vaStringVa.
vidInt64Vid.
hpbInt64Hpb.
hpaInt64Hpa.
vpbInt64Vpb.
vpaInt64Vpa.
ptaInt64Pta.

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

nba_stats_videostatus​

Video status.

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

Valid URL: https://stats.nba.com/stats/videostatus?GameDate=2023-03-10&LeagueID=00

API ParameterPythonPatternRequiredNullableDescription
GameDategame_dateY
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
game_idStringUnique game identifier.
game_dateStringGame date (YYYY-MM-DD).
visitor_team_idInt64Unique identifier for visitor team.
visitor_team_cityStringCity name of the visiting team.
visitor_team_nameStringNickname of the visiting team.
visitor_team_abbreviationStringAbbreviation of the visiting team.
home_team_idInt64Unique identifier for the home team.
home_team_cityStringHome team city / location.
home_team_nameStringHome team name.
home_team_abbreviationStringHome team's three-letter tricode (e.g. 'PHI').
game_statusInt64Game status label.
game_status_textStringGame status display text (e.g. 'Final', '4:32 - 4th').
is_availableInt64Flag indicating whether game video is available in the league's stats video system.
pt_xyz_availableInt64Pt xyz available.

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

Raises​

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

Example​

nba_stats_videostatus(league_id='00')