toddrob99/MLB-StatsAPI

Pitches per inning

apelt001 opened this issue · 3 comments

Is there an easy way to get pitches per inning for a given gamePk? I can't seem to find out which timecodes correspond to end of innings.

Pitch data is in the game endpoint...

For example, go here: https://statsapi.mlb.com/api/v1.1/game/661722/feed/live and find liveData > plays > allPlays. That is a list of plays in the game, and you'll find the inning in the about dict along with the pitches in the playEvents (list use pitchIndex to know which playEvents are pitches).

Wow this is great, thank you. What about if I just want pitch count per inning by pitcher. Would I have to code that up myself?

I think so... It has total pitches for each pitcher, but not broken down by inning as far as I have seen.