hoopR is an R package for working with men’s basketball data.
It exports more than 1,300 functions:
-
NBA: the NBA Stats API (
nba_*, about 200 functions), ESPN (espn_nba_*), the NBA G League (nbagl_*), Basketball-Reference (bref_*), RealGM (realgm_*), Fox Sports (fox_nba_*), official.nba.com officiating reports (nba_l2m(),nba_referee_assignments()), salary and mock-draft sources, and cross-source crosswalks. -
Men’s college basketball: ESPN (
espn_mbb_*), Ken Pomeroy’s kenpom.com (kp_*, for users with an active subscription), CollegeBasketballData (cbbd_*), Bart Torvik (torvik_*), the NCAA (ncaa_mbb_*) and Fox Sports (fox_mbb_*). -
International: EuroLeague and EuroCup (
euroleague_*) and about two dozen leagues and competitions, among them FIBA events (fiba_*), Spain’s ACB (acb_*), Italy’s LBA (lba_*), the VTB United League (vtb_*), Japan’s B.LEAGUE (bleague_*), Australia’s NBL (nbl_rosetta_*), Korea’s KBL (kbl_*) and China’s CBA (cba_*). See the function reference for the full list. -
Loaders:
load_nba_*(),load_mbb_*(),load_nba_stats_*()andload_ncaa_mbb_*()read pre-built play-by-play, box score, schedule, shot and model data from thesportsdataverse-datareleases.
Data status
The load_*() functions read release assets on sportsdataverse-data. The badges below are rebuilt nightly from each producer’s latest workflow run and newest release files; idle means the sport is out of season. Full detail: sportsdataverse.org/status.
| Dataset | Data updated | Through | Pipeline | Update workflows |
|---|---|---|---|---|
| Men’s college basketball (ESPN) |
|
|||
| Men’s college basketball (stats.ncaa.org) | ||||
| NBA (ESPN) | ||||
| NBA Stats API |
|
|||
| Conference, division and ballpark reference | — |
Installation
You can install the CRAN version of hoopR with:
install.packages("hoopR")You can install the development version of hoopR from GitHub with:
# You can install using the pak package using the following code:
if (!requireNamespace('pak', quietly = TRUE)){
install.packages('pak')
}
pak::pak("sportsdataverse/hoopR")Quick Start
NBA play-by-play for a season
load_nba_pbp() covers 2002-2027; pass several seasons (or seasons = 2002:2026) to load more at once.
nba_pbp <- hoopR::load_nba_pbp(seasons = 2026)Men’s college basketball play-by-play for a season
load_mbb_pbp() covers 2006-2027.
mbb_pbp <- hoopR::load_mbb_pbp(seasons = 2026)Plotting and related packages
-
sdvplotR(0.3.0,pak::pak("sportsdataverse/sdvplotR")) adds team logos and colours toggplot2charts and draws shot charts from thehoopRshot loaders; see its NBA, men’s college and shot chart articles. -
sportyR(2.4.5,install.packages("sportyR")) draws NBA, NCAA and FIBA courts to plot shot locations on. -
wehoopis the women’s basketball companion (WNBA and women’s college basketball). -
sportsdataverse-pyis the Python package; mosthoopRfunctions have a Python twin of the same name.
Documentation
For more information on the package and function reference, please see the hoopR documentation website.
There is also a printable hoopR cheat sheet (PDF), one of a set covering every SportsDataverse package.
Cheat sheet
A printable one-page reference for hoopR — the function families, the loaders, and what each one returns.
📄 Download the hoopR cheat sheet (PDF)
Free to download, print and hand out; light and dark, US Letter landscape. Every SportsDataverse package has one — browse them all at sportsdataverse.org/cheatsheets.


