Every basketball analysis you've ever read started with someone getting the numbers from somewhere. That part rarely makes the article, which is a shame, because choosing the wrong data source is how you end up confidently wrong with stale totals. So here is a field guide to the free options: ranked, with the warts.
How we're ranking these
"Best" depends on what you're doing, so we're grading each source on four things: coverage (how much it actually has), reliability (is it current, does it break), ease (how fast you get from "I have a question" to "I have a dataframe"), and cost. We weight free-and-current heavily, because a beautiful dataset that stopped updating in 2023 is a museum piece, not a tool. The order below is roughly how often each one is the right tool.
1. nba_api: the one you should learn first
The nba_api Python package is a wrapper around the same stats endpoints that power NBA.com. It is free, needs no API key, no signup, no credit card held hostage, and it exposes basically everything the league publishes: player and team stats, box scores, shot charts, hustle stats, tracking data, play-by-play. If a number lives on stats.nba.com, you can get it here, usually in one function call.
The catch is access. stats.nba.com rate-limits aggressively and has never documented the rules. Hammer it with rapid-fire requests and you'll get timeouts or empty responses, so you learn to add a polite delay between calls and cache anything you've already fetched. It can also go quiet on a single request: on November 2, 2026 we sent one request each to its hustle-stats and tracking-defense endpoints, with a descriptive user agent and no browser headers, and neither answered; both timed out, after 45 and 90 seconds. Keep your own copies and have a fallback. Live with that and nothing else on this list competes on raw power. If you're starting from zero, we wrote a whole walkthrough on getting it running in getting started with nba_api.
Here's the pitch in one image. We asked for the current assist leaders (a single endpoint call, no scraping, no spreadsheet download) and got this back:

