NBA G League — G League Stats API (stats.nba.com, LeagueID=20) — Other: playbyplayv3–scoreboardv3
nbagl_stats_playbyplayv3
Play by play v3.
Endpoint URL: GET https://stats.nba.com/stats/playbyplayv3
Valid URL: https://stats.nba.com/stats/playbyplayv3?EndPeriod=0&GameID=2022500137&StartPeriod=0
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
EndPeriod | end_period | Y | |||
GameID | game_id | Y | |||
StartPeriod | start_period | 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 |
|---|---|---|
game_id | String | Ten-character stats API game id (e.g. "0022500100"), shared by every action in the game. |
video_available | Int64 | 1 when the stats site has video of the action, else 0. |
action_number | Int64 | Stats API action number of the event within the game; gaps mark actions the feed removed. |
clock | String | Game clock remaining in the period as an ISO-8601 duration (e.g. PT11M42.00S). |
period | Int64 | Period of the action (1-4 regulation, 5+ overtime). |
team_id | Int64 | Stats API team id of the action's team; 0 for neutral actions. |
team_tricode | String | Three-letter code of the action's team (e.g. GSW); empty for neutral actions. |
person_id | Int64 | Stats API person id of the action's primary player; 0 for team and neutral actions. |
player_name | String | Last name of the action's primary player; empty for team and neutral actions. |
player_name_i | String | Initial-and-last-name form of the primary player (e.g. "S. Curry"). |
x_legacy | Int64 | Shot x coordinate on the legacy stats court grid (tenths of a foot from the basket); 0 off shots. |
y_legacy | Int64 | Shot y coordinate on the legacy stats court grid (tenths of a foot from the basket); 0 off shots. |
shot_distance | Int64 | Shot distance in feet; 0 on non-shot actions. |
shot_result | String | Made or Missed on a shot; empty otherwise. |
is_field_goal | Int64 | 1 when the action is a field-goal attempt, else 0. |
score_home | String | Home score after the action, as text; empty on non-scoring actions. |
score_away | String | Visitor score after the action, as text; empty on non-scoring actions. |
points_total | Int64 | Combined home + visitor score after the action (running game total). |
location | String | Side of the action, h (home) or v (visitor); empty for neutral actions. |
description | String | Text description of the action (e.g. "Curry 26' 3PT Jump Shot (3 PTS)"). |
action_type | String | Action family (e.g. Made Shot, Missed Shot, Free Throw, Rebound, Turnover, Foul, Substitution, period). |
sub_type | String | Action subtype (e.g. Jump Shot, Driving Layup, Personal, Bad Pass, start, end). |
shot_value | Int64 | Points a field-goal attempt was worth (2 or 3); 0 on free throws and non-shot actions. |
action_id | Int64 | Sequential id of the action in the feed's order (1-based); unlike action_number it has no gaps. |
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
nbagl_stats_playbyplayv3()
nbagl_stats_scoreboardv3
Scoreboard v3.
Endpoint URL: GET https://stats.nba.com/stats/scoreboardv3
Valid URL: https://stats.nba.com/stats/scoreboardv3?GameDate=2025-01-15&LeagueID=20
| API Parameter | Python | Pattern | Required | Nullable | Description |
|---|---|---|---|---|---|
GameDate | game_date | Y | |||
LeagueID | league_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 |
|---|---|---|
awayteam_inbonus | String | Whether the away team is currently in the bonus (penalty) foul situation. |
awayteam_losses | Int64 | Away team's loss total entering the game. |
awayteam_score | Int64 | Current or final points scored by the away team. |
awayteam_seed | Int64 | Playoff seed of the away team, populated for postseason games. |
awayteam_teamcity | String | City name of the away team. |
awayteam_teamid | Int64 | Team identifier of the away team from the league's stats API. |
awayteam_teamname | String | Nickname of the away team. |
awayteam_teamslug | String | URL-friendly slug for the away team's name. |
awayteam_teamtricode | String | Three-letter abbreviation of the away team. |
awayteam_timeoutsremaining | Int64 | Timeouts the away team has remaining. |
awayteam_wins | Int64 | Away team's win total entering the game. |
gameclock | String | Current game clock display for a live game. |
gamecode | String | |
gamedate | String | Game date the scoreboard was requested for (YYYY-MM-DD). |
gameet | String | Scheduled game start time in US Eastern time. |
gameid | String | Unique 10-character game identifier from the league's stats API. |
gamelabel | String | Display label for the game (e.g. a playoff series or event name). |
gameleaders_awayleaders_assists | Int64 | Assist total of the away team's in-game statistical leader. |
gameleaders_awayleaders_jerseynum | String | Jersey number of the away team's in-game statistical leader. |
gameleaders_awayleaders_name | String | Name of the away team's in-game statistical leader. |
gameleaders_awayleaders_personid | Int64 | Stats API player id of the away team's in-game statistical leader. |
gameleaders_awayleaders_playerslug | String | URL name slug of the away team's in-game statistical leader. |
gameleaders_awayleaders_points | Int64 | Point total of the away team's in-game statistical leader. |
gameleaders_awayleaders_position | String | Position of the away team's in-game statistical leader. |
gameleaders_awayleaders_rebounds | Int64 | Rebound total of the away team's in-game statistical leader. |
gameleaders_awayleaders_teamtricode | String | Team tricode of the away team's in-game statistical leader. |
gameleaders_homeleaders_assists | Int64 | Assist total of the home team's in-game statistical leader. |
gameleaders_homeleaders_jerseynum | String | Jersey number of the home team's in-game statistical leader. |
gameleaders_homeleaders_name | String | Name of the home team's in-game statistical leader. |
gameleaders_homeleaders_personid | Int64 | Stats API player id of the home team's in-game statistical leader. |
gameleaders_homeleaders_playerslug | String | URL name slug of the home team's in-game statistical leader. |
gameleaders_homeleaders_points | Int64 | Point total of the home team's in-game statistical leader. |
gameleaders_homeleaders_position | String | Position of the home team's in-game statistical leader. |
gameleaders_homeleaders_rebounds | Int64 | Rebound total of the home team's in-game statistical leader. |
gameleaders_homeleaders_teamtricode | String | Team tricode of the home team's in-game statistical leader. |
gamestatus | Int64 | Numeric game status code (1 = scheduled, 2 = in progress, 3 = final). |
gamestatustext | String | Human-readable game status (e.g. "Final", "7:00 pm ET"). |
gamesublabel | String | Secondary display label for the game (e.g. game number within a series). |
gamesubtype | String | Subtype code for the game as reported by the stats API (e.g. in-season tournament flags). |
gametimeutc | String | Scheduled game start time in UTC. |
hometeam_inbonus | String | Whether the home team is currently in the bonus (penalty) foul situation. |
hometeam_losses | Int64 | Home team's loss total entering the game. |
hometeam_score | Int64 | Current or final points scored by the home team. |
hometeam_seed | Int64 | Playoff seed of the home team, populated for postseason games. |
hometeam_teamcity | String | City name of the home team. |
hometeam_teamid | Int64 | Team identifier of the home team from the league's stats API. |
hometeam_teamname | String | Nickname of the home team. |
hometeam_teamslug | String | URL-friendly slug for the home team's name. |
hometeam_teamtricode | String | Three-letter abbreviation of the home team. |
hometeam_timeoutsremaining | Int64 | Timeouts the home team has remaining. |
hometeam_wins | Int64 | Home team's win total entering the game. |
ifnecessary | Boolean | Whether the game is an if-necessary playoff series game. |
isneutral | Boolean | Whether the game is played at a neutral site. |
leagueid | String | League identifier from the stats API ("00" = NBA, "10" = WNBA). |
leaguename | String | Display name of the league. |
period | Int64 | |
porounddesc | String | Playoff round description (e.g. Conference Finals). |
regulationperiods | Int64 | Number of regulation periods for the game (4). |
seriesconference | String | Conference of the playoff series the game belongs to. |
seriesgamenumber | String | Game number within the playoff series. |
seriestext | String | Display text summarizing the series state (e.g. "BOS leads 2-1"). |
teamleaders_awayleaders_assists | Float64 | Assist total of the away team's season statistical leader. |
teamleaders_awayleaders_jerseynum | String | Jersey number of the away team's season statistical leader. |
teamleaders_awayleaders_name | String | Name of the away team's season statistical leader. |
teamleaders_awayleaders_personid | Int64 | Stats API player id of the away team's season statistical leader. |
teamleaders_awayleaders_playerslug | String | URL name slug of the away team's season statistical leader. |
teamleaders_awayleaders_points | Float64 | Point total of the away team's season statistical leader. |
teamleaders_awayleaders_position | String | Position of the away team's season statistical leader. |
teamleaders_awayleaders_rebounds | Float64 | Rebound total of the away team's season statistical leader. |
teamleaders_awayleaders_teamtricode | String | Team tricode of the away team's season statistical leader. |
teamleaders_homeleaders_assists | Float64 | Assist total of the home team's season statistical leader. |
teamleaders_homeleaders_jerseynum | String | Jersey number of the home team's season statistical leader. |
teamleaders_homeleaders_name | String | Name of the home team's season statistical leader. |
teamleaders_homeleaders_personid | Int64 | Stats API player id of the home team's season statistical leader. |
teamleaders_homeleaders_playerslug | String | URL name slug of the home team's season statistical leader. |
teamleaders_homeleaders_points | Float64 | Point total of the home team's season statistical leader. |
teamleaders_homeleaders_position | String | Position of the home team's season statistical leader. |
teamleaders_homeleaders_rebounds | Float64 | Rebound total of the home team's season statistical leader. |
teamleaders_homeleaders_teamtricode | String | Team tricode of the home team's season statistical leader. |
teamleaders_seasonleadersflag | Int64 | Flag indicating the team-leaders block carries season-long leaders rather than in-game leaders. |
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
nbagl_stats_scoreboardv3(league_id='20')