Skip to content

Data Types: Season

KCNilssen edited this page Dec 16, 2022 · 4 revisions

Season Structure

Attributes are expandable and collapsable - Link to Season dataclass

seasonid : str
  • season id
haswildcard : bool
  • wild card status
preseasonstartdate : str
  • pre-season start date
preseasonenddate : str
  • pre-season end date
seasonstartdate : str
  • season start date
springstartdate : str
  • spring start date
springenddate : str
  • spring end date
regularseasonstartdate : str
  • regular season start date
lastdate1sthalf : str
  • last date 1st half
allstardate : str
  • all star date
firstdate2ndhalf : str
  • first date 2nd half
regularseasonenddate : str
  • regular season end date
postseasonstartdate : str
  • post season start date
postseasonenddate : str
  • post season end date
seasonenddate : str
  • season end date
offseasonstartdate : str
  • off season start date
offseasonenddate : str
  • off season end date
seasonlevelgamedaytype : str
  • season level game day type
gamelevelgamedaytype : str
  • game level game day type
qualifierplateappearances : float
  • qualifier plate appearances
qualifieroutspitched : int
  • qualifier outs pitched

Usage that returns Season objects

get_season

Description: Returns a Season

Parameters:

Name Type Required Description Default
season_id string/int Yes Insert year to return season information for a particular season.
sport_id string/int No Insert a sportId to return a directory of seasons for a specific sport. 1

Other Parameters:

Name Type Required Description Default
withGameTypeDates bool No Insert a withGameTypeDates to return season information for all gameTypes.
fields string/int No Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute

get_seasons

Description: Return a list of Seasons

Parameters:

Name Type Required Description Default
sport_id string/int Yes Insert a sportId to return a directory of seasons for a specific sport. 1

Other Parameters:

Name Type Required Description Default
divisionId string/int No Insert divisionId to return a directory of seasons for a specific division.
leagueId string/int No Insert leagueId to return a directory of seasons in a specific league.
withGameTypeDates bool No Insert a withGameTypeDates to return season information for all gameTypes.
fields string/int No Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute

Example output from MLB stats api endpoint

Mlb stats api Query:

https://statsapi.mlb.com/api/v1/seasons?sportId=1

Equivelant with python-mlb-statsapi:

import mlbstatsapi

mlb = mlbstatsapi.Mlb()

mlb.get_seasons()

Clone this wiki locally