Skip to contents

Get NBA Stats API play-by-play

Get NBA Stats API play-by-play

Usage

nba_pbp(game_id, on_court = TRUE, version = "v2", p, ...)

Arguments

game_id

Game ID

on_court

IF TRUE will be added ID of players on court

version

Play-by-play version ("v2" available from 2016-17 onwards)

p

Progress bar

...

Additional arguments passed to an underlying function like httr.

Value

Returns a data frame: PlayByPlay

col_nametypes
game_idcharacter
event_numcharacter
event_typecharacter
event_action_typecharacter
periodnumeric
minute_gamenumeric
time_remainingnumeric
wc_time_stringcharacter
time_quartercharacter
minute_remaining_quarternumeric
seconds_remaining_quarternumeric
home_descriptioncharacter
neutral_descriptioncharacter
visitor_descriptioncharacter
scorecharacter
away_scorenumeric
home_scorenumeric
score_margincharacter
person1typecharacter
player1_idcharacter
player1_namecharacter
player1_team_idcharacter
player1_team_citycharacter
player1_team_nicknamecharacter
player1_team_abbreviationcharacter
person2typecharacter
player2_idcharacter
player2_namecharacter
player2_team_idcharacter
player2_team_citycharacter
player2_team_nicknamecharacter
player2_team_abbreviationcharacter
person3typecharacter
player3_idcharacter
player3_namecharacter
player3_team_idcharacter
player3_team_citycharacter
player3_team_nicknamecharacter
player3_team_abbreviationcharacter
video_available_flagcharacter
team_leadingcharacter
away_player1numeric
away_player2numeric
away_player3numeric
away_player4numeric
away_player5numeric
home_player1numeric
home_player2numeric
home_player3numeric
home_player4numeric
home_player5numeric

Details

 nba_pbp(game_id = '0022201086')

See also

Other NBA PBP Functions: nba_data_pbp(), nba_live_pbp(), nba_pbps(), nba_winprobabilitypbp()

Author

Jason Lee