An R package that documents the NBA API, providing functions to pull data from stats.nba.com.
Disclaimer: This R package is in no way affiliated with the NBA.
This package is not available on CRAN and needs to be installed from this GitHub repository. To do this you need to run the following:
devtools::install_github("imadmali/NBAapi")
The functions to pull data have the get_*
naming convention. For example if we want to access shot chart data from the "shot chart detail" endpoint we can use get_shotchart(...)
(use the documentation to understand the appropriate arguments). Similarly, if we want play-by-play data we can use the get_pbp(...)
function.
Details on some of the active (and seemingly inactive) endpoints are available here.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.