26 open-source packages · R · Python · Node.js · 8 leagues in the warehouse · 120M+ rows of play-by-play · EPA · win probability · ratings models · free and open since 2021

College hoops shot locations

College hoops shot locations

Filter a season of men's college basketball play-by-play down to shots with court coordinates.

Every shooting play in the ESPN play-by-play releases carries court coordinates — the raw material for shot charts, without any scraping.

mbb_shots.py

import polars as pl
import sportsdataverse as sdv
 
pbp = sdv.mbb.load_mbb_pbp(seasons=[2025])
 
shots = (
    pbp
    .filter(pl.col("shooting_play") == True)  # noqa: E712 — explicit mask
    .select(
        "game_id",
        "type_text",
        "scoring_play",
        "coordinate_x",
        "coordinate_y",
    )
)
shots.head()

From here it's a scatter plot away from a shot chart. The women's game is the same call in the wnba/wbb namespaces: sdv.wbb.load_wbb_pbp(...).

Full docs: py.sportsdataverse.org