statsapi_pbp: Acquire pitch-by-pitch data for Major and Minor League games...

View source: R/statsapi_pbp.R

statsapi_pbpR Documentation

Acquire pitch-by-pitch data for Major and Minor League games via the MLB api http://statsapi.mlb.com/api/

Description

Acquire pitch-by-pitch data for Major and Minor League games via the MLB api http://statsapi.mlb.com/api/

Usage

statsapi_pbp(game_pk)

Arguments

game_pk

The date for which you want to find game_pk values for MLB games

Value

Returns a data frame that includes over 100 columns of data provided by the MLB Stats API at a pitch level.

Some data will vary depending on the park and the league level, as most sensor data is not availble in minor league parks via this API. Note that the column names have mostly been left as-is and there are likely duplicate columns in terms of the information they provide. I plan to clean the output up down the road, but for now I am leaving the majority as-is.

Both major and minor league pitch-by-pitch data can be pulled with this function.

Examples

## Not run: statsapi_pbp(575156)

pontsuyu/mlbR documentation built on March 23, 2023, 6:38 a.m.