Canada Basketball Analytics

How to pull NBA Player Gamelog Data using Python and NBA_API

We’d like to cover off how to pull NBA player game log data using Python and NBA_API. In this example, we look at Jamal Murray’s game log data from the 2019 – 2020 season.

Some prerequisites before continuing are to have the below two installed on your computer.

Anaconda

Anaconda is a free and open-source distribution of the Python and R programming languages for scientific computing that aims to simplify package management and deployment. To download and install please visit the Anaconda homepage.

NBA_API

NBA_API is an API Client package to access the APIs for NBA.com. To install you can use the below command

pip install nba_api

For more information around NBA_API, check them out on GitHub.

The Code

Also available via GitHub.