Skip to content

Data Types: Homerunderby

KCNilssen edited this page Dec 16, 2022 · 4 revisions

Homerunderby Structure

Attributes are expandable and collapsable - Link to Homerunderby dataclass

info : Info
  • An object containing information about the game. Dataclass: Info
id : int
  • The unique identifier of the event.
name : str
  • The name of the event.
eventtype : Eventtype
  • The type of event. Can be an instance of the Eventtype class or a dictionary containing the attributes for the Eventtype class. Datatype: Eventtype
code (str):
  • The unique code of the event type.
name (str):
  • The name of the event type.
eventdate : str
  • The date of the event.
venue : Venue
  • The venue of the event. Can be an instance of the Venue class or a dictionary containing the attributes for the Venue class. Dataclass: Venue
id : int
  • id for this venue
name : str
  • Name for this venue
link : str
  • Link to venues endpoint
ismultiday : bool
  • Whether the event spans multiple days.
isprimarycalendar : bool
  • Whether the event is on the primary calendar.
filecode : str
  • The code of the file associated with the event.
eventnumber : int
  • The number of the event.
publicfacing : bool
  • Whether the event is public-facing.
teams : List[Team]
  • The teams participating in the event. Can be a list of instances of the Team class or a list of dictionaries containing the attributes for the Team class. Dataclass: Team
id : int
  • id number of the team
name : str
  • name of the team
link : str
  • The API link for the team
status : Status
  • An object containing the status of the game. Dataclass: Status
state : str
  • The current state of the game or round (e.g. "in progress", "paused", "ended")
currentround : int
  • The number of the current round in the game
currentroundtimeleft : str
  • The amount of time left in the current round, in a human-readable format (e.g. "4:00")
intiebreaker : bool
  • Whether the game or round is currently in a tiebreaker
tiebreakernum : int
  • The number of the current tiebreaker, if applicable
clockstopped : bool
  • Whether the round clock is currently stopped
bonustime : bool
  • Whether the round is currently in bonus time
rounds : Round
  • A list of Round objects representing the rounds in the game. Dataclass: Round
round : int
  • An integer representing the round number.
numbatters : int
  • An integer representing the number of batters in the round.
matchups : List[Matchup]
  • A list of objects containing the data for the matchups in the round. Dataclass: Matchup
topseed : Seed
  • Containing the top seed in the matchup. Dataclass: Seed
complete : bool
  • A boolean indicating whether the seed has been completed.
started : bool
  • A boolean indicating whether the seed has been started.
winner : bool
  • A boolean indicating whether the player for this seed is the winner of the game.
player : Person
  • An object containing the data for the player associated with this seed. This can either be a Person object or a dictionary. Dataclass: Person
id : int
  • id number of the person
full_name : str
  • full_name of the person
link : str
  • Api link to person
topderbyhitdata : Hitdata
  • An object containing the data for the top hit in the seed. This can either be a Hitdata object or a dictionary. Dataclass: Hitdata
launchspeed : float
  • The speed at which the hit was launched
totaldistance : int
  • The total distance the hit traveled
launchangle : float
  • The angle at which the hit was launched, if applicable
coordinates : Coordinates
coordx : float
  • The x-coordinate of the hit
coordy : float
  • The y-coordinate of the hit
landingposx : float
  • The x-coordinate of the hits's landing position, if applicable
landingposy : float
  • The y-coordinate of the hits's landing position, if applicable
trajectorydata : Trajectorydata
trajectorypolynomialx : List[int]
  • A list of coefficients for the polynomial representing the x-coordinate of the hits's trajectory
trajectorypolynomialy : List[int]
  • A list of coefficients for the polynomial representing the y-coordinate of the hits's trajectory
trajectorypolynomialz : List[int]
  • A list of coefficients for the polynomial representing the z-coordinate of the hits's trajectory
validtimeinterval : List[int]
  • A list of two elements representing the start and end times for which the polynomial coefficients are valid
measuredtimeinterval : List[int]
  • A list of two elements representing the start and end times of the interval during which the hits's trajectory was measured
hits : Hits
  • An object containing the data for the hits in the seed. This can either be a Hits object or a dictionary. Dataclass: Hits
bonustime : bool
  • A boolean indicating whether the hit occurred during bonus time.
homerun : bool
  • A boolean indicating whether the hit was a homerun.
tiebreaker : bool
  • A boolean indicating whether the hit occurred during a tiebreaker.
hitdata : Hitdata
  • An object containing the data for the hit. This can either be a Hitdata object or a dictionary. Dataclass: Hitdata
launchspeed : float
  • The speed at which the hit was launched
totaldistance : int
  • The total distance the hit traveled
launchangle : float
  • The angle at which the hit was launched, if applicable
