Skip to content
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

PlayerGameLogs appears to return 2016-17 data regardless of what's passed in #99

Closed
jredwards opened this issue Nov 14, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@jredwards
Copy link

Doesn't appear to matter how the call is structured, whether you're filtering to a player, a team, or trying to filter to a season. The team parameter works. The player parameter works. The season parameter does not work and the API call returns data from 2016-17 always.

This is specifically the new playergamelogs (plural) endpoint that was added this past weekend.

@jredwards
Copy link
Author

I guess I should add: as far as I can tell, this is an issue with the API endpoint itself and not this library. This may be an obvious close, but I thought it was worth pointing out that this was happening.

@swar swar added the question Inquiry from community label Nov 14, 2019
@swar
Copy link
Owner

swar commented Nov 14, 2019

What code are you trying to use?

I am able to get it to work via browser for different seasons: https://stats.nba.com/player/2544/boxscores-advanced/?Season=2012-13&SeasonType=Regular%20Season

@jredwards
Copy link
Author

That's boxscores advanced. I'm specifically referring to this endpoint:
https://github.com/swar/nba_api/blob/master/docs/nba_api/stats/endpoints/playergamelogs.md

Using the library you can make a call like: playergamelogs.PlayerGameLogs(player_id_nullable=203076)
or
playergamelogs.PlayerGameLogs(team_id_nullable=1610612737)
or
playergamelogs.PlayerGameLogs(team_id_nullable=1610612737,season_nullable='2015-16') (I'm actually not sure if that's how season is supposed to be passed. I also tried passing season IDs)

Regardless of how you make the call, you'll get 2016-17 data.

@swar
Copy link
Owner

swar commented Nov 15, 2019

I figured out the issue. The endpoint for that page says that "Season" should be "SeasonYear", unfortunately it only accepts "Season" as a valid parameter. nba_api is assuming it is SeasonYear because that's what the response is indicating. You can work around this issue by doing the following:

raw_data = playergamelogs.PlayerGameLogs(player_id_nullable=2544, get_request=False)
raw_data.parameters['Season'] = '2012-13'
raw_data.get_request()

This will be marked as a bug and fixed in an upcoming release. Just need to find some free time.

@swar swar added bug Something isn't working and removed question Inquiry from community labels Nov 15, 2019
d-malko pushed a commit to d-malko/nba_api that referenced this issue Dec 7, 2019
@d-malko
Copy link

d-malko commented Dec 7, 2019

Fixed this issue and added PR.
#112

@swar
Copy link
Owner

swar commented Dec 19, 2019

The fix needs to be implemented in the tool that analyzes endpoints instead of the file because this fix is just temporary and will be overwritten during the next version update prior to analyzing the endpoints.

@swar
Copy link
Owner

swar commented Jan 27, 2020

Fixed as of v1.1.8.

@swar swar closed this as completed Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants