NBA Stats API
NBA Stats API
NBA Stats API is the NBA's official game data interface — player/team stats, live scores, play-by-play, player profiles. Free but with informal access rules.
Official authoritative data
Unofficial API (NBA doesn't publish docs — community-reversed)
GET https://stats.nba.com/stats/{endpoint} with required headers (User-Agent + Referer). Python: use nba_api package for ready wrappers.
Uptime · 30-day window
About this API
NBA Stats API is the data interface behind stats.nba.com. NBA doesn't publish API docs (unlike MLB/NHL), but the community has reverse-engineered every endpoint via website XHR requests — player stats, team records, game box scores, play-by-play, shot charts, dozens of endpoints. The Python ecosystem has nba_api package as a wrapper — standard entry point for data science and sports analysis. Key notes: must include User-Agent header (without it, 403), tight rate limits (recommend < 1/sec), endpoints may change without notice (when NBA updates the site, API changes too). Free to use, but for commercial high-volume use, paid sportsdata.io or SportRadar is recommended.
What you can build
- 1NBA data visualization (player comparison dashboards)
- 2Fantasy basketball data source
- 3ML training data for game prediction
- 4Auto-generate stats for sports blogs
Strengths & limitations
Strengths
- Official authoritative data
- Free to use
- Deep historical data (since NBA's 1946 founding)
Limitations
- Unofficial API (NBA doesn't publish docs — community-reversed)
- Tight rate limits, requires legitimate User-Agent
- May change without notice
Example request
curl https://nba.com/<endpoint>Getting started
GET https://stats.nba.com/stats/{endpoint} with required headers (User-Agent + Referer). Python: use nba_api package for ready wrappers.
FAQ
Why doesn't NBA publish an official API?+
Business strategy — NBA monetizes via licensing (Stats LLC, SportRadar). Community-reversed API works but has no SLA.
Can I get real-time scores?+
Yes (boxscoreSummaryV2 and similar), but latency is 1-2 minutes behind official broadcast.
Technical details
- Auth type
- unknown
- Pricing
- unknown
- Protocols
- REST
- SDKs
- python, javascript, go
- Response time
- 752 ms
- Last health check
- 5/12/2026, 7:37:54 AM