coordinates : Coordinates
coordx : float
  • The x-coordinate of the hit
coordy : float
  • The y-coordinate of the hit
landingposx : float
  • The x-coordinate of the hits's landing position, if applicable
landingposy : float
  • The y-coordinate of the hits's landing position, if applicable
trajectorydata : Trajectorydata
trajectorypolynomialx : List[int]
  • A list of coefficients for the polynomial representing the x-coordinate of the hits's trajectory
trajectorypolynomialy : List[int]
  • A list of coefficients for the polynomial representing the y-coordinate of the hits's trajectory
trajectorypolynomialz : List[int]
  • A list of coefficients for the polynomial representing the z-coordinate of the hits's trajectory
validtimeinterval : List[int]
  • A list of two elements representing the start and end times for which the polynomial coefficients are valid
measuredtimeinterval : List[int]
  • A list of two elements representing the start and end times of the interval during which the hits's trajectory was measured
ishomerun : bool
  • A boolean indicating whether the hit was a homerun. This attribute is a duplicate of the homerun attribute.
playid : str
  • A string containing the ID of the play in which the hit occurred.
timeremaining : str
  • A string indicating the amount of time remaining in the game when the hit occurred.
isbonustime : bool
  • A boolean indicating whether the hit occurred during bonus time. This attribute is a duplicate of the bonustime attribute.
istiebreaker : bool
  • A boolean indicating whether the hit occurred during a tiebreaker. This attribute is a duplicate of the tiebreaker attribute.
seed : int
  • An integer representing the seed number.
order : int
  • An integer representing the order in which the seed was played.
iswinner : bool
  • A boolean indicating whether the player for this seed is the winner of the game. This attribute is a duplicate of the winner attribute.
iscomplete : bool
  • A boolean indicating whether the seed has been completed. This attribute is a duplicate of the complete attribute.
isstarted : bool
  • A boolean indicating whether the seed has been started. This attribute is a duplicate of the started attribute.
numhomeruns : int
  • An integer representing the number of homeruns hit in the seed.
bottomseed : Seed
  • Containing the bottom seed in the matchup. Dataclass: Seed
complete : bool
  • A boolean indicating whether the seed has been completed.
started : bool
  • A boolean indicating whether the seed has been started.
winner : bool
  • A boolean indicating whether the player for this seed is the winner of the game.
player : Person
  • An object containing the data for the player associated with this seed. This can either be a Person object or a dictionary. Dataclass: Person
id : int
  • id number of the person
full_name : str
  • full_name of the person
link : str
  • Api link to person
topderbyhitdata : Hitdata
  • An object containing the data for the top hit in the seed. This can either be a Hitdata object or a dictionary. Dataclass: Hitdata
launchspeed : float
  • The speed at which the hit was launched
totaldistance : int
  • The total distance the hit traveled
launchangle : float
  • The angle at which the hit was launched, if applicable
coordinates : Coordinates
coordx : float
  • The x-coordinate of the hit
coordy : float
  • The y-coordinate of the hit
landingposx : float
  • The x-coordinate of the hits's landing position, if applicable
landingposy : float
  • The y-coordinate of the hits's landing position, if applicable
trajectorydata : Trajectorydata
trajectorypolynomialx : List[int]
  • A list of coefficients for the polynomial representing the x-coordinate of the hits's trajectory
trajectorypolynomialy : List[int]
  • A list of coefficients for the polynomial representing the y-coordinate of the hits's trajectory
trajectorypolynomialz : List[int]
  • A list of coefficients for the polynomial representing the z-coordinate of the hits's trajectory
validtimeinterval : List[int]
  • A list of two elements representing the start and end times for which the polynomial coefficients are valid
measuredtimeinterval : List[int]
  • A list of two elements representing the start and end times of the interval during which the hits's trajectory was measured
hits : Hits
  • An object containing the data for the hits in the seed. This can either be a Hits object or a dictionary. Dataclass: Hits
bonustime : bool
  • A boolean indicating whether the hit occurred during bonus time.
homerun : bool
  • A boolean indicating whether the hit was a homerun.
tiebreaker : bool
  • A boolean indicating whether the hit occurred during a tiebreaker.
hitdata : Hitdata
  • An object containing the data for the hit. This can either be a Hitdata object or a dictionary. Dataclass: Hitdata
launchspeed : float
  • The speed at which the hit was launched
totaldistance : int
  • The total distance the hit traveled
launchangle : float
  • The angle at which the hit was launched, if applicable
coordinates : Coordinates
coordx : float
  • The x-coordinate of the hit
coordy : float
  • The y-coordinate of the hit
landingposx : float
  • The x-coordinate of the hits's landing position, if applicable
landingposy : float
  • The y-coordinate of the hits's landing position, if applicable
