nba_api
An API Client package to access the APIs for NBA.com
Decision gist · record as of 2026-08-14
Yes. nba_api is actively maintained, has low install friction, no security vulnerabilities, permissive MIT licensing, and a stable API surface. Install it if you need programmatic access to NBA.com data; be aware that NBA.com's own Terms of Use may restrict how you use the data, and endpoint availability depends on NBA.com's infrastructure.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10+; pandas must be installed separately to use get_data_frame().
- Low friction install with three common dependencies (numpy, pandas, requests).
- Package is actively maintained with recent commits and 3741 GitHub stars, supporting current Python versions.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the license notice.
last release 2026-02-20 (175 days) · last repo commit 2026-04-06 · 3,741 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 265,069 downloads/mo, #8,330 on PyPI
Alternatives
Verify before relying
pip install nba_api
from nba_api.stats.endpoints import playercareerstats
career = playercareerstats.PlayerCareerStats(player_id='203999')
career.get_data_frame()- Whether NBA.com's Terms of Use impose restrictions on programmatic access or data usage beyond the package's own licensing.
- Rate limiting or throttling policies that may affect production workloads.
- Endpoint stability and how often NBA.com changes or removes endpoints without notice.
What it is and what it does
nba_api is a Python client library that wraps NBA.com's official statistics and live game data endpoints, letting you fetch player career stats, team information, game scores, and play-by-play data without building HTTP requests from scratch. It requires Python 3.10+ and depends on requests for HTTP calls and numpy for data handling; pandas is optional but needed if you want results as DataFrames. The package maps NBA.com endpoints and provides extensive documentation, though NBA.com itself does not publish endpoint specifications, so the maintainers reverse-engineer and document them as they discover changes.
You use it by importing specific endpoints (like PlayerCareerStats or ScoreBoard), instantiating them with parameters, then calling methods like get_json(), get_dict(), or get_data_frame() to retrieve results. It handles proxy support, custom headers, and timeout settings, and includes static data sets for frequently accessed player and team information to reduce HTTP requests. The package is actively maintained, has no known security vulnerabilities, and is permissively licensed under MIT.
Use it for
- Fetch historical player career statistics and season totals for analysis or visualization projects.
- Build a live scoreboard or game tracker that updates with current game scores and play-by-play data.
- Collect team rosters and player metadata for a sports analytics or fantasy basketball application.
- Export NBA stats to pandas DataFrames for statistical modeling or data science workflows.
- Reduce API call overhead by using static player and team data sets instead of repeated endpoint queries.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
nba_api is actively maintained, has low install friction, no security vulnerabilities, permissive MIT licensing, and a stable API surface. Install it if you need programmatic access to NBA.com data; be aware that NBA.com's own Terms of Use may restrict how you use the data, and endpoint availability depends on NBA.com's infrastructure.
Install
nba-api on PyPI
Before you install
Low friction install with three common dependencies (numpy, pandas, requests). Package is actively maintained with recent commits and 3741 GitHub stars, supporting current Python versions.
Requires Python 3.10+; pandas must be installed separately to use get_data_frame().
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the license notice.
Quickstart
pip install nba_api
from nba_api.stats.endpoints import playercareerstats
career = playercareerstats.PlayerCareerStats(player_id='203999')
career.get_data_frame()
Verify before relying
- Whether NBA.com's Terms of Use impose restrictions on programmatic access or data usage beyond the package's own licensing.
- Rate limiting or throttling policies that may affect production workloads.
- Endpoint stability and how often NBA.com changes or removes endpoints without notice.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesnumpypandasrequests |
| Maintenance | Actively maintained 175 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 265,069 / month, #8,330 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development |
Evidence: nba_api-1.11.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “nba stats api client”
- nba_apinba_api provides Python access to NBA.com's official stats and live…
- MLB-StatsAPIProvides Python access to MLB's Stats API, allowing you to query…
- pypistatsQueries the PyPI Stats API to retrieve download statistics for Python…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also MLB-StatsAPI · nflreadpy · statsbombpy · pybaseball · espn-api · nfl-data-py · pypistats · trueskill · benchling-api-client · jsonasobj2