mlbstats/api/docs/PersonAPI.md

34 KiB

\PersonAPI

All URIs are relative to http://localhost

Method HTTP request Description
Award Get /api/v1/people/{personId}/awards View a player's awards
CurrentGameStats Get /api/v1/people/changes View a player's change log
FreeAgents Get /api/v1/people/freeAgents Get free agents
Person Get /api/v1/people/{personId} View a player
Person1 Get /api/v1/people View a player
PlayerGameStats Get /api/v1/people/{personId}/stats/game/{gamePk} View a player's game stats
Search Get /api/v1/people/search Search for a player by name
Stats3 Get /api/v1/people/{personId}/stats View a players stats
StatsMetrics Get /api/v1/people/{personId}/stats/metrics View a player's stat metrics

Award

Award(ctx, personId).Fields(fields).Execute()

View a player's awards

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	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.PersonAPI.Award(context.Background(), personId).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.Award``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc

Other Parameters

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

Name Type Description Notes

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]

CurrentGameStats

CurrentGameStats(ctx).UpdatedSince(updatedSince).Limit(limit).Offset(offset).Accent(accent).Fields(fields).Execute()

View a player's change log

Example

package main

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

func main() {
	updatedSince := TODO // interface{} | Format: YYYY-MM-DDTHH:MM:SSZ
	limit := TODO // interface{} | Number of results to return (optional)
	offset := TODO // interface{} | The pointer to start for a return set; used for pagination (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (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.PersonAPI.CurrentGameStats(context.Background()).UpdatedSince(updatedSince).Limit(limit).Offset(offset).Accent(accent).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.CurrentGameStats``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
updatedSince interface{} Format: YYYY-MM-DDTHH:MM:SSZ
limit interface{} Number of results to return
offset interface{} The pointer to start for a return set; used for pagination
accent interface{} Boolean value to specify wanting a person's name with accents or without
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]

FreeAgents

FreeAgents(ctx).Season(season).Order(order).Accent(accent).Fields(fields).Execute()

Get free agents

Example

package main

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

func main() {
	season := TODO // interface{} | Season of play
	order := TODO // interface{} | The order of sorting, ascending or descending (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (optional)
	fields := TODO // interface{} |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.PersonAPI.FreeAgents(context.Background()).Season(season).Order(order).Accent(accent).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.FreeAgents``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
season interface{} Season of play
order interface{} The order of sorting, ascending or descending
accent interface{} Boolean value to specify wanting a person's name with accents or without
fields interface{}

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]

Person

Person(ctx, personId).PersonIds(personIds).Accent(accent).Season(season).Group(group).Fields(fields).Execute()

View a player

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	personIds := TODO // interface{} | Comma delimited list of person ID. Format: 1234, 2345 (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (optional)
	season := TODO // interface{} | Season of play (optional)
	group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups (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.PersonAPI.Person(context.Background(), personId).PersonIds(personIds).Accent(accent).Season(season).Group(group).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.Person``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc

Other Parameters

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

Name Type Description Notes

personIds | interface{} | Comma delimited list of person ID. Format: 1234, 2345 | accent | interface{} | Boolean value to specify wanting a person's name with accents or without | season | interface{} | Season of play | group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | 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]

Person1

Person1(ctx, personId).PersonIds(personIds).Accent(accent).Season(season).Group(group).Fields(fields).Execute()

View a player

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	personIds := TODO // interface{} | Comma delimited list of person ID. Format: 1234, 2345 (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (optional)
	season := TODO // interface{} | Season of play (optional)
	group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups (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.PersonAPI.Person1(context.Background(), personId).PersonIds(personIds).Accent(accent).Season(season).Group(group).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.Person1``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc

Other Parameters

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

Name Type Description Notes

personIds | interface{} | Comma delimited list of person ID. Format: 1234, 2345 | accent | interface{} | Boolean value to specify wanting a person's name with accents or without | season | interface{} | Season of play | group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | 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]

PlayerGameStats

PlayerGameStats(ctx, personId, gamePk).Group(group).Fields(fields).Execute()

View a player's game stats

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	gamePk := TODO // interface{} | Unique Primary Key Representing a Game
	group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups (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.PersonAPI.PlayerGameStats(context.Background(), personId, gamePk).Group(group).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.PlayerGameStats``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc
gamePk interface{} Unique Primary Key Representing a Game

Other Parameters

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

Name Type Description Notes

group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | 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]

Search(ctx).Names(names).PersonIds(personIds).SportIds(sportIds).LeagueIds(leagueIds).TeamIds(teamIds).LeagueListId(leagueListId).Active(active).Verified(verified).Rookie(rookie).Seasons(seasons).Fields(fields).Accent(accent).Limit(limit).Execute()

Search for a player by name

Example

package main

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

func main() {
	names := TODO // interface{} | Name a player uses (optional)
	personIds := TODO // interface{} | Comma delimited list of person ID. Format: 1234, 2345 (optional)
	sportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
	leagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
	teamIds := TODO // interface{} | Comma delimited list of Unique Team identifiers (optional)
	leagueListId := TODO // interface{} | Unique League List Identifier (optional)
	active := TODO // interface{} | Whether or not a player is active (optional)
	verified := TODO // interface{} | Complete and confirmed all biographical data (optional)
	rookie := TODO // interface{} | Whether or not a player is a rookie (optional)
	seasons := TODO // interface{} | Comma delimited list of Seasons of play (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (optional)
	limit := TODO // interface{} | Number of results to return (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.PersonAPI.Search(context.Background()).Names(names).PersonIds(personIds).SportIds(sportIds).LeagueIds(leagueIds).TeamIds(teamIds).LeagueListId(leagueListId).Active(active).Verified(verified).Rookie(rookie).Seasons(seasons).Fields(fields).Accent(accent).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.Search``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

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

Name Type Description Notes
names interface{} Name a player uses
personIds interface{} Comma delimited list of person ID. Format: 1234, 2345
sportIds interface{} Comma delimited list of top level organizations of a sport
leagueIds interface{} Comma delimited list of Unique league identifiers
teamIds interface{} Comma delimited list of Unique Team identifiers
leagueListId interface{} Unique League List Identifier
active interface{} Whether or not a player is active
verified interface{} Complete and confirmed all biographical data
rookie interface{} Whether or not a player is a rookie
seasons interface{} Comma delimited list of Seasons of play
fields interface{} Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
accent interface{} Boolean value to specify wanting a person's name with accents or without
limit interface{} Number of results to return

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]

Stats3

Stats3(ctx, personId).Stats(stats).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Metrics(metrics).LeagueId(leagueId).LeagueListId(leagueListId).SitCodes(sitCodes).CombineSits(combineSits).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).Limit(limit).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).GameType(gameType).GroupBy(groupBy).Accent(accent).Fields(fields).Execute()

