Skip to main content

An API Client package to access the APIs for NBA.com

Project description

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.10+ 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.season_totals_regular_season.get_data_frame()

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nba_api-1.11.3.tar.gz (175.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nba_api-1.11.3-py3-none-any.whl (319.0 kB view details)

Uploaded Python 3

File details

Details for the file nba_api-1.11.3.tar.gz.

File metadata

  • Download URL: nba_api-1.11.3.tar.gz
  • Upload date:
  • Size: 175.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.18 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for nba_api-1.11.3.tar.gz
Algorithm Hash digest
SHA256 24e98a91561a6a2b6380ae811b3962bdb9574eb91f52c3873c38709160551c09
MD5 06ce3c96fe6d67fb1a12f76d3931d5cc
BLAKE2b-256 810efad600ae85fb86620ccc2a2e668a869ca674e4f01d7d8bf9f39642dd090c

See more details on using hashes here.

File details

Details for the file nba_api-1.11.3-py3-none-any.whl.

File metadata

  • Download URL: nba_api-1.11.3-py3-none-any.whl
  • Upload date:
  • Size: 319.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.18 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for nba_api-1.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a77ec8474446a4289b449c147dd64f9150c07890b8200a25b7da057d738f184
MD5 ff84286bc84e552045e0938c507a15f5
BLAKE2b-256 4068799e2885c6444a18e0f905bdf22986b3d258aea2e22802f86f3688268e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page