Skip to main content

MLB — MLB Stats API — Home

mlb_home_run_derby​

View a home run derby object based on gamePk.

Endpoint URL: GET https://statsapi.mlb.com/api/v1/homeRunDerby/{game_pk}

Valid URL: https://statsapi.mlb.com/api/v1/homeRunDerby/511101

API ParameterPythonPatternRequiredNullableDescription
game_pkgame_pkYgame_pk path parameter.
fieldsfieldsYfields query parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerId.
full_namecharacterPlayer's full name.
linkcharacterAPI link to the game feed.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
primary_numbercharacterPlayer uniform number.
birth_datecharacterDate of birth (YYYY-MM-DD).
current_ageintegerCurrent age in years.
birth_citycharacterCity of birth.
birth_state_provincecharacterState or province of birth.
birth_countrycharacterCountry of birth.
heightcharacterHeight (feet and inches).
weightintegerWeight in pounds.
activelogicalWhether the player is currently active.
use_namecharacterPreferred first name.
use_last_namecharacterPreferred last name.
middle_namecharacterPlayer middle name.
boxscore_namecharacterName as shown in box scores.
nick_namecharacterPlayer nickname.
gendercharacterPlayer gender.
is_playerlogicalWhether the person is a player.
is_verifiedlogicalWhether the player profile is verified.
draft_yeardoubleYear the player was drafted.
pronunciationcharacterPhonetic name pronunciation.
statscharacterStats.
mlb_debut_datecharacterMLB debut date (YYYY-MM-DD).
name_first_lastcharacterName in first-last order.
name_slugcharacterURL-friendly name slug.
first_last_namecharacterFirst and last name.
last_first_namecharacterName in last, first order.
last_init_namecharacterLast name with first initial.
init_last_namecharacterFirst initial with last name.
full_fml_namecharacterFull name (first-middle-last).
full_lfm_namecharacterFull name (last-first-middle).
strike_zone_topdoubleTop of the player's strike zone (feet).
strike_zone_bottomdoubleBottom of the player's strike zone (feet).
current_team_spring_league_iddoubleThe MLB Stats API numeric identifier for the spring training league of the player's current team.
current_team_spring_league_namecharacterThe full name of the spring training league (e.g., 'Cactus League') for the player's current team.
current_team_spring_league_linkcharacterThe MLB Stats API relative URL linking to the spring training league resource for the player's current team.
current_team_spring_league_abbreviationcharacterThe abbreviation for the Cactus League or Grapefruit League in which the player's current team participates during spring training.
current_team_all_star_statuscharacterThe All-Star designation status of the player's current team (e.g., which league's All-Star pool the team belongs to).
current_team_idintegerCurrent team MLBAM ID.
current_team_namecharacterCurrent team name.
current_team_linkcharacterAPI link to the current team.
current_team_seasonintegerThe MLB season year for which the player's current team metadata is reported.
current_team_venue_idintegerThe MLB Stats API numeric identifier for the regular-season home ballpark of the player's current team.
current_team_venue_namecharacterThe official name of the regular-season home ballpark for the player's current team.
current_team_venue_linkcharacterThe MLB Stats API relative URL linking to the regular-season venue resource for the player's current team.
current_team_spring_venue_iddoubleThe MLB Stats API numeric identifier for the spring training ballpark used by the player's current team.
current_team_spring_venue_linkcharacterThe MLB Stats API relative URL linking to the spring training venue resource for the player's current team.
current_team_team_codecharacterThe three-letter internal team code used by MLB in legacy data systems and some API references.
current_team_file_codecharacterThe lowercase alphabetic file code used by MLB for identifying the team in media and data assets.
current_team_abbreviationcharacterThe standard two- or three-letter abbreviation for the player's current MLB team (e.g., 'NYY', 'LAD').
current_team_team_namecharacterThe full official name of the player's current team, including both city and nickname.
current_team_location_namecharacterThe city or metropolitan area name associated with the player's current team.
current_team_first_year_of_playcharacterThe calendar year in which the player's current franchise first played MLB games.
current_team_league_idintegerThe MLB Stats API numeric identifier for the league (American League or National League) of the player's current team.
current_team_league_namecharacterThe full name of the league (e.g., 'American League') in which the player's current team competes.
current_team_league_linkcharacterThe MLB Stats API relative URL linking to the league resource for the player's current team.
current_team_division_iddoubleThe MLB Stats API numeric identifier for the division in which the player's current team competes.
current_team_division_namecharacterThe full name of the division in which the player's current team competes (e.g., 'American League East').
current_team_division_linkcharacterThe MLB Stats API relative URL linking to the division resource for the player's current team.
current_team_sport_idintegerThe MLB Stats API numeric identifier for the sport classification (e.g., 1 for MLB) of the player's current team.
current_team_sport_linkcharacterThe MLB Stats API relative URL linking to the sport resource associated with the player's current team.
current_team_sport_namecharacterThe name of the sport classification for the player's current team (e.g., 'Major League Baseball').
current_team_short_namecharacterA shortened display name for the player's current team, often used in space-constrained UI contexts.
current_team_franchise_namecharacterThe historical franchise name for the player's current team, which may differ from the current team name for relocated clubs.
current_team_club_namecharacterThe short club nickname for the player's current team, typically the city-less portion of the franchise name.
current_team_activelogicalBoolean flag indicating whether the player's current team is an active MLB franchise.
primary_position_codecharacterPrimary position code.
primary_position_namecharacterPrimary fielding position name.
primary_position_typecharacterPrimary position type (e.g. Infielder).
primary_position_abbreviationcharacterPrimary position abbreviation.
bat_side_codecharacterBatting side code (L/R/S).
bat_side_descriptioncharacterBatting side description.
pitch_hand_codecharacterThrowing hand code (L/R).
pitch_hand_descriptioncharacterThrowing hand description.
last_played_datecharacterDate of last MLB game played.
name_matrilinealcharacterMaternal family name.
current_team_parent_org_namecharacterThe name of the parent major-league organization for the player's current team.
current_team_parent_org_iddoubleThe MLB Stats API numeric identifier for the parent organization (major-league affiliate) of the player's current team.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example​