View a players stats

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	stats := TODO // interface{} | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes
	group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups (optional)
	season := TODO // interface{} | Season of play (optional)
	seasons := TODO // interface{} | Comma delimited list of Seasons of play (optional)
	sportId := TODO // interface{} | Top level organization of a sport (optional)
	opposingTeamId := TODO // interface{} | A unique identifier for the opposing team. Must be used with Team ID (optional)
	opposingPlayerId := TODO // interface{} | A unique identifier for the opposing team (optional)
	metrics := TODO // interface{} | Name of metric(s) for metric log stats.  Available metrics in /api/v1/metrics (optional)
	leagueId := TODO // interface{} | Unique League Identifier (optional)
	leagueListId := TODO // interface{} | Unique League List Identifier (optional)
	sitCodes := TODO // interface{} | Situation code for a given stat split. (optional)
	combineSits := TODO // interface{} | 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 (optional)
	startDate := TODO // interface{} | Start date for range of data (must be used with end date). Format: MM/DD/YYYY (optional)
	endDate := TODO // interface{} | End date for range of data (must be used with start date). Format: MM/DD/YYYY (optional)
	daysBack := TODO // interface{} | Returns results from the last 'X' days (Starting from yesterday). (optional)
	gamesBack := TODO // interface{} | Returns results from the last 'X' games played. (optional)
	limit := TODO // interface{} | Number of results to return (optional)
	eventType := TODO // interface{} | Type of event (optional)
	pitchType := TODO // interface{} | Classification of pitch (fastball, curveball, etc...) (optional)
	hitTrajectory := TODO // interface{} | Trajectory of hit (line drive, fly ball, etc...) (optional)
	batSide := TODO // interface{} | Bat side of hitter (optional)
	gameType := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (optional)
	groupBy := TODO // interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (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.PersonAPI.Stats3(context.Background(), personId).Stats(stats).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Metrics(metrics).LeagueId(leagueId).LeagueListId(leagueListId).SitCodes(sitCodes).CombineSits(combineSits).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).Limit(limit).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).GameType(gameType).GroupBy(groupBy).Accent(accent).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.Stats3``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc

Other Parameters

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

Name Type Description Notes

