NBA stats come from balldontlie.io. here's what they say "The #1 API for Live Sports Data and Analytics
Real-time stats, player insights, and game analytics for developers, analysts, and sports enthusiasts."
balldontlie.io provides an API which is used. Step 1, the script retrieves the NBA 30 franchise teams and their identity data is loaded. Step 2, all of the games played are processed against each team one by one determining each team's wins and losses.
it takes a bit of time to process, be patient.
it's very cool. works quite well. and i'm happy they provide this cool stuff. thank you.