6.5 KiB
{{classname}}
All URIs are relative to https://statsapi.mlb.com
Method | HTTP request | Description |
---|---|---|
AllSportBallot | Get /api/v1/sports/{sportId}/allSportBallot | Get ALL MLB ballot for sport |
SportPlayers | Get /api/v1/sports/{sportId}/players | Get all players for a sport level |
Sports | Get /api/v1/sports | Get sports information |
Sports1 | Get /api/v1/sports/{sportId} | Get sports information |
AllSportBallot
PeopleRestObject AllSportBallot(ctx, sportId, season, optional) Get ALL MLB ballot for sport
This endpoint allows you to get all players for MLB ballot
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sportId | int32 | Top level organization of a sport | |
season | string | season | |
optional | *SportsApiAllSportBallotOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SportsApiAllSportBallotOpts struct
Name | Type | Description | Notes |
---|
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]
SportPlayers
PeopleRestObject SportPlayers(ctx, sportId, optional) Get all players for a sport level
This endpoint allows you to pull all players for a given sport
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sportId | int32 | Top level organization of a sport | |
optional | *SportsApiSportPlayersOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SportsApiSportPlayersOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | gameType | optional.Interface of GameTypeEnum| Type of Game. Available types in /api/v1/gameTypes | hasStats | optional.Bool| Returns sports that have individual player stats | accent | optional.Bool| Boolean value to specify wanting a person's name with accents or without | 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]
Sports
SportsRestObject Sports(ctx, sportId, optional) Get sports information
This endpoint allows you to pull sports
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sportId | int32 | Top level organization of a sport | |
optional | *SportsApiSportsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SportsApiSportsOpts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | hasStats | optional.Bool| Returns sports that have individual player stats | activeStatus | optional.Interface of SportActiveStatusEnum| Flag for fetching sports that are currently active (Y), inactive (N), pending (P), or all teams (B) |
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]
Sports1
SportsRestObject Sports1(ctx, sportId, optional) Get sports information
This endpoint allows you to pull sports
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
sportId | int32 | Top level organization of a sport | |
optional | *SportsApiSports1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SportsApiSports1Opts struct
Name | Type | Description | Notes |
---|
season | optional.String| Season of play | fields | **optional.Interface of []string**| Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | hasStats | optional.Bool| Returns sports that have individual player stats | activeStatus | optional.Interface of SportActiveStatusEnum| Flag for fetching sports that are currently active (Y), inactive (N), pending (P), or all teams (B) |
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]