Compare
DunkAPI vs nba_api and stats.nba.com
nba_api wraps unofficial stats.nba.com endpoints that are rate limited and often block cloud IPs. DunkAPI is a documented API that runs from a server or an agent.
nba_api is a free Python package that wraps the NBA's own stats.nba.com endpoints. Those endpoints are not a documented public API, they are rate limited, and requests from cloud provider IP ranges are often blocked, so code that runs on a laptop can fail once deployed. DunkAPI serves NBA play-by-play with shot locations, box scores, standings and lines over a documented REST API and an MCP server, built on public ESPN data.
The tradeoff is breadth against stability. stats.nba.com exposes more tracking-style fields than we do. DunkAPI has fewer fields and a contract that does not change underneath you.
Side by side
| DunkAPI | nba_api and stats.nba.com | |
|---|---|---|
| Price | 500 free credits, no card, then paid plans | Free |
| Status | Documented API with a versioned contract | Unofficial; endpoints can change without notice |
| Cloud hosting | Works from any server | Requests from cloud IPs are often blocked |
| Rate limits | Credit-based and published | Unpublished and enforced by the host |
| Language | Any: HTTP and MCP | Python package |
| Sportsbook lines | 4 to 12 books per regular-season game from 2013-14 to 2023-24 (10 to 12 from 2020-21) | None |
| Field breadth | Box scores, plays with shot locations, our ratings | A wider set of endpoints, including tracking-style stats |
| Other leagues | WNBA and Division I college basketball | Includes WNBA and G League endpoints; check the package docs |
Use nba_api and stats.nba.com instead if
- You are running a notebook on your own machine and want the widest set of NBA fields at no cost.
- You need a stats.nba.com field, such as player tracking aggregates, that we do not carry.
- You already have a working pipeline on nba_api and the occasional break is acceptable.
Questions
Is there an official NBA API?
The NBA does not publish a documented public API for stats. nba_api wraps the endpoints its own site uses, which are unofficial and can change.
Why does nba_api time out on a server?
stats.nba.com is known to throttle or block requests from cloud provider IP ranges, so code that works locally can fail when deployed. DunkAPI has no such restriction.
Sources
Checked October 7, 2026.
See the data
Try it with 500 free credits
No card. REST or MCP.