4.8 KiB
{{classname}}
All URIs are relative to https://statsapi.mlb.com
Method | HTTP request | Description |
---|---|---|
AllSeasons | Get /api/v1/seasons/all | View all seasons |
Seasons | Get /api/v1/seasons | View season info |
Seasons1 | Get /api/v1/seasons/{seasonId} | View season info |
AllSeasons
SeasonsRestObject AllSeasons(ctx, optional) View all seasons
This endpoint allows you to view all seasons for a given Division, League or Sport
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
optional | *SeasonApiAllSeasonsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SeasonApiAllSeasonsOpts struct
Name | Type | Description | Notes |
---|---|---|---|
divisionId | optional.Int32 | Unique Division Identifier | |
leagueId | optional.Int32 | Unique League Identifier | |
sportId | optional.Int32 | Top level organization of a sport | |
withGameTypeDates | optional.Bool | Retrieve dates for each game type | |
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]
Seasons
SeasonsRestObject Seasons(ctx, seasonId, optional) View season info
This endpoint allows you to pull seasons
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
seasonId | string | Season of play | |
optional | *SeasonApiSeasonsOpts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SeasonApiSeasonsOpts struct
Name | Type | Description | Notes |
---|
season | **optional.Interface of []string**| Season of play | sportId | optional.Int32| Top level organization of a sport | withGameTypeDates | optional.Bool| Retrieve dates for each game type | 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]
Seasons1
SeasonsRestObject Seasons1(ctx, seasonId, optional) View season info
This endpoint allows you to pull seasons
Required Parameters
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
seasonId | string | Season of play | |
optional | *SeasonApiSeasons1Opts | optional parameters | nil if no parameters |
Optional Parameters
Optional parameters are passed through a pointer to a SeasonApiSeasons1Opts struct
Name | Type | Description | Notes |
---|
season | **optional.Interface of []string**| Season of play | sportId | optional.Int32| Top level organization of a sport | withGameTypeDates | optional.Bool| Retrieve dates for each game type | 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]