Gathering the Data

My first step was to gather the location data for each shot. As sports analytics have progressed to the point where nearly every team has a dedicated analytics department, the professional leagues have followed suit and beefed up their stats departments. The NBA provides a bunch of detailed statistics on its website, gathered using Second Spectrum cameras installed in every arena to track the real-time movement of players and the ball. Examples of data gathered from Second Spectrum include speed, distance travelled, paint touches, and more.

Unfortunately, the NBA does not allow API access on its stats page, so I had to dig deeper to find what I was looking for — detailed shot data for every player. On each player’s shot detail page, as seen below, you can view at a variety of shot plots, and sift through spreadsheet with basic details for every shot taken, with an added bonus of seeing a video of each shot with a simple click of the play button.