MLB Game Data
Pitch and other game data for 2016-present
@kaggle.josephvm_mlb_game_data
Pitch and other game data for 2016-present
@kaggle.josephvm_mlb_game_data
This dataset currently contains data from the start of the 2016 season through the end of the 2021 postseason. I plan to update it roughly weekly.
pitches.csv is one of the main files. It contains information about each pitch (as found on ESPN, I've noticed some games that are missing some at-bats, with the newest being from 2019 I believe). games.csv and events.csv are two other files of note.
Some of the other files contain information that can be gleamed from the other files. Over time I may try to cut down on this to reduce the number of files. I may also try to reduce the overall size of the dataset by changing several fields to use IDs instead of strings (just a heads-up).
Files
games.csv - general game info
hittersByGame.csv - how each player did in each game
pitchersByGame.csv - how each player did in each game
plays.csv - batter events - batter singled, batter struck out, etc
events.csv - general events - Have event id (per game) to join with next
pitches.csv - one row per pitch per game
inningScore.csv - score per inning
inningHighlights.csv - # of runs, hits, and errors per inning
hittingNotes.csv
pitchingNotes.csv
baserunningNotes.csv
fieldingNotes.csv
letterNotes.csv - for notes attached to batters (and maybe pitchers)
awards directory
-- one file per award
CREATE TABLE baserunningnotes (
"game" BIGINT,
"team" VARCHAR,
"stat" VARCHAR,
"data" VARCHAR
);CREATE TABLE events (
"game" BIGINT,
"pitching_team" VARCHAR,
"batting_team" VARCHAR,
"inning" VARCHAR,
"event_id" BIGINT,
"events" VARCHAR,
"away" VARCHAR,
"home" VARCHAR
);CREATE TABLE fieldingnotes (
"game" BIGINT,
"team" VARCHAR,
"stat" VARCHAR,
"data" VARCHAR
);CREATE TABLE games (
"game" BIGINT,
"away" VARCHAR,
"away_record" VARCHAR,
"awayaway_record" VARCHAR,
"home" VARCHAR,
"home_record" VARCHAR,
"homehome_record" VARCHAR,
"away_score" DOUBLE,
"home_score" DOUBLE,
"postseason_info" VARCHAR,
"walks_issued_away" DOUBLE -- Walks Issued - Away,
"walks_issued_home" DOUBLE -- Walks Issued - Home,
"stolen_bases_away" DOUBLE -- Stolen Bases - Away,
"stolen_bases_home" DOUBLE -- Stolen Bases - Home,
"strikeouts_thrown_away" DOUBLE -- Strikeouts Thrown - Away,
"strikeouts_thrown_home" DOUBLE -- Strikeouts Thrown - Home,
"total_bases_away" DOUBLE -- Total Bases - Away,
"total_bases_home" DOUBLE -- Total Bases - Home,
"stadium" VARCHAR,
"date" VARCHAR,
"location" VARCHAR,
"odds" VARCHAR,
"o_u" VARCHAR,
"attendance" DOUBLE,
"capacity" DOUBLE,
"duration" VARCHAR,
"umpires" VARCHAR,
"win_pitcher_stats" VARCHAR -- WIN - Pitcher - Stats,
"win_pitcher_id" DOUBLE -- WIN - Pitcher - Id,
"win_pitcher_name" VARCHAR -- WIN - Pitcher - Name,
"win_pitcher_abbrname" VARCHAR -- WIN - Pitcher - AbbrName,
"win_pitcher_record" VARCHAR -- WIN - Pitcher - Record,
"loss_pitcher_stats" VARCHAR -- LOSS - Pitcher - Stats,
"loss_pitcher_id" DOUBLE -- LOSS - Pitcher - Id,
"loss_pitcher_name" VARCHAR -- LOSS - Pitcher - Name,
"loss_pitcher_abbrname" VARCHAR -- LOSS - Pitcher - AbbrName,
"loss_pitcher_record" VARCHAR -- LOSS - Pitcher - Record,
"save_pitcher_stats" VARCHAR -- SAVE - Pitcher - Stats,
"save_pitcher_id" DOUBLE -- SAVE - Pitcher - Id,
"save_pitcher_name" VARCHAR -- SAVE - Pitcher - Name,
"save_pitcher_abbrname" VARCHAR -- SAVE - Pitcher - AbbrName,
"save_pitcher_record" VARCHAR -- SAVE - Pitcher - Record,
"extra_innings" VARCHAR
);CREATE TABLE hittersbygame (
"hitters" VARCHAR,
"h_ab" VARCHAR,
"ab" VARCHAR,
"r" VARCHAR,
"h" VARCHAR,
"rbi" VARCHAR,
"bb" VARCHAR,
"k" VARCHAR,
"n__p" VARCHAR -- #P,
"avg" VARCHAR,
"obp" VARCHAR,
"slg" VARCHAR,
"game" BIGINT,
"team" VARCHAR,
"position" VARCHAR,
"hitter_id" VARCHAR
);CREATE TABLE hittingnotes (
"game" BIGINT,
"team" VARCHAR,
"stat" VARCHAR,
"data" VARCHAR
);CREATE TABLE inninghighlights (
"inning" VARCHAR,
"runs" BIGINT,
"hits" BIGINT,
"errors" BIGINT,
"game" BIGINT
);CREATE TABLE inningscore (
"team" VARCHAR,
"n_1" BIGINT -- 1,
"n_2" BIGINT -- 2,
"n_3" BIGINT -- 3,
"n_4" BIGINT -- 4,
"n_5" BIGINT -- 5,
"n_6" VARCHAR -- 6,
"n_7" VARCHAR -- 7,
"n_8" VARCHAR -- 8,
"n_9" VARCHAR -- 9,
"r" BIGINT,
"h" BIGINT,
"e" BIGINT,
"game" BIGINT,
"n_10" DOUBLE -- 10,
"n_11" DOUBLE -- 11,
"n_12" DOUBLE -- 12,
"n_13" DOUBLE -- 13,
"n_14" DOUBLE -- 14,
"n_15" DOUBLE -- 15,
"n_16" DOUBLE -- 16,
"n_17" DOUBLE -- 17,
"n_18" DOUBLE -- 18,
"n_19" DOUBLE -- 19
);CREATE TABLE letternotes (
"game" BIGINT,
"player_id" BIGINT,
"player_note_id" BIGINT,
"note" VARCHAR
);CREATE TABLE pitchersbygame (
"pitchers" VARCHAR,
"ip" DOUBLE,
"h" BIGINT,
"r" BIGINT,
"er" BIGINT,
"bb" BIGINT,
"k" BIGINT,
"hr" BIGINT,
"pc_st" VARCHAR,
"era" VARCHAR,
"pc" VARCHAR,
"game" BIGINT,
"team" VARCHAR,
"extra" VARCHAR,
"pitcher_id" VARCHAR
);CREATE TABLE pitches (
"num" BIGINT,
"pitch" VARCHAR,
"type" VARCHAR,
"mph" VARCHAR,
"play_hitzone" VARCHAR,
"play_bases" DOUBLE,
"play_field" VARCHAR,
"pitcher" VARCHAR,
"pitching_team" VARCHAR,
"batting_team" VARCHAR,
"inning" VARCHAR,
"event_id" BIGINT,
"game" BIGINT
);CREATE TABLE pitchingnotes (
"game" BIGINT,
"team" VARCHAR,
"stat" VARCHAR,
"data" VARCHAR
);CREATE TABLE plays (
"game" BIGINT,
"team" VARCHAR,
"batter_id" VARCHAR,
"batter" VARCHAR,
"event" VARCHAR
);Anyone who has the link will be able to view this.