Skip to contents

Get NBA Stats API Shot Chart Detail

Get NBA Stats API Shot Chart Detail

Usage

nba_shotchartdetail(
  context_measure = "FGA",
  date_from = "",
  date_to = "",
  game_id = "",
  game_segment = "",
  last_n_games = 0,
  league_id = "00",
  location = "",
  month = 0,
  opponent_team_id = 0,
  outcome = "",
  period = 0,
  player_id = "202696",
  player_position = "",
  rookie_year = "",
  season = year_to_season(most_recent_nba_season() - 1),
  season_segment = "",
  season_type = "Regular Season",
  team_id = 0,
  vs_conference = "",
  vs_division = "",
  ...
)

Arguments

context_measure

context_measure

date_from

date_from

date_to

date_to

game_id

game_id

game_segment

game_segment

last_n_games

last_n_games

league_id

league_id

location

location

month

month

opponent_team_id

opponent_team_id

outcome

outcome

period

period

player_id

player_id

player_position

player_position

rookie_year

rookie_year

season

season

season_segment

season_segment

season_type

season_type

team_id

team_id

vs_conference

vs_conference

vs_division

vs_division

...

Additional arguments passed to an underlying function like httr.

Value

Return a named list of data frames: LeagueAverages, Shot_Chart_Detail

Shot_Chart_Detail

col_nametypesdescription
GRID_TYPEcharacter
GAME_IDcharacterUnique game identifier.
GAME_EVENT_IDcharacter
PLAYER_IDcharacterUnique player identifier.
PLAYER_NAMEcharacterPlayer name.
TEAM_IDcharacterUnique team identifier.
TEAM_NAMEcharacterFull team display name (e.g. 'Las Vegas Aces').
PERIODcharacterPeriod of the game (1-4 quarters; 5+ for OT).
MINUTES_REMAININGcharacter
SECONDS_REMAININGcharacterSeconds remaining in the period.
EVENT_TYPEcharacterEvent / play type code (V2 PBP).
ACTION_TYPEcharacterAction type label (e.g. 'Made Shot', 'Substitution').
SHOT_TYPEcharacterShot type label (e.g. 'Jump Shot', 'Layup').
SHOT_ZONE_BASICcharacterShot zone (e.g. 'Restricted Area', 'Mid-Range', 'Above the Break 3').
SHOT_ZONE_AREAcharacterShot zone area ('Left Side', 'Right Side', 'Center').
SHOT_ZONE_RANGEcharacterShot zone range ('Less Than 8 ft.', '8-16 ft.', '16-24 ft.', etc.).
SHOT_DISTANCEcharacterShot distance from the basket, in feet.
LOC_XcharacterX coordinate on the court (units of inches; 0 = basket center).
LOC_YcharacterY coordinate on the court (units of inches; baseline at 0).
SHOT_ATTEMPTED_FLAGcharacter1 if a shot was attempted on this event.
SHOT_MADE_FLAGcharacter1 if the shot was made; 0 if missed.
GAME_DATEcharacterGame date (YYYY-MM-DD).
HTMcharacter
VTMcharacter

LeagueAverages

col_nametypesdescription
GRID_TYPEcharacter
SHOT_ZONE_BASICcharacterShot zone (e.g. 'Restricted Area', 'Mid-Range', 'Above the Break 3').
SHOT_ZONE_AREAcharacterShot zone area ('Left Side', 'Right Side', 'Center').
SHOT_ZONE_RANGEcharacterShot zone range ('Less Than 8 ft.', '8-16 ft.', '16-24 ft.', etc.).
FGAcharacterField goal attempts.
FGMcharacterField goals made.
FG_PCTcharacterField goal percentage (0-1).

Details

 nba_shotchartdetail(league_id = '00', player_id = '202696', season = year_to_season(most_recent_nba_season() - 1))

Author

Saiem Gilani