toddrob99 / MLB-StatsAPI

Python wrapper for MLB Stats API
GNU General Public License v3.0
539 stars 100 forks source link

Get request for 'team_stats' returning 404 #117

Closed pinsondg closed 1 year ago

pinsondg commented 1 year ago

I am calling the team_stats endpoint like so: mlb.get('team_stats', {'teamId': 143, 'season': 2021, 'group': 'pitching'}).

This looks correct according to the documentation. However, every time I call this endpoint I get a 404 response no matter what team, season, or group I use. Is there a workaround function I can use in the meantime? I tried using the 'stats' get api, but not sure how to just get team stats out of that.

pinsondg commented 1 year ago

Nevermind, looked at this issue and it looks like I just needed to add the stats='season' param. Would be helpful if the function added this as a default value if not provided.