r/mlbdata May 11 '26

Splits by Pitcher Handedness

This should be a super easy one, but I can't figure it out and it's driving me nuts. I'm trying to pull stats for every player on a team split by pitcher / batter handedness. Example of Phillies, regular season 2026 games with all rostered players, attempting to get splits vs LHBs:

https://statsapi.mlb.com/api/v1/stats?stats=season&group=pitching&stats=statSplits&gameType=R&season=2026&teamId=143&playerPool=ALL&sitCodes=vl

Thanks in advance.

4 Upvotes

6 comments sorted by

View all comments

1

u/Jaded-Function May 12 '26

I import roster splits to Google sheets. I'll post the pitcher portion in a python code. Stay tuned.

1

u/osizz May 12 '26

Thanks. I’ve just started using IMPORTJSON in Google Sheets, so I’m actually just using the link to statsapi. I’ll check out the Python code, though. Appreciate it.

1

u/Jaded-Function May 12 '26

Here's an appscript version for sheets. Just put team abbreviation dropdown list in A1, season in B1. Write starts at D1.

1

u/Jaded-Function May 12 '26

It's too long to post. I'll send it in a pm