Skip to content

Data Types: Team

KCNilssen edited this page Dec 16, 2022 · 4 revisions

Usage that returns Team objects

To be added

Team Structure

Attributes are expandable and collapsable - Link to Team dataclass

id : int
  • id number of the team
name : str
  • name of the team
link : str
  • The API link for the team
springleague : League
  • The spring league of the team. Dataclass: League
id : int
  • id number of the league
name : str
  • name of the league
link : str
  • link of the league
abbreviation : str
  • abbreviation the league
allstarstatus : str
  • The all status status of the team
season : str
  • The team's current season
venue : Venue
  • The team's home venue. Dataclass: Venue
id : int
  • id for this venue
name : str
  • Name for this venue
link : str
  • Link to venues endpoint
springvenue : Venue
  • The team's spring venue. Dataclass: Venue
id : int
  • id for this venue
link : str
  • Link to venues endpoint
teamcode : str
  • team code
filecode : str
  • filecode name of the team
abbreviation : str
  • The abbreviation of the team name
teamname : str
  • The team name
locationname : str
  • The location of the team
firstyearofplay : str
  • The first year the team began play
league : League
  • The league of the team. Dataclass: League
id : int
  • id number of the league
name : str
  • name of the league
link : str
  • link of the league
division : Division
  • The division the team is in. Dataclass: Division
id : int
  • id number of the divison
name : str
  • name of the division
link : str
  • link of the division
sport : Sport
  • The sport of the team. Dataclass: Sport
id : int
  • id number of the sport
name : str
  • name the sport
link : str
  • link of the sport
shortname : str
  • The shortname of the team
record : TeamRecord
gamesplayed : int
  • Number of game played by team
wildcardgamesback : str
  • Number of game back from wildcard
leaguegamesback : str
  • Number of league games back
springleaguegamesback : str
  • Number of game back in spring league
sportgamesback : str
  • Number of games back in sport
divisiongamesback : str
  • Number of games back in division
conferencegamesback : str
  • Number of games back in conference
leaguerecord : Dict
  • Record in league
records : Dict
  • Records
divisionleader : bool
  • Is this team a divison leader
wins : int
  • Number of wins
losses : int
  • Number of losses
winningpercentage : str
  • Winning percentage
franchisename : str
  • The franchisename of the team
clubname : str
  • The clubname of the team
active : str
  • Active status of the team
parentorgname : str
  • The name of the parent team or org
parentorgid : str
  • The id of the partent team or org

Example output from MLB stats api endpoint

Mlb stats api Query:

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

Equivelant with python-mlb-statsapi:

import mlbstatsapi

mlb = mlbstatsapi.Mlb()

mlb.get_teams(sport_id = 1)
Clone this wiki locally