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

Playergamelog using dateto and datefrom #34

Closed
Cellular- opened this issue Jan 11, 2019 · 3 comments
Closed

Playergamelog using dateto and datefrom #34

Cellular- opened this issue Jan 11, 2019 · 3 comments
Labels
question Inquiry from community

Comments

@Cellular-
Copy link

Using the playergamelog endpoints, I can retrieve all games for a specific player. However, to reduce repetition and resource use, I want to only retrieve a days worth of games for a player at a time.

To do this, I thought I could pass in values for the DateFrom and DateTo parameters to the PlayerGameLog function. See the endpoint link below:

https://stats.nba.com/stats/playergamelog?DateFrom=2018-12-23&DateTo=2018-12-23&LeagueID=&PlayerID=2544&Season=2018-19&SeasonType=Regular+Season

If I pass in Dec 23,2018, 12/23/2018, 2018-12-23 or 12/23/2018 for the DateFrom and DateTo values. I get either an error or all the games for the player. There is no documentation for this parameter so it's unclear how to retrieve a players game for a specific day.

@swar
Copy link
Owner

swar commented Jan 12, 2019

@swar swar added the question Inquiry from community label Jan 12, 2019
@Cellular-
Copy link
Author

Using MM/DD/YYYY worked. Didn't need to encode slashes either. Not sure why I was getting error but thanks alot. I think adding the default format, MM/DD/YYYY, in the parameter documentation would be helpful for new users.

@swar
Copy link
Owner

swar commented Jan 12, 2019

The only issue with this is that all of the parameter and endpoint documentation is auto-generated. In addition, we would need to confirm if all DateTo and DateFrom fields are all in that format. The NBA API looks like it was slowly built overtime with varying designs, so MM/DD/YYYY might not be valid for every single endpoint with the date fields.

@swar swar closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Inquiry from community
Projects
None yet
Development

No branches or pull requests

2 participants