--- id: nba-api version: "1.11.4" license: MIT license_treatment: permissive maintenance: active --- # nba_api — An API Client package to access the APIs for NBA.com License: permissive · Maintenance: active · Downloads: 265.1K/mo ## 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 above — verify before relying. nba_api provides Python access to NBA.com's official stats and live game data APIs, returning results as JSON, dictionaries, or pandas DataFrames. 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 pip install nba-api uv add nba-api poetry add nba-api ## Installing nba_api 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. 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() Requires Python 3.10+; pandas must be installed separately to use 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_current - Install friction: low - Maintenance: active - Downloads: 265.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags nba stats api client, basketball data python, nba.com api wrapper, nba live scores api, player career stats api, nba game data python, sports data api, sports-data, rest-api-client [View on SkillFed](https://skillfed.io/packages/nba-api) · [View on PyPI](https://pypi.org/project/nba-api/)