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:

Bar chart of the 2025-26 NBA assist leaders led by Nikola Jokić at 10.7 assists per game, Cade Cunningham at 9.9, and Luka Dončić at 8.3.
The 2025-26 assist leaders, pulled in one call. Nikola Jokić leads at 10.7 per game, with Cade Cunningham at 9.9. Source: NBA Stats API via nba_api · 2025-26 · retrieved June 2026.

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).

NBA Stats against Basketball-Reference, regular seasons 2004-05 to 2025-26: for each counting stat, the number of player-seasons (of 11,059) where the two sources give a different total, and the number of seasons (of 22) where the league-wide totals match exactly. Our calculation from the NBA Stats API player tables (via nba_api, retrieved September 2026) and Basketball-Reference season totals (fetched November 7, 2026).
StatPlayer-seasons that differSeasons with equal league totals
Points622
Field goals made222
Field goal attempts1415
Threes made022
Three-point attempts319
Free throws made422
Free throw attempts620
Offensive rebounds618
Rebounds2215
Assists1520
Steals1822
Blocks1117
Turnovers1320
Personal fouls220
Games220

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 hoopR package (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:

Free (and partly-free) basketball data sources at a glance.
SourceBest forCostWatch out for
nba_apiEverything current; official stats, no keyFreeRate limits; requests that time out
Basketball-ReferenceHistory, Win Shares, BPM, VORPFreeScraping terms & rate limits
NBA.com/stats (UI)Eyeballing & sanity checksFreeNot automatable
pbpstatsLineups & play-by-play possessionsFreeNarrow scope
Kaggle datasetsPre-cleaned historical bulkFreeOften stale
hoopR / sportsdataverseThe same, but in RFreeR-only ecosystem
Cleaning the Glass / Dunks & ThreesContext, play types, EPMPartly paidBest 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

How this was made

Published by NBAAnalytic from public data and the sources named in this piece. How this site is made · the methodology