Closed andersonericw closed 2 years ago
@andersonericw I think the exception was suppressed in v1.4.1 (see latest commit on this repo), but MLB changed the field name from pitchesThrown
to numberOfPitches
. Therefore, it would just show 0 everywhere. I fixed that in v1.4.2 just now. Please update to the latest version using py -m pip install --upgrade mlb-statsapi
.
That did it! thanks for the quick turnaround
File "/usr/local/lib/python3.9/site-packages/statsapi/init.py", line 749, in boxscore_data boxData[side]["players"]["ID" + pitcherId]["stats"]["pitching"][ KeyError: 'pitchesThrown'
!/usr/bin/env python3
import statsapi import json
games = statsapi.schedule(start_date='04/08/2022',end_date='10/30/2022', team="145")
for i in games: box = statsapi.boxscore_data(i['game_id'], timecode=None)