Skip to main content

Version: PyPI Downloads per Month: PyPY Build: CircleCI License: MIT Slack

nba_api

An API Client Package to Access the APIs of NBA.com

nba_api is an API Client for www.nba.com. This package intends to make the APIs of NBA.com easily accessible and provide extensive documentation about them.

Getting Started

nba_api requires Python 3.7+ along with the requests and numpy packages. While pandas is not required, it is required to work with Pandas DataFrames.

pip install nba_api

NBA Official Stats

from nba_api.stats.endpoints import playercareerstats

# Nikola Jokić
career = playercareerstats.PlayerCareerStats(player_id='203999') 

# pandas data frames (optional: pip install pandas)
career.get_data_frames()[0]

# json
career.get_json()

# dictionary
career.get_dict()

NBA Live Data

from nba_api.live.nba.endpoints import scoreboard

# Today's Score Board
games = scoreboard.ScoreBoard()

# json
games.get_json()

# dictionary
games.get_dict()

Additional Examples

  • Requests/Response Options
    • Proxy Support, Custom Headers, and Timeout Settings
    • Return Types and Raw Responses
  • Static Data Sets
    • Reduce HTTP requests for common and frequently accessed player and team data.
  • Jupyter Notebooks
    • Practical examples in Jupyter Notebook format, including making basic calls, finding games, working with play-by-play data, and interacting with live game data.

Documentation

Join the Community

Slack

Join Slack to get help, help others, provide feedback, see amazing projects, participates in discussions, and collaborate with others from around the world.

Stack Overflow

Not a Slack fan? No problem. Head over to StackOverflow. Be sure to tag your post with nba-api.

Contributing

See Contributing to the NBA_API for complete details.

Endpoints

A significant purpose of this package is to continuously map and analyze as many endpoints on NBA.com as possible. The documentation and analysis of the endpoints and parameters in this package are some of the most extensive information available. At the same time, NBA.com does not provide information regarding new, changed, or removed endpoints.

If you find a new, changed, or deprecated endpoint, open a GitHub Issue

Bugs

Encounter a bug, report a bug.

License & Terms of Use

API Client Package

The nba_api package is Open Source with an MIT License.

NBA.com

NBA.com has a Terms of Use regarding the use of the NBA’s digital platforms.

Metadata

Release files for nba-api 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nba-api 1.5.0
File Size Uploaded Provenance
nba_api-1.5.0.tar.gz 150.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nba-api 1.5.0
File Interpreter ABI Platform
nba_api-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 430.6 kB

Release files / nba_api-1.5.0.tar.gz

Download URL nba_api-1.5.0.tar.gz
Size 150.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8555e29c8035eace3060accbe38f95fe2fc66896c1114f445592ca9e60943f1a
BLAKE2b-256 checksum
How to use checksums
2a879f5d458f0eb301b078e5c1da9ef3299ce794f13deb10bbe783e3c026bb64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.2 Linux/5.15.133.1-microsoft-standard-WSL2

Release files / nba_api-1.5.0-py3-none-any.whl

Download URL nba_api-1.5.0-py3-none-any.whl
Size 280.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b447d1f969f4e74eadfb2b4b32099fa256d50f934441a2d2e80cdbe310c648e
BLAKE2b-256 checksum
How to use checksums
56997aa5d7a41b4407c3b600977b426e6bcb108b9001a0b2f8b6cc832bb7780a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.2 Linux/5.15.133.1-microsoft-standard-WSL2

Security for nba-api 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page