mlb_home_run_derby(game_pk=511101)

Last validated n/a.

mlb_home_run_derby_bracket​

View a home run derby object based on bracket.

Endpoint URL: GET https://statsapi.mlb.com/api/v1/homeRunDerby/{game_pk}/bracket

Valid URL: https://statsapi.mlb.com/api/v1/homeRunDerby/511101/bracket

API ParameterPythonPatternRequiredNullableDescription
game_pkgame_pkYgame_pk path parameter.
fieldsfieldsYfields query parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerId.
full_namecharacterPlayer's full name.
linkcharacterAPI link to the game feed.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
primary_numbercharacterPlayer uniform number.
birth_datecharacterDate of birth (YYYY-MM-DD).
current_ageintegerCurrent age in years.
birth_citycharacterCity of birth.
birth_state_provincecharacterState or province of birth.
birth_countrycharacterCountry of birth.
heightcharacterHeight (feet and inches).
weightintegerWeight in pounds.
activelogicalWhether the player is currently active.
use_namecharacterPreferred first name.
use_last_namecharacterPreferred last name.
middle_namecharacterPlayer middle name.
boxscore_namecharacterName as shown in box scores.
nick_namecharacterPlayer nickname.
gendercharacterPlayer gender.
is_playerlogicalWhether the person is a player.
is_verifiedlogicalWhether the player profile is verified.
draft_yeardoubleYear the player was drafted.
pronunciationcharacterPhonetic name pronunciation.
statscharacterStats.
mlb_debut_datecharacterMLB debut date (YYYY-MM-DD).
name_first_lastcharacterName in first-last order.
name_slugcharacterURL-friendly name slug.
first_last_namecharacterFirst and last name.
last_first_namecharacterName in last, first order.
last_init_namecharacterLast name with first initial.
init_last_namecharacterFirst initial with last name.
full_fml_namecharacterFull name (first-middle-last).
full_lfm_namecharacterFull name (last-first-middle).
strike_zone_topdoubleTop of the player's strike zone (feet).
strike_zone_bottomdoubleBottom of the player's strike zone (feet).
current_team_spring_league_iddoubleMLB Stats API identifier for the spring training league of the participant's current team.
current_team_spring_league_namecharacterFull name of the spring training league the participant's team belongs to.
current_team_spring_league_linkcharacterRelative URL path to the spring training league resource in the MLB Stats API.
current_team_spring_league_abbreviationcharacterAbbreviation for the spring training league the participant's team belongs to (e.g., Cactus, Grapefruit).
current_team_all_star_statuscharacterAll-Star game league affiliation of the participant's current team (e.g., American League, National League).
current_team_idintegerCurrent team MLBAM ID.
current_team_namecharacterCurrent team name.
current_team_linkcharacterAPI link to the current team.
current_team_seasonintegerMLB season year for which the participant's current team metadata snapshot applies.
current_team_venue_idintegerMLB Stats API identifier for the participant's current team's regular-season home ballpark.
current_team_venue_namecharacterName of the participant's current team's regular-season home ballpark.
current_team_venue_linkcharacterRelative URL path to the current team's home venue resource in the MLB Stats API.
current_team_spring_venue_iddoubleMLB Stats API identifier for the spring training ballpark used by the participant's team.
current_team_spring_venue_linkcharacterRelative URL path to the spring training venue resource in the MLB Stats API.
current_team_team_codecharacterShort internal code used by MLB to identify the participant's current team in system contexts.
current_team_file_codecharacterLowercase file-system-safe code used by MLB to identify the participant's current team.
current_team_abbreviationcharacterStandard two- or three-letter abbreviation for the Home Run Derby participant's current MLB team.
current_team_team_namecharacterThe nickname portion of the participant's current team name (e.g., Red Sox, Braves).
current_team_location_namecharacterCity or metropolitan area name associated with the participant's current team.
current_team_first_year_of_playcharacterYear in which the participant's current franchise first played as an MLB team.
current_team_league_idintegerMLB Stats API identifier for the league (American or National) of the participant's current team.
current_team_league_namecharacterFull name of the league the participant's current team belongs to (e.g., National League).
current_team_league_linkcharacterRelative URL path to the league resource for the participant's current team in the MLB Stats API.
current_team_division_iddoubleMLB Stats API identifier for the division the participant's current team belongs to.
current_team_division_namecharacterFull name of the division the participant's current team belongs to (e.g., AL East).
current_team_division_linkcharacterRelative URL path to the participant's current team's division resource in the MLB Stats API.
current_team_sport_idintegerMLB Stats API identifier for the sport classification of the participant's current team (MLB = 1).
current_team_sport_linkcharacterRelative URL path to the sport resource for the participant's current team in the MLB Stats API.
current_team_sport_namecharacterFull sport classification name for the participant's current team (e.g., Major League Baseball).
current_team_short_namecharacterShortened display name of the participant's current team for space-constrained contexts.
current_team_franchise_namecharacterHistorical franchise name for the participant's team, persisting across relocations.
current_team_club_namecharacterInformal nickname portion of the participant's current team name (e.g., Yankees, Dodgers).
current_team_activelogicalBoolean flag indicating whether the participant's current franchise is an active MLB organization.
primary_position_codecharacterPrimary position code.
primary_position_namecharacterPrimary fielding position name.
primary_position_typecharacterPrimary position type (e.g. Infielder).
primary_position_abbreviationcharacterPrimary position abbreviation.
bat_side_codecharacterBatting side code (L/R/S).
bat_side_descriptioncharacterBatting side description.
pitch_hand_codecharacterThrowing hand code (L/R).
pitch_hand_descriptioncharacterThrowing hand description.
last_played_datecharacterDate of last MLB game played.
name_matrilinealcharacterMaternal family name.
current_team_parent_org_namecharacterName of the parent MLB organization for the participant's current team.
current_team_parent_org_iddoubleMLB Stats API identifier for the parent MLB organization of the participant's current team, relevant for minor league affiliates.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example​

