r/NBAanalytics • u/warwick_casual • Dec 07 '25
r/NBAanalytics • u/tkinsey3 • Feb 16 '21
Not only is Luka the best offensive player in his class - he's the best defensive player too (According to TPA)
r/NBAanalytics • u/sportsdata-ai • May 08 '23
AI-based NBA statistical querying tool for NBA data
Hi all, wanted to share a new NBA data tool with you all that can be super useful for statistical analyses.
With Definitive Notebooks you can ask questions about any NBA data related to player boxscores, team boxscores, play-by-play, or aggregated/advanced stats, and it'll run a query for you under the hood. For example, this is much quicker and easier than trying to run a query on basketball-reference:

https://definitive.io/notebooks/NBA-Players-Meeting-Criteria-fdb41672-c421-4016-9d06-880de1f6eb4f
There's data that's REALLY hard to find otherwise, like:
- Which players have James Harden assisted the most in his career?

(https://definitive.io/notebooks/James-Harden's-Top-Assists-7150c52e-b984-4502-8dd2-cd8130ebf972#1)
- Which players have had the most STOCKS in a single postseason game?

The combos are pretty endless, the stats heads on here would really enjoy it!
r/NBAanalytics • u/JerebkosBiggestFan • Nov 30 '25
Dallas' Record Does not Match Their DRTG
This would suggest Dallas should be a 14 win team. Year from hell continues for them. Also OKC...
r/NBAanalytics • u/brothermanpls • Nov 21 '24
yooooooo found a few new NBA endpoints! Plus all the endpoints I use currently
I havent found a new endpoint in forever, but here they are in all their glory:
Daily Lineups: https://stats.nba.com/js/data/leaders/00_daily_lineups_20241121.json
It looks like you can replace that date with anything less than or equal to today's date.
Player Transactions: https://stats.nba.com/js/data/playermovement/NBA_Player_Movement.json
edit: I just found the full regular and preseason schedule as well! https://cdn.nba.com/static/json/staticData/scheduleLeagueV2_1.json
My already known endpoints are:
Gambling Odds: https://cdn.nba.com/static/json/liveData/odds/odds_todaysGames.json
Today's Scoreboard (12pm EST refresh): https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json
*Play by Play: https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022400247.json
*Box Score: https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022400247.json
*Playoff Picture: https://stats.nba.com/stats/playoffbracket?LeagueID=00&SeasonYear=2024&State=0
https://stats.nba.com/stats/playoffbracket?LeagueID=00&SeasonYear=2024&State=1
https://stats.nba.com/stats/playoffbracket?LeagueID=00&SeasonYear=2024&State=2
Broadcasts: https://cdn.nba.com/static/json/liveData/channels/v2/channels_00.json
*Box Score and Play By Play: Replace 22400247 with game_id of desired game For example, to view the Cavs/Celtics game from the other night, replace with 22400021. In most cases, the game_id will be between 2__00001 and - 2__01230. replace __ with the last two digits of the year the season ends in (24, 23, 22, etc...). These two endpoints only go back to 2019-2020 I believe.
Some examples:
https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022400176.json
https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022400196.json
2023: https://cdn.nba.com/static/json/liveData/boxscore/boxscore_0022301170.json
2022: https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_0022200879.json
*Playoff Picture: It's been a minute since i looked at these, so i can't quite recall the difference, but i know one stores the play-in data and one doesn't. State 2 shows everything, but not the play-in if i'm remembering correctly. These three endpoints will return data from 1970 to now.
If you have any questions, i'll try to answer best i can!
r/NBAanalytics • u/[deleted] • Apr 05 '21
NBA Data Science and R tutorials
So last week I posted a question on r/nba about whether people would be interested in R tutorials about NBA Data Analysis. Some people PMed and suggested that I also post my stuff here. If people on this sub are indeed interested, let me know and I'll keep posting here.
The tutorials will be posted on this website https://bookdown.org/NBADSTutorials/nbads/ . There are three sections posted at the moment: Preface, Math/Stats References, and an intro to R. All R code is posted on the site, so you can follow along on your own computers.
There are some things that I will work on in the next couple of days. One is fixing typos. The second is that section 3 is kind of long. I'm trying to figure out how to keep all of the material under section 3, but have subsection broken into different pages. I probably won't make many major updates in the coming days because I'll be busy, but I think I have posted enough material for people to get started and exploring. Data analysis takes practice to get good at, so while I am updating the site, people should have enough time to practice the stuff that I've posted.
If you're a beginner to programming, feedback on stuff like clarity would be helpful. The next update will talk about data visualization (making graphs and charts), NBA advanced stats, and an intro to machine learning and econometrics.
Disclaimer: This website is and will be completely free. I am not promoting or selling a product.
r/NBAanalytics • u/dmaccccc • Sep 10 '20
Using Data Science to prove NBA basketball is 32% Shooting, 32% Opponent's Shooting, 20% Turnovers and 16% Rebounding
I fit basketball to game play to this tree
I ended up determining the 32%/32%/20%/16% property and see it as an alternative to Oliver's four factor approach. I have metrics from each category that using the weighting, can predict total wins at R2 of 0.955 over the 2018-2019 season.
My full interactive write up is here
This is my first time putting the framework out there. Would love to hear the thoughts of other numbers oriented NBA fans.
r/NBAanalytics • u/onelonedatum • Mar 09 '23
Comprehensive NBA Basketball SQLite Database on Kaggle Now Updated — Across 16 tables, includes 30 teams, 4800+ players, 60,000+ games (every game since the inaugural 1946-47 NBA season), Box Scores for over 95% of all games, 13M+ rows of Play-by-Play data, and CSV Table Dumps — Updates Daily 👍
r/NBAanalytics • u/mUmblrman • Dec 25 '24
nba-sql Database v0.1.0 Beta Release
I've just released the beta version v0.1.0 of nba-sql, an app that builds a Postgres/MySQL/MariaDB/SQLite database of NBA stats. You can find the latest GUI version on the GitHub Release page here https://github.com/mpope9/nba-sql/releases/tag/v0.1.0, it is also just a Python app that you can run without the GUI and use from other Python apps. I've personally been loading the SQLite file into DuckDB for analysis.
Here is a small example of how to get Russel Westbrook's triple doubles:
SELECT SUM(td3)FROM player_game_logLEFT JOIN player ON player.player_id = player_game_log.player_idWHERE player.player_name = 'Russell Westbrook';
There are also tables for play_by_play data and shot_chart_detail. I've personally built shot charts with this and head to head player comparisons. More examples on how to query the play_by_play data can be found here.
I've posted this a few times in the r/NBA subreddit but recently they've been blocking my posts sadly so it seems it will fit in here better.
r/NBAanalytics • u/bobarke2000 • Nov 30 '25
Niche NBA data projects
I think it's amazing that Jalen is the most popular name in the NBA these days (by far). So I built JalenWatch to track the performance of the Jalen cohort this season. Includes nightly stats, shot charts, Jalens throughout NBA history, All-Jalen Team; built on the NBA api from rsforbes and others. https://jalenba.vercel.app/ UPDATE: You can now vote for Jalen of the Year!
The writer Chris Thompson wrote about how he likes to watch games with the healthiest rosters (fewest amount of injured players). I liked that idea so I put together "Healthy or Hobbled?" It looks at the latest injury reports and lets you know which games will be the healthiest each night. Also using the NBA api. https://nbainjurywatch.vercel.app/
I'm not super technical so I work with AI to build these projects.

r/NBAanalytics • u/dontpaniclabs • Nov 16 '21
What is the significance of the first 15 games of a team's season?
r/NBAanalytics • u/El_Jefe_Stathole • May 23 '20
NBA Play by Play Scrape
I just finished scraping every play since the 96/97 season from basketball reference and feature engineered it in a tidy format using R. If I posted a tutorial of how I did this, would this be old news for this sub? Also, would love to collab on it to get more data. For instance, I don't have data showing who was in the game at any given point in time - not sure if theres other data out there that could join and show this.
Anyway, I'll take it by upvotes/comments if that's something that would be valued to this sub. Until then, I'll be playing with the data for funny blog posts.
r/NBAanalytics • u/Technical_Branch_662 • Jan 05 '26
NBA Referee Analytics
Interesting look into how referees may shape games.
r/NBAanalytics • u/El_Jefe_Stathole • Jul 16 '20
Introducing NBAScrapR: How to scrape every play of the NBA since the 1996/97 season using R
I posted on here a while back asking if this sub would be interested in such an endeavor and got some positive feedback and ppl chirping me to see when I'd get around to this. Well, I got it done. I created a 13 million plus row database with every single play in the NBA since 96/97.
Here is my YouTube explanation video replete with table of contents addressing the fact that I'm not proclaiming myself to be the best explainer of this but it should be passable enough.
https://www.youtube.com/watch?v=5m7vUNR0-fg&feature=youtu.be
And here is a link to my github in which you can just skip the scrape and take the data. I recommend doing this anyway and not going through scraping yourself to limit the burden on the host site and just using the tutorial as a process learning experience you can adapt to other pages/tables they have.
Here's the full repo with all the code needed for the entire scrape and data wrangling:
https://github.com/Jeffery-777/NBA-PBP-Scrape
Give me some thanks by following my twitter! @ statholesports.
I already used this database to write a comedic article on a guy that missed 35 shots in a row over a number of games and I'll be firing off more in the near future with this baby at hand:
https://www.reddit.com/r/nba/comments/h8vjvx/quarantine_research_finding_theres_no_way_an_nba/
Also, very much welcome recs on columns to add and improvements to anything.
- El Jefe
r/NBAanalytics • u/atoziye_ • Sep 24 '24
Do NBA Draft Combine Metrics Predict NBA Success?
edit: looks like the pics/visualizations aren’t showing up in this post on mobile for some reason, but you can see them here: https://www.formulabot.com/blog/do-nba-draft-combine-metrics-predict-nba-success
Kevin Durant, one of the greatest scorers in NBA history, famously couldn't put up a single rep of 185 on the bench at the combine. That begs the question--do combine metrics matter? Do they meaningfully predict NBA success in any way?
Spoiler alert: not really
Methodology
Data collection:
Combine metrics: I used Python to scrape combine results from 2000-2023 from NBA.com, narrowing down the metrics to max vertical leap, lane agility time, three-quarter court sprint, and bench press. I also wanted to include height and weight, so I calculated height and weight ratios to adjust for height confounding.
NBA success: I decided to operationalize NBA "success" via Bball Index's all-in-one advanced impact metrics, LEBRON, which is further broken down into O-LEBRON and D-LEBRON for offensive and defensive impact, respectively. I scraped all 3 in R to use as outcome variables in my analyses.
Data pre-processing was conducted in R.
Analyses:
I ran linear regression analyses predicting all 3 outcomes from all 6 combine metrics individually (total of 18 models)
I then broke down each analysis by position for a total of 90 models.
I also ran a random forest model predicting the 3 outcomes from all 6 combine metrics combined.
All analyses were conducted using Formula Bot's chat feature. You can view the chat log here.
Results
Linear regression analyses (all positions):
After adjusting for multiple comparisons, only D-LEBRON was significantly associated with select metrics:

Surprisingly, vertical leap was negatively associated with D-LEBRON while slower lane agility and three-quarter court sprint times were associated with D-LEBRON.
Linear regression analyses (by position):
After adjusting for multiple comparisons, no single regression was significant due to small sample sizes and low statistical power.

But if we ignore multiple comparison adjustments, there were some interesting significant effects:
Three-quarter court sprint time was negatively associated with both LEBRON and O-LEBRON (i.e., quicker times, higher LEBRON) for point guards only (not pictured above). The effect size for O-LEBRON was the largest in our entire dataset at -0.38.
Wingspan ratio was positively associated with D-LEBRON for power forwards and especially centers. The effect size for centers was 0.14, which was larger than the effect for any other position.
Here's a more in-depth visualization of the latter effect:

Random forest models:

The LEBRON and O-LEBRON models were terrible fits (i.e., no meaningful prediction), but the D-LEBRON model had a decent fit, with all 6 combine metrics collectively explaining around 8% of the variance in defensive impact.
Takeaways
For offense, three-quarter sprint speed is the only metric that might reliably translate to NBA success—but only for point guards.
For defense, all metrics combined provide a little bit of predictive utility, explaining about 8% of the total variance in D-LEBRON.
Looking at the metrics individually, slow lane agility times and a high weight ratio seem to be the most important overall for D-LEBRON, although there are inconsistent effects (some positive, some negative) depending on position.
Wingspan ratio is the only metric with a consistent positive association with D-LEBRON across all positions. The effect is especially pronounced for centers.
A more in-depth write-up of my analyses and findings is available here: https://www.formulabot.com/blog/do-nba-draft-combine-metrics-predict-nba-success
r/NBAanalytics • u/jzhang621 • Jan 04 '22
LeBron James Does Not Age
LeBron James has been performing at a level in the 19th season of his career that we have never seen before.
Here's BPM plotted against career season number for LeBron vs. the other all-time greats.
More in-depth look here: https://picknscroll.substack.com/p/lebron-james-does-not-age

r/NBAanalytics • u/HieronymusDATA • Jan 01 '22
[OC] Shot blocking without fouling
Recently, I watched an interview with Cavs' rookie Evan Mobley in which he explains what goes through his head while he is defending. He explained that he mostly focuses on staying in front of the attacker and tries to contest shots without fouling. "Fouling out is bad" - Evan Mobley.
So, I got curious about this and thought it would be interesting to see which defenders are skilled at blocking shots without racking up tons of fouls.
This is what I found:

about this plot:
The data is from the 2021-2022 NBA seasons
I only included players with at least 10 blocks in this graph
I only included shooting fouls as offensive fouls do not occur while contesting shots
Data source is basketball-reference.com dating 1-1-2022
r/NBAanalytics • u/kjee1 • Dec 23 '19
How to Get NBA Data Using the nba_api python module (Beginner)
Hey Everyone! I came across this great python package by Shwar Patel (nba_api) and I wanted to share it. I also put together a quick tutorial on the basic steps to getting started. This is an awesome module that can get you pretty much any basketball data that you could ask for. It connects directly to the NBA.com api. Definitely check it out if you are looking for a new data source!
https://www.playingnumbers.com/2019/12/how-to-get-nba-data-using-the-nba_api-python-module-beginner/
r/NBAanalytics • u/Admirable-Drawer-738 • Dec 31 '25
Dec 31 2025 NBA Head to Head Heatmap
NBA graphical standings over time and other graphs at https://hoopsgraphs.com
r/NBAanalytics • u/JJsNBA • Aug 18 '25
Very excited to release JJ's NBAdbToolbox, a program that can create, build and populate a SQL Server database with all NBA data since the 1996 season!
Please check out my GitHub for the download/release page, as well as any documentation you may need! https://github.com/jakesjordan00/NBAdbToolbox/wiki/Documentation
If you're interested and would like any further assistance or have any questions, please reach out to me! My email is [email protected], or you can message me on Reddit.
As for my purpose for creating it, I'll copy what I wrote on GitHub below:
I created the NBAdbToolbox with the idea of "democratizing" NBA game data in a queryable format, with true data integrity.
Back in 2022, I wanted to track down NBA data to learn and enhance my SQL skills, but the program I was using to pull the data seemed to arbitrarily miss lots of records and there wasn't any visibility regarding the accuracy of the data. Over the months and years, I ended up finding the NBA's publicly available endpoints with the Boxscore and PlayByPlay data for every game and used skills I picked up in C# to parse and transform the data myself. I've spent the time since then working on what interested me with the data, but now I want to allow others to be able to do the same, and with even more data.
Whether this will be your first time using SQL, or if you're a master of your craft, my goal is to make this Toolbox work for you. If you want to learn SQL, there's no better way than to use a dataset you're passionate about, and if you're a stathead like me, you can rest assured knowing that you're working with the most up to date and true to source data there is for the NBA.
r/NBAanalytics • u/shaggy_camel • Mar 28 '25
When does tanking begin?
Frustrated with how my Fantasy teams went from formidable forces to flaming piles of shit over night, I dug into injury data to understand at what point in the season tanking begins.
Understanding general tanking behaviour can allow Fantasy leagues to position themselves within the more enjoyable/healthy part of the season.
This plot shows the trend of injury counts for the top 7 players with the most total season minutes, for each team. I've labelled this cohort of players "Starting Players".
Around 75% of the way through the regular season, the rate of starting player injuries changes, becoming very steep and generally marking the beginning of tanking. Although, this point is starting to creep forward. In 2021-23, the injured rate changes around 75%-80% of the way. In 2024-25, the injured rate changes around 60% of the way (although less steep).
When will tanking begin in 2025-26? Let's hope it's not 50% of the way through regular season.
r/NBAanalytics • u/MyPostsStink • Feb 06 '22