Guides
Basketball data, one question at a time
Working Python, JavaScript and cURL for common basketball data questions, each run against the live API with the real response shown.
How do I get NBA play-by-play data in Python?
One call returns a game's plays in order, with shot location, zone, expected points and win probability on each. This pulls the shots from one game into pandas.
get_plays · 10 credits
How do I build an NBA shot chart by zone in Python?
A player's shot profile by zone, with attempts, makes and expected points per shot, for one season. Set include_shots to true to get every shot's x and y as well.
get_shot_chart · 10 credits
How do I backtest NBA closing lines in Python?
A day of games with every sportsbook's opening and closing moneyline, spread and total, next to whether the home side covered and the total went over.
get_odds · 5 credits
How do I compare NBA team pace and efficiency in pandas?
Pace, offensive and defensive rating, net rating and the four factors for all 30 teams in one call, ready to sort and plot.
get_team_stats · 5 credits
How do I get an NBA player's game log and a rolling average?
Every game a player appeared in, with minutes, points, shooting and plus-minus, loaded into pandas for a 10-game rolling average.
get_player_games · 5 credits