mlb_home_run_derby_bracket(game_pk=511101)

Last validated n/a.

mlb_home_run_derby_pool​

View a home run derby object based on pool.

Endpoint URL: GET https://statsapi.mlb.com/api/v1/homeRunDerby/{game_pk}/pool

Valid URL: https://statsapi.mlb.com/api/v1/homeRunDerby/511101/pool

API ParameterPythonPatternRequiredNullableDescription
game_pkgame_pkYgame_pk path parameter.
fieldsfieldsYfields query parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idintegerId.
full_namecharacterPlayer's full name.
linkcharacterAPI link to the game feed.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
primary_numbercharacterPlayer uniform number.
birth_datecharacterDate of birth (YYYY-MM-DD).
current_ageintegerCurrent age in years.
birth_citycharacterCity of birth.
birth_state_provincecharacterState or province of birth.
birth_countrycharacterCountry of birth.
heightcharacterHeight (feet and inches).
weightintegerWeight in pounds.
activelogicalWhether the player is currently active.
use_namecharacterPreferred first name.
use_last_namecharacterPreferred last name.
middle_namecharacterPlayer middle name.
boxscore_namecharacterName as shown in box scores.
nick_namecharacterPlayer nickname.
gendercharacterPlayer gender.
is_playerlogicalWhether the person is a player.
is_verifiedlogicalWhether the player profile is verified.
draft_yeardoubleYear the player was drafted.
pronunciationcharacterPhonetic name pronunciation.
statscharacterStats.
mlb_debut_datecharacterMLB debut date (YYYY-MM-DD).
name_first_lastcharacterName in first-last order.
name_slugcharacterURL-friendly name slug.
first_last_namecharacterFirst and last name.
last_first_namecharacterName in last, first order.
last_init_namecharacterLast name with first initial.
init_last_namecharacterFirst initial with last name.
full_fml_namecharacterFull name (first-middle-last).
full_lfm_namecharacterFull name (last-first-middle).
strike_zone_topdoubleTop of the player's strike zone (feet).
strike_zone_bottomdoubleBottom of the player's strike zone (feet).
current_team_spring_league_iddoubleThe MLB Stats API numeric identifier for the spring training league of the pool participant's current team.
current_team_spring_league_namecharacterThe full name of the spring training league for the pool participant's current team.
current_team_spring_league_linkcharacterThe MLB Stats API relative URL linking to the spring training league resource for the pool participant's current team.
current_team_spring_league_abbreviationcharacterThe abbreviation for the spring training league in which the pool participant's current team plays during spring training.
current_team_all_star_statuscharacterThe All-Star designation status of the pool participant's current team (e.g., which league's All-Star pool the team belongs to).
current_team_idintegerCurrent team MLBAM ID.
current_team_namecharacterCurrent team name.
current_team_linkcharacterAPI link to the current team.
current_team_seasonintegerThe MLB season year for which the pool participant's current team metadata is reported.
current_team_venue_idintegerThe MLB Stats API numeric identifier for the regular-season home ballpark of the pool participant's current team.
current_team_venue_namecharacterThe official name of the regular-season home ballpark for the pool participant's current team.
current_team_venue_linkcharacterThe MLB Stats API relative URL linking to the regular-season venue resource for the pool participant's current team.
current_team_spring_venue_iddoubleThe MLB Stats API numeric identifier for the spring training ballpark used by the pool participant's current team.
current_team_spring_venue_linkcharacterThe MLB Stats API relative URL linking to the spring training venue resource for the pool participant's current team.
current_team_team_codecharacterThe three-letter internal team code used by MLB for the pool participant's team in legacy data systems.
current_team_file_codecharacterThe lowercase alphabetic file code used by MLB for identifying the pool participant's team in media and data assets.
current_team_abbreviationcharacterThe standard two- or three-letter abbreviation for the Home Run Derby pool participant's current MLB team.
current_team_team_namecharacterThe full official name of the pool participant's current team, including both city and nickname.
current_team_location_namecharacterThe city or metropolitan area name associated with the pool participant's current team.
current_team_first_year_of_playcharacterThe calendar year in which the pool participant's current franchise first played MLB games.
current_team_league_idintegerThe MLB Stats API numeric identifier for the league of the pool participant's current team.
current_team_league_namecharacterThe full name of the league (e.g., 'National League') in which the pool participant's current team competes.
current_team_league_linkcharacterThe MLB Stats API relative URL linking to the league resource for the pool participant's current team.
current_team_division_iddoubleThe MLB Stats API numeric identifier for the division in which the pool participant's current team competes.
current_team_division_namecharacterThe full name of the division in which the pool participant's current team competes (e.g., 'National League West').
current_team_division_linkcharacterThe MLB Stats API relative URL linking to the division resource for the pool participant's current team.
current_team_sport_idintegerThe MLB Stats API numeric identifier for the sport classification of the pool participant's current team.
current_team_sport_linkcharacterThe MLB Stats API relative URL linking to the sport resource associated with the pool participant's current team.
current_team_sport_namecharacterThe name of the sport classification for the pool participant's current team (e.g., 'Major League Baseball').
current_team_short_namecharacterA shortened display name for the pool participant's current team, often used in space-constrained UI contexts.
current_team_franchise_namecharacterThe historical franchise name for the pool participant's current team, which may differ from the current team name for relocated clubs.
current_team_club_namecharacterThe short club nickname for the pool participant's current team, typically the city-less portion of the franchise name.
current_team_activelogicalBoolean flag indicating whether the pool participant's current team is an active MLB franchise.
primary_position_codecharacterPrimary position code.
primary_position_namecharacterPrimary fielding position name.
primary_position_typecharacterPrimary position type (e.g. Infielder).
primary_position_abbreviationcharacterPrimary position abbreviation.
bat_side_codecharacterBatting side code (L/R/S).
bat_side_descriptioncharacterBatting side description.
pitch_hand_codecharacterThrowing hand code (L/R).
pitch_hand_descriptioncharacterThrowing hand description.
last_played_datecharacterDate of last MLB game played.
name_matrilinealcharacterMaternal family name.
current_team_parent_org_namecharacterThe name of the parent major-league organization for the pool participant's current team.
current_team_parent_org_iddoubleThe MLB Stats API numeric identifier for the parent organization of the pool participant's current team.

return_parsed=False — the raw JSON Dict payload, unparsed.

Example​

mlb_home_run_derby_pool(game_pk=511101)

Last validated n/a.