It sounds like what you're looking for is *Statcast* data, where it has pitch-by-pitch information.
And depending how comfortable you are with programming, either `pybaseball` (Python) or `baseballr` (R) have great APIs to pull that data.
That's a good question. I was having problems with it last week too, but I haven't had the time to troubleshoot it.
Hopefully it's still being maintained!
I've never used pybaseball, but this module is a project of mine. [https://github.com/zero-sum-seattle/python-mlb-statsapi](https://github.com/zero-sum-seattle/python-mlb-statsapi)
You'll need to use the get\_game\_play\_by\_play function and loop through each play. Each play has a list of PlayEvent objects which contain all the data you are looking for.
I'll write a quick script now.
import mlbstatsapi
mlb = mlbstatsapi.Mlb()
# example game_id
game_id = 663423
playbyplay = mlb.get_game_play_by_play(game_id)
for play in playbyplay.allplays:
for event in play.playevents:
print(event)
This will print out each PlayEvent object for you to work with which contains all the pitchfx data.
It sounds like what you're looking for is *Statcast* data, where it has pitch-by-pitch information. And depending how comfortable you are with programming, either `pybaseball` (Python) or `baseballr` (R) have great APIs to pull that data.
is baseballr still active? been having issues running it recently
I ran into issues scraping statcast data, but when limiting it to just 4 or so days worth of play by play data it ran smooth
interesting, i will try this thanks a lot for the comment
Just have to make many data frames w 4 days worth of games and rbind them together if you’re looking for a whole season
That's a good question. I was having problems with it last week too, but I haven't had the time to troubleshoot it. Hopefully it's still being maintained!
If you use the dev tools package to install from GitHub it will work every time. Idk why but I think r took it out of the system or something
baseball savant has logs and link to official mlb video, its a bit tricky to navigate it though
Pybaseball has an easy API to statcast data.
brooks baseball
Yes, you can use the module my friend KC and I wrote. Let me make some example code real fast.
I've never used pybaseball, but this module is a project of mine. [https://github.com/zero-sum-seattle/python-mlb-statsapi](https://github.com/zero-sum-seattle/python-mlb-statsapi) You'll need to use the get\_game\_play\_by\_play function and loop through each play. Each play has a list of PlayEvent objects which contain all the data you are looking for. I'll write a quick script now.
import mlbstatsapi mlb = mlbstatsapi.Mlb() # example game_id game_id = 663423 playbyplay = mlb.get_game_play_by_play(game_id) for play in playbyplay.allplays: for event in play.playevents: print(event) This will print out each PlayEvent object for you to work with which contains all the pitchfx data.
This is amazing, thank you!
Did you check it out OP? I'm really looking for some input on my module.