mlbstats/api/docs/StandingsAPI.md

6.8 KiB

\StandingsAPI

All URIs are relative to http://localhost

Method HTTP request Description
Standings Get /api/v1/standings/{standingsType} View standings for a league
Standings1 Get /api/v1/standings View standings for a league

Standings

Standings(ctx, standingsType).LeagueId(leagueId).Season(season).StandingsTypes(standingsTypes).Date(date).TeamId(teamId).IncludeMLB(includeMLB).Fields(fields).Execute()

View standings for a league

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "//"
)

func main() {
	standingsType := TODO // interface{} | Type of season. Available types in /api/v1/standingsTypes
	leagueId := TODO // interface{} | Unique League Identifier (optional)
	season := TODO // interface{} | Season of play (optional)
	standingsTypes := TODO // interface{} | Type of season. Available types in /api/v1/standingsTypes (optional)
	date := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (optional)
	teamId := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
	includeMLB := TODO // interface{} | Determines whether to include major league teams when using the 'BY_ORGANIZATION' standings type (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.StandingsAPI.Standings(context.Background(), standingsType).LeagueId(leagueId).Season(season).StandingsTypes(standingsTypes).Date(date).TeamId(teamId).IncludeMLB(includeMLB).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `StandingsAPI.Standings``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
standingsType interface{} Type of season. Available types in /api/v1/standingsTypes

Other Parameters

Other parameters are passed through a pointer to a apiStandingsRequest struct via the builder pattern

Name Type Description Notes

leagueId | interface{} | Unique League Identifier | season | interface{} | Season of play | standingsTypes | interface{} | Type of season. Available types in /api/v1/standingsTypes | date | interface{} | Date of Game. Format: YYYY-MM-DD | teamId | interface{} | Unique Team Identifier. Format: 141, 147, etc | includeMLB | interface{} | Determines whether to include major league teams when using the 'BY_ORGANIZATION' standings type | fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Standings1

Standings1(ctx, standingsType).LeagueId(leagueId).Season(season).StandingsTypes(standingsTypes).Date(date).TeamId(teamId).IncludeMLB(includeMLB).Fields(fields).Execute()

View standings for a league

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "//"
)

func main() {
	standingsType := TODO // interface{} | Type of season. Available types in /api/v1/standingsTypes
	leagueId := TODO // interface{} | Unique League Identifier (optional)
	season := TODO // interface{} | Season of play (optional)
	standingsTypes := TODO // interface{} | Type of season. Available types in /api/v1/standingsTypes (optional)
	date := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (optional)
	teamId := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
	includeMLB := TODO // interface{} | Determines whether to include major league teams when using the 'BY_ORGANIZATION' standings type (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.StandingsAPI.Standings1(context.Background(), standingsType).LeagueId(leagueId).Season(season).StandingsTypes(standingsTypes).Date(date).TeamId(teamId).IncludeMLB(includeMLB).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `StandingsAPI.Standings1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
standingsType interface{} Type of season. Available types in /api/v1/standingsTypes

Other Parameters

Other parameters are passed through a pointer to a apiStandings1Request struct via the builder pattern

Name Type Description Notes

leagueId | interface{} | Unique League Identifier | season | interface{} | Season of play | standingsTypes | interface{} | Type of season. Available types in /api/v1/standingsTypes | date | interface{} | Date of Game. Format: YYYY-MM-DD | teamId | interface{} | Unique Team Identifier. Format: 141, 147, etc | includeMLB | interface{} | Determines whether to include major league teams when using the 'BY_ORGANIZATION' standings type | fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]