nba-data-archive / README.md
cdechoch's picture
Add files using upload-large-folder tool
bdd9389 verified
---
license: apache-2.0
pretty_name: NBA Data Archive (1996-2026)
tags:
- basketball
- nba
- sports
- play-by-play
- shot-charts
size_categories:
- 10M<n<100M
---
# NBA Data Archive
Parquet mirror of NBA play-by-play, shot detail, and player-matchup data
from the 1996/97 season through 2025/26.
Built and maintained as the data layer for [HoopsMatic.com](https://hoopsmatic.com)
analytics tools and [HoopsHype](https://hoopshype.com) editorial automation.
Public so other researchers and tinkerers don't have to rebuild the same
pipeline.
## Layout
Two complementary layouts; pick whichever fits your query pattern.
### `per_season/`
One Parquet file per (data type, season, season type). Use this when you
only need a slice — a single season, a recent few years, regular season
only, etc.
```
per_season/shotdetail/2024.parquet # 2024/25 regular season shots
per_season/shotdetail/po_2023.parquet # 2023/24 playoff shots
per_season/matchups/2017.parquet
...
```
### `merged/`
One Parquet file per data type, all seasons + season types concatenated.
Use this when you want to sweep the whole history at once (career-long
shot charts, all-time leaderboards, multi-season trend analysis).
```
merged/shotdetail.parquet
merged/matchups.parquet
merged/nbastats.parquet
merged/nbastatsv3.parquet
merged/pbpstats.parquet
merged/datanba.parquet
merged/cdnnba.parquet
```
Every row in both layouts carries two provenance columns:
- `_season` — int, e.g. `2024` for the 2024/25 season
- `_season_type``"rg"` (regular) or `"po"` (playoffs)
## Data types
| Type | Coverage | Description |
|---|---|---|
| `shotdetail` | 1996/97-2025/26 | Every shot with X/Y court coordinates, distance, make/miss, period, game context |
| `matchups` | 2017/18-2025/26 | Player-vs-player matchup possessions and box-score lines |
| `nbastats` | 1996/97-2024/25 | Classic play-by-play from stats.nba.com |
| `nbastatsv3` | 2020/21-2025/26 | Newer play-by-play schema |
| `pbpstats` | 2000/01-2024/25 | Possession-level data with start-type tags |
| `datanba` | 2016/17-2024/25 | Play-by-play with on-court action coordinates |
| `cdnnba` | 2016/17-2025/26 | Lightweight play-by-play from cdn.nba.com |
Playoff coverage runs through 2024/25; 2025/26 playoffs don't exist yet.
Some sources (`nbastats`, `pbpstats`, `datanba`) don't yet have 2025/26
backfilled upstream.
## Quick start
```python
from datasets import load_dataset
# Load all shots from a single season
ds = load_dataset(
"cdechoch/nba-data-archive",
data_files="per_season/shotdetail/2024.parquet",
split="train",
)
# Or load the full career history of every shot ever
ds = load_dataset(
"cdechoch/nba-data-archive",
data_files="merged/shotdetail.parquet",
split="train",
)
```
Or skip the `datasets` library and read Parquet directly with `pandas` or
`pyarrow` — every file is standard, snappy-compressed Parquet.
## Source and license
Underlying data collected and published by Vladislav Shufinskiy at
[shufinskiy/nba_data](https://github.com/shufinskiy/nba_data) under the
Apache License 2.0. This dataset is the same data converted to Parquet
and redistributed under the same license.
Original upstream sources, in turn: `stats.nba.com`, `data.nba.com`,
`cdn.nba.com`, `pbpstats.com`.
Statistics themselves are not copyrightable
(*Feist Publications v. Rural Telephone Service*, 1991). Player names,
team names, and game data are factual information used in a nominative
reference capacity. No NBA trademarks, logos, or proprietary content are
included.
## Raw archives
The original `.tar.xz` files are mirrored at
[jsierrahoopshype/nba-data-archive](https://github.com/jsierrahoopshype/nba-data-archive)
on GitHub Releases, one release per data type, in case anyone prefers to
work from the CSVs.