-
Notifications
You must be signed in to change notification settings - Fork 15
Data Types: Team
KCNilssen edited this page Dec 16, 2022
·
4 revisions
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
- The record of the team. Dataclass: 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
Description: Return Team Object from Id
Parameters:
Name | Type | Required | Description | Default |
---|---|---|---|---|
team_id |
string/int | Yes | unique team id |
Other Parameters:
Name | Type | Required | Description | Default |
---|---|---|---|---|
sportId |
string/int | No | Insert a sportId to return a directory of team information for a particular club in a sport. | |
season |
string/int | No | Insert year to return a directory of team information for a particular club in a specific season. | |
fields |
string | No | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Description: Return all Team Objects from sportId
Parameters:
Name | Type | Required | Description | Default |
---|---|---|---|---|
sport_id |
string/int | Yes | unique sport id of teams | 1 |
Other Parameters:
Name | Type | Required | Description | Default |
---|---|---|---|---|
sportId |
string/int | No | Insert a sportId to return a directory of team information for a particular club in a sport. | |
season |
string/int | No | Insert year to return a directory of team information for a particular club in a specific season. | |
fields |
string | No | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | |
leagueIds |
string/int | No | Insert leagueId to return team information for particular league. | |
activeStatus |
string | No | Insert activeStatus to populate a teams based on active/inactive status for a given season. There are three status types: Y, N, B | |
allStarStatuses |
string | No | Insert allStarStatuses to populate a teams based on Allstar status for a given season. There are two status types: Y and N | |
gameType |
string | No | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
https://statsapi.mlb.com/api/v1/teams?sportId=1
import mlbstatsapi
mlb = mlbstatsapi.Mlb()
mlb.get_teams(sport_id = 1)
Note: This information is provided for reference only, without warranty or guarantee, and is not official documentation provided by MLB. This package and its author are not affiliated with MLB or any MLB team. This API wrapper interfaces with MLB's Stats API. Use of MLB data is subject to the notice posted at http://gdx.mlb.com/components/copyright.txt.