That a center leads the league in assists is its own conversation, but the point here is the plumbing: Jokić's 10.7 dimes, Cade Cunningham's 9.9, and Luka Dončić's 8.3 all arrived from the same request, current as of the June 2026 pull behind this piece, for the cost of zero dollars and about three lines of code.
2. Basketball-Reference: the historical record
If nba_api is the present, Basketball-Reference is the entire past. It is the canonical home of derived metrics the NBA doesn't publish itself (Win Shares, Box Plus/Minus, VORP, PER) going back decades, plus play-by-play, awards, transactions, and roster history that the official API simply doesn't carry. For any question with the word "all-time" in it, this is where we go.
The honest downsides are about access, not data. There's no free official API, so people scrape the HTML, and the site rate-limits and has terms of use about automated access that you should actually read before you point a bot at it. Be a courteous scraper: throttle hard, cache everything, and don't redistribute their data wholesale. Its robots.txt spells out the house rules for bots: wait 3 seconds between requests, and stay off player game logs, splits, on/off, lineup and shooting pages, while the season pages under /leagues/ stay open. Following those rules, we fetched 162 season pages on November 7, 2026, 4.5 seconds apart, and every one came back with status 200. Treated with respect, it's irreplaceable.
Do the two big free sources agree? 22 seasons, checked
A ranking like this usually takes accuracy for granted, so we tested it. For every regular season from 2004-05 to 2025-26 we lined up the league's own player totals (the NBA Stats table that nba_api calls LeagueDashPlayerStats) against Basketball-Reference's season totals pages, from 2004-05 to 2025-26. Both list exactly the same number of players every season, 11,059 player-seasons in all, and every one paired up: 11,005 by name and the other 54 by an identical line of games, points, shots, rebounds and assists. Those 54 are nicknames and short forms (Flip Murray is Ronald Murray on Basketball-Reference), accented spellings (Ömer Aşık, Tibor Pleiß), a few names garbled in the league table (Sun Yue appears as "Sun Sun", Ha Seung-Jin as "Ha Ha"), and three names shared by two different players (Chris Johnson, Marcus Williams, Tony Mitchell).
| Stat | Player-seasons that differ | Seasons with equal league totals |
|---|---|---|
| Points | 6 | 22 |
| Field goals made | 2 | 22 |
| Field goal attempts | 14 | 15 |
| Threes made | 0 | 22 |
| Three-point attempts | 3 | 19 |
| Free throws made | 4 | 22 |
| Free throw attempts | 6 | 20 |
| Offensive rebounds | 6 | 18 |
| Rebounds | 22 | 15 |
| Assists | 15 | 20 |
| Steals | 18 | 22 |
| Blocks | 11 | 17 |
| Turnovers | 13 | 20 |
| Personal fouls | 2 | 20 |
| Games | 2 | 20 |
Of 165,885 stat cells, 124 differ (0.07%), spread over 98 player-seasons. No gap is bigger than 2. In 9 of the 22 seasons every player's line matches exactly, and league-wide points, made field goals, made threes, made free throws and steals match in all 22.
Most of the differences are credit, not counting: the same play given to a different teammate. In 2004-05 Basketball-Reference credits Seattle's Nick Collison with one more made field goal, field goal attempt and offensive rebound (and two more points) than the league table does, and his teammate Vladimir Radmanovic with one fewer of each. The same mirror image shows up for a two-shot free-throw trip between Ben Gordon and Othella Harrington (Chicago, 2005-06) and another between Brandon Clarke and Tyus Jones (Memphis, 2022-23).
Minutes are the one real exception, and only in one season. The league table keeps seconds and Basketball-Reference whole minutes, so we allowed a one-minute gap. Across 21 of the seasons, 16 of 10,595 player-seasons fall outside it, the largest by 6.9 minutes. In 2004-05, 361 of 464 do, by as much as 26.1 minutes. If your question that season runs through minutes (per-36 rates, usage), check both sources.
So for box-score totals, choosing between these two is about access and coverage, not accuracy: they agree on 99.9% of the numbers. The differences that exist are a single basket or a single trip to the line credited to a different teammate.
3. NBA.com/stats, pbpstats, and the rest
Below the top two, the field specializes. A quick rundown of what each is genuinely good for:
- NBA.com/stats (the UI): the same data as nba_api but in a browser. Perfect for eyeballing a leaderboard, filtering by season type, or sanity-checking a number you scripted. Not a pipeline; you can't easily automate the front end. Think of it as the read-only window onto the source nba_api drinks from.
- pbpstats: the one to reach for when the question is about lineups and possessions rather than box-score totals. It does the unglamorous, fiddly work of parsing play-by-play into clean on/off and five-man-unit data, which is genuinely painful to roll yourself. Narrower than nba_api, but excellent at its specialty.
- Kaggle datasets: wonderfully convenient. Someone has already scraped, cleaned, and CSV'd huge swaths of NBA history, and you just download it. The trap is staleness. A Kaggle dataset is a snapshot frozen whenever its uploader last bothered, so it's great for a finished historical season and dangerous for anything current. Always check the last-updated date before you trust it.
- hoopR / sportsdataverse: if you live in R instead of Python, the
hoopRpackage (part of the sportsdataverse family) is the equivalent of nba_api (tidy access to NBA and men's college data, including play-by-play, built for the tidyverse). Same spirit, different language.
The partly-paid tier: Cleaning the Glass & Dunks & Threes
Two sources earn a mention even though they're not fully free, because the analysis is worth it. Cleaning the Glass is the gold standard for context (it strips out garbage time and breaks the game into possessions and play types), but the good stuff sits behind a subscription, with a limited free tier. Dunks & Threes does similar high-quality work, notably on its EPM all-in-one metric, again partly gated. Neither is a bulk-download data source; they're for reading and learning, not for feeding your own scripts.
The short version
If you only remember one row of this table, make it the first one. Here's the whole field at a glance:
| Source | Best for | Cost | Watch out for |
|---|---|---|---|
| nba_api | Everything current; official stats, no key | Free | Rate limits; requests that time out |
| Basketball-Reference | History, Win Shares, BPM, VORP | Free | Scraping terms & rate limits |
| NBA.com/stats (UI) | Eyeballing & sanity checks | Free | Not automatable |
| pbpstats | Lineups & play-by-play possessions | Free | Narrow scope |
| Kaggle datasets | Pre-cleaned historical bulk | Free | Often stale |
| hoopR / sportsdataverse | The same, but in R | Free | R-only ecosystem |
| Cleaning the Glass / Dunks & Threes | Context, play types, EPM | Partly paid | Best data is gated |
Our own pipeline uses two of these sources: nba_api for the league's own tables, and Basketball-Reference for older seasons and the derived metrics the league won't publish. The rest of this list we describe rather than run. If you're starting out, start with the first one. It's free, it needs no key, and what it asks of you is patience between requests and a fallback for the days it doesn't answer.
Sources & Further Reading
- Live assist data and the demo chart: NBA.com/stats, pulled via the nba_api Python package (2025-26, retrieved June 2026). Our own demo script made the chart.
- Historical stats and derived metrics (Win Shares, BPM, VORP): Basketball-Reference.
- Agreement test (added November 10, 2026): the NBA Stats API player totals, 2004-05 to 2025-26 (LeagueDashPlayerStats via nba_api, retrieved September 2026), against Basketball-Reference season totals, 2004-05 to 2025-26 (fetched November 7, 2026, under its robots.txt); computed by our source-agreement script. The stats.nba.com timeouts are from our request log of November 2, 2026.
- Also referenced in prose: pbpstats (lineups & play-by-play), Kaggle datasets, hoopR / sportsdataverse (R), and the partly-paid Cleaning the Glass and Dunks & Threes.