Skip to main content

Version: PyPI Downloads per Month: PyPI Build: GitHub Actions License: MIT Slack

nba_api

An API client for NBA.com. nba_api makes the APIs behind NBA.com easy to call from Python and documents them extensively — 130+ stats.nba.com endpoints, the live game data feeds on cdn.nba.com, and bundled player and team reference data.

Installation

pip install nba_api

Requires Python 3.10+. Installs requests, numpy, and pandas.

Quick start

Find a player or team (no HTTP request)

Player and team reference data ships with the package, so lookups are instant and offline.

from nba_api.stats.static import players, teams

players.find_players_by_full_name("jokic")
# [{'id': 203999, 'full_name': 'Nikola Jokić', 'first_name': 'Nikola',
#   'last_name': 'Jokić', 'is_active': True}]

teams.find_team_by_abbreviation("bos")
# {'id': 1610612738, 'full_name': 'Boston Celtics', 'abbreviation': 'BOS', ...}

Searches take case-insensitive regular expressions, and player name searches ignore accents ("jokic" matches "Jokić").

Official stats (stats.nba.com)

from nba_api.stats.endpoints import playercareerstats

career = playercareerstats.PlayerCareerStats(player_id=203999)  # sends the request

career.season_totals_regular_season.get_data_frame()  # one data set as a pandas DataFrame
career.get_data_frames()                              # every data set, as a list of DataFrames
career.get_dict()                                     # the full response as a dict

Every stats endpoint works the same way: constructing it sends the request, and each data set the endpoint returns is available as an attribute with get_data_frame(), get_dict(), and get_json(). See the endpoint reference for each endpoint's parameters and data sets.

Live game data (cdn.nba.com)

from nba_api.live.nba.endpoints import scoreboard

games = scoreboard.ScoreBoard()  # today's games

games.score_board_date
games.games.get_dict()

Live endpoints: ScoreBoard, BoxScore(game_id), PlayByPlay(game_id), and Odds.

Request options

Every endpoint, stats or live, accepts the same request options:

career = playercareerstats.PlayerCareerStats(
    player_id=203999,
    timeout=60,                       # seconds; default 30
    proxy="http://127.0.0.1:8080",    # or a list of proxies to pick from at random
    headers={"User-Agent": "..."},    # replaces the default headers entirely
    get_request=False,                # build the request without sending it
)
career.get_request()                  # send it later

stats.nba.com throttles rapid requests and does not respond to some cloud-hosting IP ranges. If requests hang or time out, add a delay between calls, increase timeout, or route through a proxy. More detail is in the stats examples.

Documentation

Community

  • Slack — join the workspace to get help, help others, share projects, and discuss the API.
  • Stack Overflow — ask questions tagged nba-api.

Contributing

Contributions are welcome. See CONTRIBUTING.md to set up a development environment and open a pull request.

NBA.com does not announce new, changed, or removed endpoints. If you find one, or hit a bug, open an issue.

License and terms of use

nba_api is open source under the MIT License.

Data retrieved with this package comes from NBA.com and is subject to the NBA.com Terms of Use.

Metadata

Release files for nba-api 1.11.6

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.11.6
File Size Uploaded Provenance
nba_api-1.11.6.tar.gz 181.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 508.7 kB

Release files / nba_api-1.11.6.tar.gz

Download URL nba_api-1.11.6.tar.gz
Size 181.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b1aec499b4e8eace67e015188f10762f1d4ad5fbb8276f95ae246d67a51922ef
BLAKE2b-256 checksum
How to use checksums
345f0edf02b797947f7acd629dab6380079b33276e69bc80872f44f5afe92beb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

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

Download URL nba_api-1.11.6-py3-none-any.whl
Size 326.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d929b69f09a3b7d5fdbdbb7457fcad1cf4a4ff1396adc69270f28cb3be762b6e
BLAKE2b-256 checksum
How to use checksums
8d1c0c7342135776769a77214852e259fd8139c2e437fbe2cfcd32f3a54a40db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for nba-api 1.11.6

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nba_api-1.11.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

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.11.6 This release

2 release files Full 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