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
Advanced Stats #128
Comments
I guess you're after this table? It's a relatively easy two-step process to figure this out. First, use your web browser developer tools / inspector to find the API endpoint URL that provides the data for the stats page (tip: filter on XHR requests with 'stats' in the url path). Then look for the endpoint name in the Endpoint documentation. From there you can check out which parameters should be provided to retrieve the data you want. I'm pretty sure you're looking for PlayerGameLogs with the MeasureType set to |
I took a look at the endpoints and nothing about Injury Report jumped out at me. Does anyone know if this tracked in any of the endpoints? |
@jonahbrennan The box score summary has an InactivePlayers data set. I've not seen anything more detailed. |
Perhaps this should be implemented as a search in the documentation. Many times, I will go to the NBA/stats site to look up what stats are available for usage, but I could not find which API endpoint contained that stat and how to differentiate it. More concretely, I couldn't find players' seasonal advanced statistics from this page at the end points: https://stats.nba.com/players/usage/ |
@SpecCRA Are you checking the XHR requests that your browser is making, using inspector / developer tools, when you visit that page? It looks like |
@dwightgunning Where does it shop up in the page inspector? Comparing with this documentation page, it does not give the same set of statistics. |
Unclear what you mean by “it”. In the inspector you have the ‘leaguedashplayerstats’ endpoint and also the query string parameters being sent with the URL (e.g. MeasureType: advanced). These parameters are described on the docs page you also found. So it’s really just a matter of combining the two sources of info to recreate the request with the nba-api. It mght also be useful to start with some simple parameters and get some data coming back. Then refine from there. Hope this helps. |
@dwightgunning Just wanted to say thanks first, and I'll give it a try soon and see how it goes! |
@dwightgunning That worked! I see what I was missing there now. Where in the inspector do you see the endpoints that is associated with nba-api? |
(Keep in mind names of the menus and labels in the UI vary depending on
which browser you are using)
Basically you want the network tab so you can see a list of the HTTP
requests the browser is making. Filter the list on XHR requests to exclude
all the images and stylesheets (etc). Then you can probably filter further
on the host/domain which will include “stats”. When you see a request that
looks like a possibility, check the panels that show the request headers
and the response body to see what’s going on.
On Sun, 9 Feb 2020 at 09:52, Benjamin Xiao ***@***.***> wrote:
@dwightgunning <https://github.com/dwightgunning> That worked! I see what
I was missing there now. Where in the inspector do you see the endpoints
that is associated with nba-api?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#128?email_source=notifications&email_token=AADO3GQMPYFLXV67YDN37YDRB674VA5CNFSM4KOI52M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELGGNRA#issuecomment-583820996>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADO3GX763O3RBA6ERIOR43RB674VANCNFSM4KOI52MQ>
.
--
--
Dwight Gunning
Twitter me: @dwightgunning <https://www.twitter.com/dwightgunning>
|
@dwightgunning I see it. Thanks for the explanation. You just made my stat search process so much easier! |
Great explanation. I suggest everyone use the inspector to figure out what requests are being made when you want to find the specific endpoint that is being called. You can always filter urls for stats and XHR requests to make finding them even easier. That's how a lot of the endpoints were discovered when I first started this package. Closing this out, but feel free to reopen if there are more questions. |
Hi Everyone,
Is there a way to see a players advanced stats for every game in a season? I see there's a boxscoreadvancedstatsv2 endpoint but can't seem to get stats for every game.
The text was updated successfully, but these errors were encountered: