30 KiB
{{classname}}
All URIs are relative to https://statsapi.mlb.com
Method | HTTP request | Description |
---|---|---|
Affiliates | Get /api/v1/teams/{teamId}/affiliates | View team and affiliate teams |
Affiliates1 | Get /api/v1/teams/affiliates | View team and affiliate teams |
AllTeams | Get /api/v1/teams/{teamId}/history | View historical records for a list of teams |
AllTeams1 | Get /api/v1/teams/history | View historical records for a list of teams |
Alumni | Get /api/v1/teams/{teamId}/alumni | View all team alumni |
Coaches | Get /api/v1/teams/{teamId}/coaches | View all coaches for a team |
Leaders | Get /api/v1/teams/{teamId}/leaders | View team stat leaders |
Leaders1 | Get /api/v1/teams/stats/leaders | View leaders for team stats |
Personnel | Get /api/v1/teams/{teamId}/personnel | View all coaches for a team |
Roster | Get /api/v1/teams/{teamId}/roster | View a teams roster |
Roster1 | Get /api/v1/teams/{teamId}/roster/{rosterType} | View a teams roster |
Stats | Get /api/v1/teams/{teamId}/stats | View a teams stats |
Stats1 | Get /api/v1/teams/stats | View a teams stats |
Teams | Get /api/v1/teams | View info for all teams |
Teams1 | Get /api/v1/teams/{teamId} | View info for all teams |
UpdateAlumni | Post /api/v1/teams/{teamId}/alumni |
Affiliates
TeamsRestObject Affiliates(ctx, teamId, optional) View team and affiliate teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiAffiliatesOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiAffiliatesOpts struct
Name | Type | Description | Notes |
---|
teamIds | **optional.Interface of []int32**| Unique Team Identifier. Format: 141, 147, etc | sportId | optional.Int32| Top level organization of a sport | season | optional.String| Season of play | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Affiliates1
TeamsRestObject Affiliates1(ctx, teamId, optional) View team and affiliate teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiAffiliates1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiAffiliates1Opts struct
Name | Type | Description | Notes |
---|
teamIds | **optional.Interface of []int32**| Unique Team Identifier. Format: 141, 147, etc | sportId | optional.Int32| Top level organization of a sport | season | optional.String| Season of play | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AllTeams
TeamsRestObject AllTeams(ctx, teamId, optional) View historical records for a list of teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiAllTeamsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiAllTeamsOpts struct
Name | Type | Description | Notes |
---|
teamIds | **optional.Interface of []int32**| Comma delimited list of Unique Team identifiers | startSeason | optional.String| Start date for range of data (used with end date optionally). Example: '2018' or '2018.2' | endSeason | optional.String| End date for range of data (used with start date optionally). Format: '2018' or '2018.2' | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AllTeams1
TeamsRestObject AllTeams1(ctx, teamId, optional) View historical records for a list of teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiAllTeams1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiAllTeams1Opts struct
Name | Type | Description | Notes |
---|
teamIds | **optional.Interface of []int32**| Comma delimited list of Unique Team identifiers | startSeason | optional.String| Start date for range of data (used with end date optionally). Example: '2018' or '2018.2' | endSeason | optional.String| End date for range of data (used with start date optionally). Format: '2018' or '2018.2' | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Alumni
PeopleRestObject Alumni(ctx, teamId, season, optional) View all team alumni
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
season | string | Season of play | |
optional | *TeamsApiAlumniOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiAlumniOpts struct
Name | Type | Description | Notes |
---|
group | optional.Interface of StatGroup| Category of statistic to return. Available types in /api/v1/statGroups | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Coaches
RosterRestObject Coaches(ctx, teamId, optional) View all coaches for a team
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiCoachesOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiCoachesOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | date | optional.String| Date of Game. Format: YYYY-MM-DD | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Leaders
TeamLeaderContainerRestObject Leaders(ctx, teamId, optional) View team stat leaders
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | ||
optional | *TeamsApiLeadersOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiLeadersOpts struct
Name | Type | Description | Notes |
---|
leaderCategories | **optional.Interface of []PersonLeadersEnum**| | season | optional.String| | leaderGameTypes | **optional.Interface of []GameTypeEnum**| | expand | **optional.Interface of []ExpandEnum**| | limit | optional.Int32| | offset | optional.Int32| | playerPool | optional.Interface of PlayerPoolEnum| | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Leaders1
LeagueLeaderContainerRestObject Leaders1(ctx, optional) View leaders for team stats
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *TeamsApiLeaders1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiLeaders1Opts struct
Name | Type | Description | Notes |
---|---|---|---|
leaderCategories | **optional.Interface of []PersonLeadersEnum** | TBD | |
gameTypes | **optional.Interface of []GameTypeEnum** | Type of Game. Available types in /api/v1/gameTypes | |
stats | **optional.Interface of []StatType** | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes | |
statType | optional.Interface of StatType | ||
sportId | optional.Int32 | Top level organization of a sport | |
sportIds | **optional.Interface of []int32** | Comma delimited list of top level organizations of a sport | |
leagueId | optional.Int32 | Unique League Identifier | |
leagueIds | **optional.Interface of []int32** | Comma delimited list of Unique league identifiers | |
season | optional.String | Season of play | |
statGroup | **optional.Interface of []StatGroup** | Category of statistic to return. Available types in /api/v1/statGroups | |
group | **optional.Interface of []StatGroup** | Category of statistic to return. Available types in /api/v1/statGroups | |
startDate | optional.String | Start date for range of data (must be used with end date). Format: MM/DD/YYYY | |
endDate | optional.String | End date for range of data (must be used with start date). Format: MM/DD/YYYY | |
daysBack | optional.Int32 | Returns results from the last 'X' days (Starting from yesterday). | |
sitCodes | optional.String | Situation code for a given stat split. | |
opposingTeamId | optional.Int32 | A unique identifier for the opposing team. Must be used with Team ID | |
limit | optional.Int32 | Number of results to return | |
offset | optional.Int32 | The pointer to start for a return set; used for pagination | |
fields | **optional.Interface of []string** |
Return type
LeagueLeaderContainerRestObject
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Personnel
RosterRestObject Personnel(ctx, teamId, optional) View all coaches for a team
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiPersonnelOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiPersonnelOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | date | optional.String| Date of Game. Format: YYYY-MM-DD | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Roster
RosterRestObject Roster(ctx, teamId, rosterType, optional) View a teams roster
This endpoint allows you to pull teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
rosterType | string | Type of roster. Available types in /api/v1/rosterTypes | |
optional | *TeamsApiRosterOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiRosterOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | date | optional.String| Date of Game. Format: YYYY-MM-DD | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Roster1
RosterRestObject Roster1(ctx, teamId, rosterType, optional) View a teams roster
This endpoint allows you to pull teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
rosterType | string | Type of roster. Available types in /api/v1/rosterTypes | |
optional | *TeamsApiRoster1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiRoster1Opts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | date | optional.String| Date of Game. Format: YYYY-MM-DD | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Stats
StatsRestObject Stats(ctx, teamId, group, optional) View a teams stats
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
group | **[]StatGroup** | Category of statistic to return. Available types in /api/v1/statGroups | |
optional | *TeamsApiStatsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiStatsOpts struct
Name | Type | Description | Notes |
---|
sportId | optional.Int32| Top level organization of a sport | season | optional.String| Season of play | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | stats | **optional.Interface of []StatType**| Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes | sortStat | optional.Interface of BaseballStatsEnum| Baseball stat to sort splits by. | order | optional.Interface of SortOrderEnum| The order of sorting, ascending or descending | groupBy | **optional.Interface of []GroupByEnum**| Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP | opposingTeamId | optional.Int32| A unique identifier for the opposing team. Must be used with Team ID | opposingPlayerId | optional.Int32| A unique identifier for the opposing team | sitCodes | optional.String| Situation code for a given stat split. | startDate | optional.String| Start date for range of data (must be used with end date). Format: MM/DD/YYYY | endDate | optional.String| End date for range of data (must be used with start date). Format: MM/DD/YYYY | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Stats1
StatsRestObject Stats1(ctx, group, optional) View a teams stats
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
group | **[]StatGroup** | Category of statistic to return. Available types in /api/v1/statGroups | |
optional | *TeamsApiStats1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiStats1Opts struct
Name | Type | Description | Notes |
---|
gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | stats | **optional.Interface of []StatType**| Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes | sportId | optional.Int32| Top level organization of a sport | sportIds | **optional.Interface of []int32**| Comma delimited list of top level organizations of a sport | leagueIds | **optional.Interface of []int32**| Comma delimited list of Unique league identifiers | season | optional.String| Season of play | sortStat | optional.Interface of BaseballStatsEnum| Baseball stat to sort splits by. | order | optional.Interface of SortOrderEnum| The order of sorting, ascending or descending | startDate | optional.String| Start date for range of data (must be used with end date). Format: MM/DD/YYYY | endDate | optional.String| End date for range of data (must be used with start date). Format: MM/DD/YYYY | daysBack | optional.Int32| Returns results from the last 'X' days (Starting from yesterday). | sitCodes | optional.String| Situation code for a given stat split. | combineSits | optional.Bool| If true, gathers stats where all of the situational criteria are met. If false, returns stats where any of the situational criteria are met. Default: false | opposingTeamId | optional.Int32| A unique identifier for the opposing team. Must be used with Team ID | offset | optional.Int32| The pointer to start for a return set; used for pagination | limit | optional.Int32| Number of results to return | fields | **optional.Interface of []string**| |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Teams
TeamsRestObject Teams(ctx, teamId, optional) View info for all teams
This endpoint allows you to pull teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiTeamsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiTeamsOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | sportId | optional.Int32| Top level organization of a sport | divisionId | optional.Int32| Unique Division Identifier | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | leagueIds | **optional.Interface of []int32**| Comma delimited list of Unique league identifiers | sportIds | **optional.Interface of []int32**| Comma delimited list of top level organizations of a sport | activeStatus | optional.Interface of TeamActiveStatusEnum| Flag for fetching teams that are currently active (Y), inactive (N), pending (P), or all teams (B) | leagueListId | optional.Interface of LeagueListsEnum| Unique League List Identifier | allStarStatuses | **optional.Interface of []AllStarEnum**| | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Teams1
TeamsRestObject Teams1(ctx, teamId, optional) View info for all teams
This endpoint allows you to pull teams
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
optional | *TeamsApiTeams1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiTeams1Opts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | sportId | optional.Int32| Top level organization of a sport | divisionId | optional.Int32| Unique Division Identifier | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | leagueIds | **optional.Interface of []int32**| Comma delimited list of Unique league identifiers | sportIds | **optional.Interface of []int32**| Comma delimited list of top level organizations of a sport | activeStatus | optional.Interface of TeamActiveStatusEnum| Flag for fetching teams that are currently active (Y), inactive (N), pending (P), or all teams (B) | leagueListId | optional.Interface of LeagueListsEnum| Unique League List Identifier | allStarStatuses | **optional.Interface of []AllStarEnum**| | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateAlumni
string UpdateAlumni(ctx, teamId, season, optional)
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
teamId | int32 | Unique Team Identifier. Format: 141, 147, etc | |
season | string | Season of play | |
optional | *TeamsApiUpdateAlumniOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a TeamsApiUpdateAlumniOpts struct
Name | Type | Description | Notes |
---|
group | optional.Interface of StatGroup| Category of statistic to return. Available types in /api/v1/statGroups | fields | **optional.Interface of []string**| |
Return type
string
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
[Back to top] [Back to API list] [Back to Model list] [Back to README]