Overview
This endpoint retrieves comprehensive per-game statistics for a specific NBA player during the current season. It uses thenba_api.PlayerDashboardByGeneralSplits endpoint to fetch detailed player performance data.
Authentication
This endpoint requires authentication. The user must have a valid session token.Path Parameters
The unique NBA player ID (PERSON_ID). This can be obtained from the
/api/nba_players endpoint.Response
Returns an object containing per-game statistics:Game Information
Games Played
Minutes Per Game
Scoring Statistics
Points Per Game
Field Goals Made Per Game
Field Goals Attempted Per Game
Field Goal Percentage
Three-Point Field Goals Made Per Game
Three-Point Field Goals Attempted Per Game
Three-Point Field Goal Percentage
Free Throws Made Per Game
Free Throws Attempted Per Game
Free Throw Percentage
Other Statistics
Rebounds Per Game
Assists Per Game
Steals Per Game
Blocks Per Game
Turnovers Per Game
Double-Doubles
Triple-Doubles
Implementation Details
The endpoint usesPlayerDashboardByGeneralSplits from nba_api.stats.endpoints:
Data Processing
The endpoint processes the raw NBA API data as follows:- Games Played (GP): Converted to integer
- All other statistics: Converted to float
- Null/missing values: Default to 0 or 0.0 depending on type
Example Response
Error Handling
The endpoint implements comprehensive error handling:Authentication Error (401)
Returned when the user is not authenticated.Not Found Errors (404)
- Empty DataFrame: Player exists but has no stats for the current season (possibly inactive)
- No DataFrames: NBA API returned no data for the player
Network Errors (504)
- Timeout: NBA API request timed out
- Connection Error: Unable to connect to NBA API
Server Errors (500)
Generic errors that occur during data fetching or processing. The error message includes the exception type and details.Usage Notes
- Statistics are calculated as per-game averages (not totals)
- The endpoint automatically uses the current NBA season
- Player must have played at least one game in the current season to return data
- All percentage statistics are returned as decimals (0.507 = 50.7%)
- The
per_mode_detailedparameter is set to “PerGame” for per-game statistics