# nba_api (NBA Stats)

> MIT-licensed Python package wrapping many unofficial NBA.com stats endpoints, returning data for games, players and teams; not an official or hosted API.

Canonical page: https://sportdex.net/providers/nba-api/  
Last checked: 2026-11-03  
SportDex Score: 63/100 (rank 12; popularity 62, community 49, transparency 75, developer experience 70)

## Facts
- Type: Free / open data
- Website: https://github.com/swar/nba_api
- Documentation: https://github.com/swar/nba_api
- Pricing page: unknown
- Sports: Basketball
- Data types: Historical data, Play-by-play, Player stats, Live scores, Standings, Team stats
- Protocols: SDK only
- Delivery: SDK only
- Live / in-play: yes
- Free tier: yes
- Cheapest public paid plan: not public
- Key competitions: NBA
- Authentication: none
- SDKs: python

## Plans
| Plan | Price | Requests | Notes |
|---|---|---|---|
| Free (MIT) | Free | — | Open-source client; depends on NBA.com availability and terms |

## Who it is for

Best for: Python developers who want a free wrapper around NBA.com stats endpoints for games, players, teams and play-by-play.

Not ideal for: Production services needing guarantees or clear data rights; it is an unofficial client with no hosted service and no stated rights to the NBA data.

Use cases: NBA stats analysis in Python; Player and team dashboards; Historical NBA research

Limitations:
- Python client only, no hosted API
- Wraps undocumented NBA.com endpoints
- MIT licence covers code only, not the data
- Basketball (NBA) only

## Quick answers

**What is nba_api (NBA Stats) best for?** Python developers who want a free wrapper around NBA.com stats endpoints for games, players, teams and play-by-play. Not ideal for: Production services needing guarantees or clear data rights; it is an unofficial client with no hosted service and no stated rights to the NBA data.

**How much does nba_api (NBA Stats) cost?** nba_api (NBA Stats) does not publish prices on the pages we checked.

**Does nba_api (NBA Stats) have a free tier?** Yes. nba_api (NBA Stats) lists a free plan called "Free (MIT)".

**What does nba_api (NBA Stats) cover?** nba_api (NBA Stats) is a free / open data. Its sports: Basketball; data: Historical data, Play-by-play, Player stats, Live scores, Standings, Team stats. Live / in-play data is offered.

**Does nba_api (NBA Stats) have a WebSocket or streaming API?** No streaming is listed. nba_api (NBA Stats) delivers data by SDK only, so you poll for updates.

**What do developers say about nba_api (NBA Stats)?** Unofficial Python wrapper around NBA.com stats endpoints, widely used in Reddit data-viz posts, tutorials and many GitHub projects. Users like the clear docs and easy start, but report that NBA header changes break endpoints, timeouts occur, and 2025-26 pulls stopped working for some. Alternatives mentioned: balldontlie, API-Sports; commercial use raises legal questions.

**What are the alternatives to nba_api (NBA Stats)?** Close alternatives in the SportDex catalog: DunkAPI, NBA Stats (stats.nba.com), Sportradar, FastballAPI, NHL Web API (unofficial docs).

## What developers say

Unofficial Python wrapper around NBA.com stats endpoints, widely used in Reddit data-viz posts, tutorials and many GitHub projects. Users like the clear docs and easy start, but report that NBA header changes break endpoints, timeouts occur, and 2025-26 pulls stopped working for some. Alternatives mentioned: balldontlie, API-Sports; commercial use raises legal questions.

Praised for: Easy to use with good docs; Large community and many projects built on it; Free

Complaints: Breaks when NBA changes headers or blocks requests; Bulk pulls are slow or time out; Unofficial, so legal/commercial use is unclear

## Method
Facts were read from the provider's own pages on 2026-11-03. Empty fields mean the provider does not say, not that a feature is missing. Method: https://sportdex.net/methodology/
