Skip to contents

Get NBA Data API Play-by-Play

Get NBA Data API Play-by-Play

Usage

nba_data_pbp(game_id = "0021900001", ...)

Arguments

game_id

Game ID - 10 digits, i.e. "0021900001"

...

Additional arguments passed to an underlying function like httr.

Value

Returns a tibble

col_nametypesdescription
game_idcharacterUnique game identifier.
leaguecharacterLeague.
periodintegerPeriod of the game (1-4 quarters; 5+ for OT).
event_numintegerSequential event number within the game (V2 PBP).
clockcharacterGame clock value.
descriptioncharacterLong-form description text.
locXinteger
locYinteger
opt1integerOpt1.
opt2integerOpt2.
event_action_typeintegerNumeric event-action-type code (V2 PBP).
event_typeintegerEvent / play type code (V2 PBP).
team_idintegerUnique team identifier.
offense_team_idintegerUnique identifier for offense team.
player1_idintegerV2 PBP primary player ID (e.g. shooter / fouler).
player2_idintegerV2 PBP secondary player ID (e.g. assister / fouled-by).
player3_idintegerV2 PBP tertiary player ID (e.g. blocker).
home_scoreintegerHome team score at the time of the play.
away_scoreintegerAway team score at the time of the play.
orderintegerDisplay order within the result set.

Event Message Types (event_type):

1 -> MAKE

2 -> MISS

3 -> FreeThrow

4 -> Rebound

5 -> Turnover

6 -> Foul

7 -> Violation

8 -> Substitution

9 -> Timeout

10 -> JumpBall

11 -> Ejection

12 -> StartOfPeriod

13 -> EndOfPeriod

14 -> Empty

Details

 nba_data_pbp(game_id = "0021900001")

Author

Saiem Gilani