Get ESPN NBA game data (Pbp, Team and Player Box)

espn_nba_game_all(game_id)

Arguments

game_id

Game ID

Value

A named list of data frames: Plays, Team, Player

Author

Saiem Gilani

Examples

# \donttest{
  try(espn_nba_game_all(game_id = 401283399))
#> $Plays
#> # A tibble: 472 × 20
#>    shooting_play sequence_number home_score scoring_play away_score id     text 
#>    <lgl>         <chr>                <int> <lgl>             <int> <chr>  <chr>
#>  1 FALSE         4                        0 FALSE                 0 40128… Isai…
#>  2 TRUE          7                        0 FALSE                 0 40128… Jona…
#>  3 FALSE         8                        0 FALSE                 0 40128… Dari…
#>  4 FALSE         9                        0 FALSE                 0 40128… Dill…
#>  5 TRUE          11                       0 FALSE                 0 40128… Dari…
#>  6 FALSE         12                       0 FALSE                 0 40128… Ja M…
#>  7 TRUE          13                       0 FALSE                 0 40128… Gray…
#>  8 FALSE         14                       0 FALSE                 0 40128… Isai…
#>  9 TRUE          15                       0 TRUE                  3 40128… Shai…
#> 10 FALSE         16                       0 FALSE                 3 40128… Theo…
#> # … with 462 more rows, and 13 more variables: score_value <int>,
#> #   period_display_value <chr>, period_number <int>, coordinate_x <int>,
#> #   coordinate_y <int>, clock_display_value <chr>, team_id <chr>,
#> #   type_id <chr>, type_text <chr>, play_id <chr>, athlete_id_1 <chr>,
#> #   athlete_id_2 <chr>, athlete_id_3 <chr>
#> 
#> $Team
#>     game_id season season_type  game_date team_short_display_name
#> 1 401283399   2021           2 2021-02-18                 Thunder
#> 2 401283399   2021           2 2021-02-18               Grizzlies
#>         team_uid team_alternate_color team_color     team_display_name
#> 1 s:40~l:46~t:25               f05133     C67C03 Oklahoma City Thunder
#> 2 s:40~l:46~t:29               7399c6     5D76A8     Memphis Grizzlies
#>   team_name                                         team_logo team_location
#> 1   Thunder https://a.espncdn.com/i/teamlogos/nba/500/okc.png Oklahoma City
#> 2 Grizzlies https://a.espncdn.com/i/teamlogos/nba/500/mem.png       Memphis
#>   team_id team_abbreviation             team_slug
#> 1      25               OKC oklahoma-city-thunder
#> 2      29               MEM     memphis-grizzlies
#>   field_goals_made_field_goals_attempted field_goal_pct
#> 1                                  35-78           44.9
#> 2                                  42-83           50.6
#>   three_point_field_goals_made_three_point_field_goals_attempted
#> 1                                                          19-41
#> 2                                                          12-26
#>   three_point_field_goal_pct free_throws_made_free_throws_attempted
#> 1                       46.3                                  24-28
#> 2                       46.2                                  26-33
#>   free_throw_pct total_rebounds offensive_rebounds defensive_rebounds assists
#> 1           85.7             43                  6                 33      25
#> 2           78.8             52                  7                 37      31
#>   steals blocks turnovers team_turnovers total_turnovers technical_fouls
#> 1      5      3        18              0              18               0
#> 2     14      4        12              1              13               3
#>   total_technical_fouls flagrant_fouls turnover_points fast_break_points
#> 1                     0              0              23                 5
#> 2                     3              0              17                16
#>   points_in_paint fouls largest_lead home_away opponent_id opponent_name
#> 1              24    25            4      HOME          29       Memphis
#> 2              52    18           15      AWAY          25 Oklahoma City
#>   opponent_mascot opponent_abbrev
#> 1       Grizzlies             MEM
#> 2         Thunder             OKC
#> 
#> $Player
#>       athlete_display_name team_short_display_name min   fg  fg3  ft oreb dreb
#> 1              Isaiah Roby                 Thunder  23  4-9  1-3 1-2    2    6
#> 2            Darius Bazley                 Thunder  32 7-14  4-8 0-0    0    7
#> 3            Luguentz Dort                 Thunder  29 2-10  1-7 6-7    1    1
#> 4  Shai Gilgeous-Alexander                 Thunder  33 6-14  2-5 8-8    1    2
#> 5             Theo Maledon                 Thunder  34  4-7  4-5 2-2    0    5
#> 6           Justin Jackson                 Thunder  10  1-2  1-2 1-2    1    1
#> 7            Darius Miller                 Thunder   9  1-1  1-1 0-0    0    1
#> 8         Kenrich Williams                 Thunder  24  1-1  0-0 0-0    1    4
#> 9             Mike Muscala                 Thunder  26 7-11  5-9 2-2    0    3
#> 10          Hamidou Diallo                 Thunder  20  2-9  0-1 4-5    0    3
#> 11           Kyle Anderson               Grizzlies  26 7-11  2-3 4-6    0    5
#> 12           Dillon Brooks               Grizzlies  30 5-13  0-3 7-7    0    1
#> 13       Jonas Valanciunas               Grizzlies  28 9-12  0-0 4-6    5    7
#> 14               Ja Morant               Grizzlies  35 4-14  0-3 7-8    1   10
#> 15           Grayson Allen               Grizzlies  32 7-13 6-10 2-2    0    4
#> 16          Brandon Clarke               Grizzlies  25  5-8  2-2 0-2    0    6
#> 17          Xavier Tillman               Grizzlies  19  3-4  1-1 0-0    0    2
#> 18              Tyus Jones               Grizzlies  22  0-4  0-1 0-0    1    1
#> 19            John Konchar               Grizzlies   6  1-2  0-1 0-0    0    0
#> 20          Sean McDermott               Grizzlies  17  1-2  1-2 2-2    0    1
#>    reb ast stl blk to pf +/- pts starter ejected did_not_play active
#> 1    8   4   2   0  2  6  -6  10    TRUE   FALSE        FALSE  FALSE
#> 2    7   2   0   0  2  0 -10  18    TRUE   FALSE        FALSE   TRUE
#> 3    2   1   0   1  2  3 -15  11    TRUE   FALSE        FALSE  FALSE
#> 4    3   6   0   0  1  2  -2  22    TRUE   FALSE        FALSE  FALSE
#> 5    5   2   2   0  3  3  -1  14    TRUE   FALSE        FALSE   TRUE
#> 6    2   1   0   1  4  1  -3   4   FALSE   FALSE        FALSE  FALSE
#> 7    1   2   0   1  1  1  -4   3   FALSE   FALSE        FALSE   TRUE
#> 8    5   3   1   0  0  2  +6   2   FALSE   FALSE        FALSE   TRUE
#> 9    3   0   0   0  1  5  -4  21   FALSE   FALSE        FALSE  FALSE
#> 10   3   4   0   0  2  2  -6   8   FALSE   FALSE        FALSE   TRUE
#> 11   5   5   5   1  1  2 +15  20    TRUE   FALSE        FALSE  FALSE
#> 12   1   1   1   0  2  5 +14  17    TRUE   FALSE        FALSE   TRUE
#> 13  12   2   0   1  2  4 +17  22    TRUE   FALSE        FALSE   TRUE
#> 14  11  12   1   0  3  0  +5  15    TRUE   FALSE        FALSE   TRUE
#> 15   4   3   1   0  0  2   0  22    TRUE   FALSE        FALSE   TRUE
#> 16   6   2   2   2  2  1  -9  12   FALSE   FALSE        FALSE   TRUE
#> 17   2   2   1   0  1  1  -5   7   FALSE   FALSE        FALSE  FALSE
#> 18   2   4   1   0  0  0 +13   0   FALSE   FALSE        FALSE  FALSE
#> 19   0   0   1   0  1  1 -13   2   FALSE   FALSE        FALSE  FALSE
#> 20   1   0   1   0  0  2  +8   5   FALSE   FALSE        FALSE  FALSE
#>    athlete_jersey athlete_id    athlete_short_name
#> 1              22    4066392               I. Roby
#> 2               7    4423545             D. Bazley
#> 3               5    4397020               L. Dort
#> 4               2    4278073 S. Gilgeous-Alexander
#> 5              11    4683027            T. Maledon
#> 6              44    3138156            J. Jackson
#> 7              12       6610             D. Miller
#> 8              34    3133626           K. Williams
#> 9              33    2490089            M. Muscala
#> 10              6    4080610             H. Diallo
#> 11              1    2993874           K. Anderson
#> 12             24    3155526             D. Brooks
#> 13             17       6477        J. Valanciunas
#> 14             12    4279888             J. Morant
#> 15              7    3135045              G. Allen
#> 16             15    3906665             B. Clarke
#> 17              2    4277964            X. Tillman
#> 18             21    3135046              T. Jones
#> 19             46    3134932            J. Konchar
#> 20             30    3908903          S. McDermott
#>                                             athlete_headshot_href
#> 1  https://a.espncdn.com/i/headshots/nba/players/full/4066392.png
#> 2  https://a.espncdn.com/i/headshots/nba/players/full/4423545.png
#> 3  https://a.espncdn.com/i/headshots/nba/players/full/4397020.png
#> 4  https://a.espncdn.com/i/headshots/nba/players/full/4278073.png
#> 5  https://a.espncdn.com/i/headshots/nba/players/full/4683027.png
#> 6  https://a.espncdn.com/i/headshots/nba/players/full/3138156.png
#> 7     https://a.espncdn.com/i/headshots/nba/players/full/6610.png
#> 8  https://a.espncdn.com/i/headshots/nba/players/full/3133626.png
#> 9  https://a.espncdn.com/i/headshots/nba/players/full/2490089.png
#> 10 https://a.espncdn.com/i/headshots/nba/players/full/4080610.png
#> 11 https://a.espncdn.com/i/headshots/nba/players/full/2993874.png
#> 12 https://a.espncdn.com/i/headshots/nba/players/full/3155526.png
#> 13    https://a.espncdn.com/i/headshots/nba/players/full/6477.png
#> 14 https://a.espncdn.com/i/headshots/nba/players/full/4279888.png
#> 15 https://a.espncdn.com/i/headshots/nba/players/full/3135045.png
#> 16 https://a.espncdn.com/i/headshots/nba/players/full/3906665.png
#> 17 https://a.espncdn.com/i/headshots/nba/players/full/4277964.png
#> 18 https://a.espncdn.com/i/headshots/nba/players/full/3135046.png
#> 19 https://a.espncdn.com/i/headshots/nba/players/full/3134932.png
#> 20 https://a.espncdn.com/i/headshots/nba/players/full/3908903.png
#>    athlete_position_name athlete_position_abbreviation team_name
#> 1          Power Forward                            PF   Thunder
#> 2          Power Forward                            PF   Thunder
#> 3          Small Forward                            SF   Thunder
#> 4            Point Guard                            PG   Thunder
#> 5            Point Guard                            PG   Thunder
#> 6                Forward                             F   Thunder
#> 7          Small Forward                            SF   Thunder
#> 8          Small Forward                            SF   Thunder
#> 9                 Center                             C   Thunder
#> 10        Shooting Guard                            SG   Thunder
#> 11         Small Forward                            SF Grizzlies
#> 12         Small Forward                            SF Grizzlies
#> 13                Center                             C Grizzlies
#> 14           Point Guard                            PG Grizzlies
#> 15        Shooting Guard                            SG Grizzlies
#> 16         Power Forward                            PF Grizzlies
#> 17                Center                             C Grizzlies
#> 18           Point Guard                            PG Grizzlies
#> 19        Shooting Guard                            SG Grizzlies
#> 20        Shooting Guard                            SG Grizzlies
#>                                            team_logo team_id team_abbreviation
#> 1  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 2  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 3  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 4  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 5  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 6  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 7  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 8  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 9  https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 10 https://a.espncdn.com/i/teamlogos/nba/500/okc.png      25               OKC
#> 11 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 12 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 13 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 14 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 15 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 16 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 17 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 18 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 19 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#> 20 https://a.espncdn.com/i/teamlogos/nba/500/mem.png      29               MEM
#>    team_color team_alternate_color
#> 1      C67C03               f05133
#> 2      C67C03               f05133
#> 3      C67C03               f05133
#> 4      C67C03               f05133
#> 5      C67C03               f05133
#> 6      C67C03               f05133
#> 7      C67C03               f05133
#> 8      C67C03               f05133
#> 9      C67C03               f05133
#> 10     C67C03               f05133
#> 11     5D76A8               7399c6
#> 12     5D76A8               7399c6
#> 13     5D76A8               7399c6
#> 14     5D76A8               7399c6
#> 15     5D76A8               7399c6
#> 16     5D76A8               7399c6
#> 17     5D76A8               7399c6
#> 18     5D76A8               7399c6
#> 19     5D76A8               7399c6
#> 20     5D76A8               7399c6
#> 
# }