stats | interface{} | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes | group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | season | interface{} | Season of play | seasons | interface{} | Comma delimited list of Seasons of play | sportId | interface{} | Top level organization of a sport | opposingTeamId | interface{} | A unique identifier for the opposing team. Must be used with Team ID | opposingPlayerId | interface{} | A unique identifier for the opposing team | metrics | interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics | leagueId | interface{} | Unique League Identifier | leagueListId | interface{} | Unique League List Identifier | sitCodes | interface{} | Situation code for a given stat split. | combineSits | interface{} | 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 | startDate | interface{} | Start date for range of data (must be used with end date). Format: MM/DD/YYYY | endDate | interface{} | End date for range of data (must be used with start date). Format: MM/DD/YYYY | daysBack | interface{} | Returns results from the last 'X' days (Starting from yesterday). | gamesBack | interface{} | Returns results from the last 'X' games played. | limit | interface{} | Number of results to return | eventType | interface{} | Type of event | pitchType | interface{} | Classification of pitch (fastball, curveball, etc...) | hitTrajectory | interface{} | Trajectory of hit (line drive, fly ball, etc...) | batSide | interface{} | Bat side of hitter | gameType | interface{} | Type of Game. Available types in /api/v1/gameTypes | groupBy | interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP | accent | interface{} | Boolean value to specify wanting a person's name with accents or without | 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]

StatsMetrics

StatsMetrics(ctx, personId).Stats(stats).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Metrics(metrics).LeagueId(leagueId).LeagueListId(leagueListId).SitCodes(sitCodes).CombineSits(combineSits).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).Limit(limit).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).GameType(gameType).GroupBy(groupBy).Accent(accent).Fields(fields).Execute()

View a player's stat metrics

Example

package main

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

func main() {
	personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc
	stats := TODO // interface{} | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes
	group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups (optional)
	season := TODO // interface{} | Season of play (optional)
	seasons := TODO // interface{} | Comma delimited list of Seasons of play (optional)
	sportId := TODO // interface{} | Top level organization of a sport (optional)
	opposingTeamId := TODO // interface{} | A unique identifier for the opposing team. Must be used with Team ID (optional)
	opposingPlayerId := TODO // interface{} | A unique identifier for the opposing team (optional)
	metrics := TODO // interface{} | Name of metric(s) for metric log stats.  Available metrics in /api/v1/metrics (optional)
	leagueId := TODO // interface{} | Unique League Identifier (optional)
	leagueListId := TODO // interface{} | Unique League List Identifier (optional)
	sitCodes := TODO // interface{} | Situation code for a given stat split. (optional)
	combineSits := TODO // interface{} | 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 (optional)
	startDate := TODO // interface{} | Start date for range of data (must be used with end date). Format: MM/DD/YYYY (optional)
	endDate := TODO // interface{} | End date for range of data (must be used with start date). Format: MM/DD/YYYY (optional)
	daysBack := TODO // interface{} | Returns results from the last 'X' days (Starting from yesterday). (optional)
	gamesBack := TODO // interface{} | Returns results from the last 'X' games played. (optional)
	limit := TODO // interface{} | Number of results to return (optional)
	eventType := TODO // interface{} | Type of event (optional)
	pitchType := TODO // interface{} | Classification of pitch (fastball, curveball, etc...) (optional)
	hitTrajectory := TODO // interface{} | Trajectory of hit (line drive, fly ball, etc...) (optional)
	batSide := TODO // interface{} | Bat side of hitter (optional)
	gameType := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (optional)
	groupBy := TODO // interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP (optional)
	accent := TODO // interface{} | Boolean value to specify wanting a person's name with accents or without (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.PersonAPI.StatsMetrics(context.Background(), personId).Stats(stats).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Metrics(metrics).LeagueId(leagueId).LeagueListId(leagueListId).SitCodes(sitCodes).CombineSits(combineSits).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).Limit(limit).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).GameType(gameType).GroupBy(groupBy).Accent(accent).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `PersonAPI.StatsMetrics``: %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.
personId interface{} Unique Player Identifier. Format: 434538, 429665, etc

Other Parameters

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

Name Type Description Notes

stats | interface{} | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes | group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | season | interface{} | Season of play | seasons | interface{} | Comma delimited list of Seasons of play | sportId | interface{} | Top level organization of a sport | opposingTeamId | interface{} | A unique identifier for the opposing team. Must be used with Team ID | opposingPlayerId | interface{} | A unique identifier for the opposing team | metrics | interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics | leagueId | interface{} | Unique League Identifier | leagueListId | interface{} | Unique League List Identifier | sitCodes | interface{} | Situation code for a given stat split. | combineSits | interface{} | 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 | startDate | interface{} | Start date for range of data (must be used with end date). Format: MM/DD/YYYY | endDate | interface{} | End date for range of data (must be used with start date). Format: MM/DD/YYYY | daysBack | interface{} | Returns results from the last 'X' days (Starting from yesterday). | gamesBack | interface{} | Returns results from the last 'X' games played. | limit | interface{} | Number of results to return | eventType | interface{} | Type of event | pitchType | interface{} | Classification of pitch (fastball, curveball, etc...) | hitTrajectory | interface{} | Trajectory of hit (line drive, fly ball, etc...) | batSide | interface{} | Bat side of hitter | gameType | interface{} | Type of Game. Available types in /api/v1/gameTypes | groupBy | interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP | accent | interface{} | Boolean value to specify wanting a person's name with accents or without | 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]