trajectorydata : Trajectorydata
trajectorypolynomialx : List[int]
  • A list of coefficients for the polynomial representing the x-coordinate of the hits's trajectory
trajectorypolynomialy : List[int]
  • A list of coefficients for the polynomial representing the y-coordinate of the hits's trajectory
trajectorypolynomialz : List[int]
  • A list of coefficients for the polynomial representing the z-coordinate of the hits's trajectory
validtimeinterval : List[int]
  • A list of two elements representing the start and end times for which the polynomial coefficients are valid
measuredtimeinterval : List[int]
  • A list of two elements representing the start and end times of the interval during which the hits's trajectory was measured
ishomerun : bool
  • A boolean indicating whether the hit was a homerun. This attribute is a duplicate of the homerun attribute.
playid : str
  • A string containing the ID of the play in which the hit occurred.
timeremaining : str
  • A string indicating the amount of time remaining in the game when the hit occurred.
isbonustime : bool
  • A boolean indicating whether the hit occurred during bonus time. This attribute is a duplicate of the bonustime attribute.
istiebreaker : bool
  • A boolean indicating whether the hit occurred during a tiebreaker. This attribute is a duplicate of the tiebreaker attribute.
seed : int
  • An integer representing the seed number.
order : int
  • An integer representing the order in which the seed was played.
iswinner : bool
  • A boolean indicating whether the player for this seed is the winner of the game. This attribute is a duplicate of the winner attribute.
iscomplete : bool
  • A boolean indicating whether the seed has been completed. This attribute is a duplicate of the complete attribute.
isstarted : bool
  • A boolean indicating whether the seed has been started. This attribute is a duplicate of the started attribute.
numhomeruns : int
  • An integer representing the number of homeruns hit in the seed.
players : List[Person]
  • A list of objects containing the data for the players in the game. Dataclass: Person
id : int
  • id number of the person
full_name : str
  • full_name of the person
link : str
  • Api link to person
primaryposition : Position
  • PrimaryPosition of the Person. Dataclass: Position
lcode: str
  • code number of the Position
lname: str
  • the name of the Position
ltype: str
  • the type of the Position
labbreviation: str
  • the abbreviation of the Position
pitchhand : str
  • PitchHand of the Person
batside : str
  • BatSide of the Person
fullname : str
  • full name of the Person
firstname : str
  • First name of the Person
lastname : str
  • Last name of the Person
primarynumber : str
  • Primary number of the Person
birthdate : str
  • Birth date of the Person
currentteam : str
  • The current Team of the Person
currentage : str
  • The current age of the Person
birthcity : str
  • The birthcity of the Person
birthstateprovince : str
  • The province of the birth state
height : str
  • The height of the Person
weight : str
  • The weight of the Person
active : str
  • The active status of the Person
usename : str
  • The use name of the Person
middlename : str
  • The middle name of the Person
boxscorename : str
  • The box score name of the Person
nickname : str
  • The nickname of the Person
draftyear : int
  • The draft year of the Person
mlbdebutdate : str
  • The MLB debut date of the Person
namefirstlast : str
  • The first and last name of the Person
nameslug : str
  • The name slug of the Person
firstlastname : str
  • The first and last name of the Person
lastfirstname : str
  • The last and first name of the Person
lastinitname : str
  • The last init name of the Person
initlastname : str
  • The init last name of the Person
fullfmlname : str
  • The full fml name of the Person
fulllfmname : str
  • The full lfm name of the Person
uselastname : str
  • The last name of the
birthcountry : str
  • The birth country of the Person
pronunciation : str
  • The pronuciation of the Person's name
strikezonetop : float
  • The strike zone top of the Person
strikezonebottom : float
  • The strike zone bottom of the Person
nametitle : str
  • The name title of the Person
gender : str
  • The gender of the Person
isplayer : bool
  • The player status of the Person
isverified : bool
  • The verification of the Person
namematrilineal : str
  • The name matrilineal of the Person
deathdate : str
  • The death date of the Person
deathcity : str
  • The death city of the Person
deathcountry : str
  • The death country of the Person
lastplayeddate : str
  • The last played date of the Person
namesuffix : str
  • The namesuffix of the Person

Usage that returns Homerunderby objects

get_homerun_derby

Description: Return a Homerunderby

Parameters:

Name Type Required Description Default
award_id string Yes Insert gamePk to return HomerunDerby data for a specific gamepk. None

Other Parameters:

Name Type Required Description Default
fields string No Format: Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute None

Example output from MLB stats api endpoint

Mlb stats api Query:

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

Equivelant with python-mlb-statsapi:

import mlbstatsapi

mlb = mlbstatsapi.Mlb()

mlb.get_homerunderby(game_id = 511101)