Skip to content

Data Types: League

KCNilssen edited this page Dec 15, 2022 · 5 revisions

Usage that returns League objects

To be added

League Structure

Attributes are expandable and collapsable - Link to League dataclass

id : int
  • id number of the league
name : str
  • name of the league
link : str
  • link of the league
abbreviation : str
  • abbreviation the league
nameshort : str
  • Short name for the league
seasonstate : str
  • State of the leagues season
haswildcard : bool
  • Status of the leagues wildcard
hassplitseason : bool
  • Status of the leagues split season
numgames : int
  • Total number of league games
hasplayoffpoints : bool
  • Status of the leagues playoff points
numteams : int
  • Total number of team in league
numwildcardteams : int
  • Total number of wildcard teams in league
seasondateinfo : LeagueSeasonDateInfo
  • LeagueSeasonDateInfo attribue
season : str
  • League season
orgcode : str
  • Leagues orginization code
conferencesinuse : bool
  • Status of the in use conferences of the league
divisionsinuse : bool
  • Status of leagues divisions in use
sport : Sport
  • What 'sport' this league is a part of
sortorder : int
  • League sort order
active : bool
  • Status on the activity of the league

Example output from MLB stats api endpoint

Mlb stats api Query:

https://statsapi.mlb.com/api/v1/league?leagueIds=103&seasons=2018

Equivelant with python-mlb-statsapi:

import mlbstatsapi

mlb = mlbstatsapi.Mlb()

mlb.get_league(league_id = 103, seasons = 2018)

Clone this wiki locally