-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get season averages for player #5
Comments
No, it would be pretty inefficient to get season totals through here (parsing the play-by-play of every game every time) rather than storing the possession and game data produced here in a database and using that for whatever you need. |
Sure, to compute the averages from each player/team every time would be inefficient. Thanks! |
No, this package just handles play-by-play data, if you are looking to handle some of the other api endpoints you should try one of the other python nba packages. I don't use any of them so I can't offer advice on which one is best, but I know there are multiple. |
Gabrielfior, to do the page you listed would require n number of player API calls. You can get ALL the players season averages (or per100, totals, etc) with a single API call from this endpoint: https://stats.nba.com/stats/leaguedashplayerstats Provided you have a header with a referrer (now explicitly required by the stats.nba.com site) you can easily just pull this data with requests and Python.
However, if you want someone else's API wrapper, it looks like nba_api is the most kept up and up to date one out there as nba_py looks like it's 4+ years old and may break with some of the changes made by the developers on the stats.nba.com site. |
Is it possible to get the season averages for a player (like here) through a function call? My concrete use-case would be to get season averages (points per game, if possible also shot percentage from each area of floor).
The text was updated successfully, but these errors were encountered: