-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Stats endpoint supports startDate and endDate parameters #148
Comments
@vile319 try enabling logging similar to this: import logging
import statsapi
logger = logging.getLogger('statsapi')
logger.setLevel(logging.DEBUG)
rootLogger = logging.getLogger()
rootLogger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s - %(levelname)8s - %(name)s(%(thread)s) - %(message)s")
ch.setFormatter(formatter)
rootLogger.addHandler(ch) Then try again and see if it logs that it's ignoring those parameters. That's most likely what's happening, because I don't see If those parameters are valid, I can add them to the endpoint definition. In the meantime, you can use the |
@toddrob99 Hi Todd, Without force: With force: 2024-10-27 21:01:04,948 - DEBUG - statsapi(24960) - URL: https://statsapi.mlb.com/api/{ver}/stats It does appear to be a valid parameter. Looks like force clears it up, so no worries there. Thanks Todd! Thanks again, |
Fixing in v1.8.1 |
Hi Todd,
.get does not properly apply startDate and endDate. It only does, for example, https://statsapi.mlb.com/api/v1/stats?group=hitting&season=2024&stats=byDateRange
where it should instead be doing:
https://statsapi.mlb.com/api/v1/stats?group=hitting&season=2024&stats=byDateRange&startDate=07/03/2024&endDate=07/10/2024
Let me know if you need more clarification.
Thanks!
Vile
The text was updated successfully, but these errors were encountered: