64 KiB
\StatsAPI
All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
BeastStats | Get /api/v1/stats/search | View stats from search |
GetOutsAboveAverage | Get /api/v1/stats/analytics/outsAboveAverage | Get outs above average for the current batter |
GetSprayChart | Get /api/v1/stats/analytics/sprayChart | Get the spray chart info for the current batter |
GetStolenBaseProbability | Get /api/v1/stats/analytics/stolenBaseProbability | Get the probability of a hit for the given hit data |
GroupedStats | Get /api/v1/stats/grouped | View grouped stats |
Leaders2 | Get /api/v1/stats/leaders | Get leaders for a statistic |
MetricStats | Get /api/v1/stats/metrics | View metric stats |
Stats2 | Get /api/v1/stats | View stats |
BeastStats
BeastStats(ctx).Group(group).GamePks(gamePks).PlayIds(playIds).Seasons(seasons).GameTypes(gameTypes).Date(date).StartDate(startDate).EndDate(endDate).TeamIds(teamIds).PitcherTeamIds(pitcherTeamIds).BatterTeamIds(batterTeamIds).SportIds(sportIds).PitcherSportIds(pitcherSportIds).BatterSportIds(batterSportIds).LeagueIds(leagueIds).PitcherLeagueIds(pitcherLeagueIds).BatterLeagueIds(batterLeagueIds).DivisionIds(divisionIds).PitcherDivisionIds(pitcherDivisionIds).BatterDivisionIds(batterDivisionIds).PitchersOnTeamIds(pitchersOnTeamIds).BattersOnTeamIds(battersOnTeamIds).PlayerIds(playerIds).PlayerPool(playerPool).PitcherIds(pitcherIds).BatterIds(batterIds).CatcherIds(catcherIds).FirstBasemanIds(firstBasemanIds).SecondBasemanIds(secondBasemanIds).ThirdBasemanIds(thirdBasemanIds).ShortstopIds(shortstopIds).LeftFielderIds(leftFielderIds).CenterFielderIds(centerFielderIds).RightFielderIds(rightFielderIds).RunnerFirstIds(runnerFirstIds).RunnerSecondIds(runnerSecondIds).RunnerThirdIds(runnerThirdIds).VenueIds(venueIds).PitchHand(pitchHand).BatSide(batSide).PitchTypes(pitchTypes).PitchCodes(pitchCodes).EventTypes(eventTypes).Positions(positions).PrimaryPositions(primaryPositions).MinPitchSpeed(minPitchSpeed).MaxPitchSpeed(maxPitchSpeed).MinSpinRate(minSpinRate).MaxSpinRate(maxSpinRate).MinExtension(minExtension).MaxExtension(maxExtension).MinExitVelocityAgainst(minExitVelocityAgainst).MaxExitVelocityAgainst(maxExitVelocityAgainst).MinLaunchAngleAgainst(minLaunchAngleAgainst).MaxLaunchAngleAgainst(maxLaunchAngleAgainst).MinExitVelocity(minExitVelocity).MaxExitVelocity(maxExitVelocity).MinLaunchAngle(minLaunchAngle).MaxLaunchAngle(maxLaunchAngle).MinHomeRunDistance(minHomeRunDistance).MaxHomeRunDistance(maxHomeRunDistance).MinHitDistance(minHitDistance).MaxHitDistance(maxHitDistance).MinHangTime(minHangTime).MaxHangTime(maxHangTime).MinHitProbability(minHitProbability).MaxHitProbability(maxHitProbability).MinCatchProbability(minCatchProbability).MaxCatchProbability(maxCatchProbability).MinAttackAngle(minAttackAngle).MaxAttackAngle(maxAttackAngle).MinBatSpeed(minBatSpeed).MaxBatSpeed(maxBatSpeed).MinHomeRunXBallparks(minHomeRunXBallparks).MaxHomeRunXBallparks(maxHomeRunXBallparks).IsBarrel(isBarrel).HitTrajectories(hitTrajectories).Limit(limit).Offset(offset).GroupBy(groupBy).CompareOver(compareOver).SortStat(sortStat).SortModifier(sortModifier).SortOrder(sortOrder).Percentile(percentile).MinOccurrences(minOccurrences).MinPlateAppearances(minPlateAppearances).MinInnings(minInnings).QualifierRate(qualifierRate).SitCodes(sitCodes).ShowTotals(showTotals).IncludeNullMetrics(includeNullMetrics).StatFields(statFields).AtBatNumbers(atBatNumbers).PitchNumbers(pitchNumbers).Fields(fields).Debug(debug).ActiveStatus(activeStatus).Execute()
View stats from search
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
group := TODO // interface{} | Category of statistic to return. Available types in /api/v1/statGroups
gamePks := TODO // interface{} | Comma delimited list of unique primary keys (optional)
playIds := TODO // interface{} | Comma delimited list of unique play identifiers (optional)
seasons := TODO // interface{} | Comma delimited list of Seasons of play (optional)
gameTypes := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (optional)
date := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (optional)
startDate := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (optional)
endDate := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (optional)
teamIds := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
pitcherTeamIds := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
batterTeamIds := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
sportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
pitcherSportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
batterSportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
leagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
pitcherLeagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
batterLeagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
divisionIds := TODO // interface{} | Comma delimited list of Unique League Identifiers (optional)
pitcherDivisionIds := TODO // interface{} | Comma delimited list of Unique League Identifiers (optional)
batterDivisionIds := TODO // interface{} | Comma delimited list of Unique League Identifiers (optional)
pitchersOnTeamIds := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
battersOnTeamIds := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
playerIds := TODO // interface{} | A unique identifier for a player (optional)
playerPool := TODO // interface{} | Return \"ALL\" or only \"QUALIFIED\" players based on plate appearances. (optional)
pitcherIds := TODO // interface{} | A unique identifier for a player (optional)
batterIds := TODO // interface{} | A unique identifier for a player (optional)
catcherIds := TODO // interface{} | A unique identifier for a player (optional)
firstBasemanIds := TODO // interface{} | A unique identifier for a player (optional)
secondBasemanIds := TODO // interface{} | A unique identifier for a player (optional)
thirdBasemanIds := TODO // interface{} | A unique identifier for a player (optional)
shortstopIds := TODO // interface{} | A unique identifier for a player (optional)
leftFielderIds := TODO // interface{} | A unique identifier for a player (optional)
centerFielderIds := TODO // interface{} | A unique identifier for a player (optional)
rightFielderIds := TODO // interface{} | A unique identifier for a player (optional)
runnerFirstIds := TODO // interface{} | A unique identifier for a player (optional)
runnerSecondIds := TODO // interface{} | A unique identifier for a player (optional)
runnerThirdIds := TODO // interface{} | A unique identifier for a player (optional)
venueIds := TODO // interface{} | Unique Venue Identifier (optional)
pitchHand := TODO // interface{} | Handedness of pitcher (optional)
batSide := TODO // interface{} | Bat side of hitter (optional)
pitchTypes := TODO // interface{} | Classification of pitch (fastball, curveball, etc...) (optional)
pitchCodes := TODO // interface{} | Result of the pitch (ball, called strike, etc...) (optional)
eventTypes := TODO // interface{} | Type of event (optional)
positions := TODO // interface{} | All of the details of a player's position (optional)
primaryPositions := TODO // interface{} | All of the details of a player's position (optional)
minPitchSpeed := TODO // interface{} | Minimum value to filter on (optional)
maxPitchSpeed := TODO // interface{} | Maximum value to filter on (optional)
minSpinRate := TODO // interface{} | Minimum value to filter on (optional)
maxSpinRate := TODO // interface{} | Maximum value to filter on (optional)
minExtension := TODO // interface{} | Minimum value to filter on (optional)
maxExtension := TODO // interface{} | Maximum value to filter on (optional)
minExitVelocityAgainst := TODO // interface{} | Minimum value to filter on (optional)
maxExitVelocityAgainst := TODO // interface{} | Maximum value to filter on (optional)
minLaunchAngleAgainst := TODO // interface{} | Minimum value to filter on (optional)
maxLaunchAngleAgainst := TODO // interface{} | Maximum value to filter on (optional)
minExitVelocity := TODO // interface{} | Minimum value to filter on (optional)
maxExitVelocity := TODO // interface{} | Maximum value to filter on (optional)
minLaunchAngle := TODO // interface{} | Minimum value to filter on (optional)
maxLaunchAngle := TODO // interface{} | Maximum value to filter on (optional)
minHomeRunDistance := TODO // interface{} | Minimum value to filter on (optional)
maxHomeRunDistance := TODO // interface{} | Maximum value to filter on (optional)
minHitDistance := TODO // interface{} | Minimum value to filter on (optional)
maxHitDistance := TODO // interface{} | Maximum value to filter on (optional)
minHangTime := TODO // interface{} | Minimum value to filter on (optional)
maxHangTime := TODO // interface{} | Maximum value to filter on (optional)
minHitProbability := TODO // interface{} | Minimum value to filter on (optional)
maxHitProbability := TODO // interface{} | Maximum value to filter on (optional)
minCatchProbability := TODO // interface{} | Minimum value to filter on (optional)
maxCatchProbability := TODO // interface{} | Maximum value to filter on (optional)
minAttackAngle := TODO // interface{} | Minimum value to filter on (optional)
maxAttackAngle := TODO // interface{} | Maximum value to filter on (optional)
minBatSpeed := TODO // interface{} | Minimum value to filter on (optional)
maxBatSpeed := TODO // interface{} | Maximum value to filter on (optional)
minHomeRunXBallparks := TODO // interface{} | Minimum value to filter on (optional)
maxHomeRunXBallparks := TODO // interface{} | Maximum value to filter on (optional)
isBarrel := TODO // interface{} | Whether or not a play resulted in a barreled ball (optional)
hitTrajectories := TODO // interface{} | Trajectory of hit (line drive, fly ball, etc...) (optional)
limit := TODO // interface{} | Number of results to return (optional)
offset := TODO // interface{} | The pointer to start for a return set; used for pagination (optional)
groupBy := TODO // interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP (optional)
compareOver := TODO // interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP (optional)
sortStat := TODO // interface{} | Baseball stat to sort splits by. (optional)
sortModifier := TODO // interface{} | The prefix modifier for the sort stat. avg, min, max. I.E minExitVelocity, maxLaunchAngle, avgHitDistance (optional)
sortOrder := TODO // interface{} | The order of sorting, ascending or descending (optional)
percentile := TODO // interface{} | Only return averages above this percentile. used for best effort plays (optional)
minOccurrences := TODO // interface{} | Minimum occurrences to filter upon (optional)
minPlateAppearances := TODO // interface{} | Minimum occurrences to filter upon (optional)
minInnings := TODO // interface{} | Minimum occurrences to filter upon (optional)
qualifierRate := TODO // interface{} | Minimum occurrences to filter upon (optional)
sitCodes := TODO // interface{} | Situation code for a given stat split. (optional)
showTotals := TODO // interface{} | Columns to return totals (optional)
includeNullMetrics := TODO // interface{} | Show events with null metrics (optional)
statFields := TODO // interface{} | Baseball stat fields to populate (optional)
atBatNumbers := TODO // interface{} | The at bat number of a given game. Format: 1, 2, 3, etc (optional)
pitchNumbers := TODO // interface{} | The pitch number of a given game. Format: 1, 2, 3, etc (optional)
fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)
debug := TODO // interface{} | (optional)
activeStatus := TODO // interface{} | Whether or not a player is active (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.BeastStats(context.Background()).Group(group).GamePks(gamePks).PlayIds(playIds).Seasons(seasons).GameTypes(gameTypes).Date(date).StartDate(startDate).EndDate(endDate).TeamIds(teamIds).PitcherTeamIds(pitcherTeamIds).BatterTeamIds(batterTeamIds).SportIds(sportIds).PitcherSportIds(pitcherSportIds).BatterSportIds(batterSportIds).LeagueIds(leagueIds).PitcherLeagueIds(pitcherLeagueIds).BatterLeagueIds(batterLeagueIds).DivisionIds(divisionIds).PitcherDivisionIds(pitcherDivisionIds).BatterDivisionIds(batterDivisionIds).PitchersOnTeamIds(pitchersOnTeamIds).BattersOnTeamIds(battersOnTeamIds).PlayerIds(playerIds).PlayerPool(playerPool).PitcherIds(pitcherIds).BatterIds(batterIds).CatcherIds(catcherIds).FirstBasemanIds(firstBasemanIds).SecondBasemanIds(secondBasemanIds).ThirdBasemanIds(thirdBasemanIds).ShortstopIds(shortstopIds).LeftFielderIds(leftFielderIds).CenterFielderIds(centerFielderIds).RightFielderIds(rightFielderIds).RunnerFirstIds(runnerFirstIds).RunnerSecondIds(runnerSecondIds).RunnerThirdIds(runnerThirdIds).VenueIds(venueIds).PitchHand(pitchHand).BatSide(batSide).PitchTypes(pitchTypes).PitchCodes(pitchCodes).EventTypes(eventTypes).Positions(positions).PrimaryPositions(primaryPositions).MinPitchSpeed(minPitchSpeed).MaxPitchSpeed(maxPitchSpeed).MinSpinRate(minSpinRate).MaxSpinRate(maxSpinRate).MinExtension(minExtension).MaxExtension(maxExtension).MinExitVelocityAgainst(minExitVelocityAgainst).MaxExitVelocityAgainst(maxExitVelocityAgainst).MinLaunchAngleAgainst(minLaunchAngleAgainst).MaxLaunchAngleAgainst(maxLaunchAngleAgainst).MinExitVelocity(minExitVelocity).MaxExitVelocity(maxExitVelocity).MinLaunchAngle(minLaunchAngle).MaxLaunchAngle(maxLaunchAngle).MinHomeRunDistance(minHomeRunDistance).MaxHomeRunDistance(maxHomeRunDistance).MinHitDistance(minHitDistance).MaxHitDistance(maxHitDistance).MinHangTime(minHangTime).MaxHangTime(maxHangTime).MinHitProbability(minHitProbability).MaxHitProbability(maxHitProbability).MinCatchProbability(minCatchProbability).MaxCatchProbability(maxCatchProbability).MinAttackAngle(minAttackAngle).MaxAttackAngle(maxAttackAngle).MinBatSpeed(minBatSpeed).MaxBatSpeed(maxBatSpeed).MinHomeRunXBallparks(minHomeRunXBallparks).MaxHomeRunXBallparks(maxHomeRunXBallparks).IsBarrel(isBarrel).HitTrajectories(hitTrajectories).Limit(limit).Offset(offset).GroupBy(groupBy).CompareOver(compareOver).SortStat(sortStat).SortModifier(sortModifier).SortOrder(sortOrder).Percentile(percentile).MinOccurrences(minOccurrences).MinPlateAppearances(minPlateAppearances).MinInnings(minInnings).QualifierRate(qualifierRate).SitCodes(sitCodes).ShowTotals(showTotals).IncludeNullMetrics(includeNullMetrics).StatFields(statFields).AtBatNumbers(atBatNumbers).PitchNumbers(pitchNumbers).Fields(fields).Debug(debug).ActiveStatus(activeStatus).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.BeastStats``: %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 apiBeastStatsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
group | interface{} | Category of statistic to return. Available types in /api/v1/statGroups | |
gamePks | interface{} | Comma delimited list of unique primary keys | |
playIds | interface{} | Comma delimited list of unique play identifiers | |
seasons | interface{} | Comma delimited list of Seasons of play | |
gameTypes | interface{} | Type of Game. Available types in /api/v1/gameTypes | |
date | interface{} | Date of Game. Format: YYYY-MM-DD | |
startDate | interface{} | Date of Game. Format: YYYY-MM-DD | |
endDate | interface{} | Date of Game. Format: YYYY-MM-DD | |
teamIds | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
pitcherTeamIds | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
batterTeamIds | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
sportIds | interface{} | Comma delimited list of top level organizations of a sport | |
pitcherSportIds | interface{} | Comma delimited list of top level organizations of a sport | |
batterSportIds | interface{} | Comma delimited list of top level organizations of a sport | |
leagueIds | interface{} | Comma delimited list of Unique league identifiers | |
pitcherLeagueIds | interface{} | Comma delimited list of Unique league identifiers | |
batterLeagueIds | interface{} | Comma delimited list of Unique league identifiers | |
divisionIds | interface{} | Comma delimited list of Unique League Identifiers | |
pitcherDivisionIds | interface{} | Comma delimited list of Unique League Identifiers | |
batterDivisionIds | interface{} | Comma delimited list of Unique League Identifiers | |
pitchersOnTeamIds | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
battersOnTeamIds | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
playerIds | interface{} | A unique identifier for a player | |
playerPool | interface{} | Return "ALL" or only "QUALIFIED" players based on plate appearances. | |
pitcherIds | interface{} | A unique identifier for a player | |
batterIds | interface{} | A unique identifier for a player | |
catcherIds | interface{} | A unique identifier for a player | |
firstBasemanIds | interface{} | A unique identifier for a player | |
secondBasemanIds | interface{} | A unique identifier for a player | |
thirdBasemanIds | interface{} | A unique identifier for a player | |
shortstopIds | interface{} | A unique identifier for a player | |
leftFielderIds | interface{} | A unique identifier for a player | |
centerFielderIds | interface{} | A unique identifier for a player | |
rightFielderIds | interface{} | A unique identifier for a player | |
runnerFirstIds | interface{} | A unique identifier for a player | |
runnerSecondIds | interface{} | A unique identifier for a player | |
runnerThirdIds | interface{} | A unique identifier for a player | |
venueIds | interface{} | Unique Venue Identifier | |
pitchHand | interface{} | Handedness of pitcher | |
batSide | interface{} | Bat side of hitter | |
pitchTypes | interface{} | Classification of pitch (fastball, curveball, etc...) | |
pitchCodes | interface{} | Result of the pitch (ball, called strike, etc...) | |
eventTypes | interface{} | Type of event | |
positions | interface{} | All of the details of a player's position | |
primaryPositions | interface{} | All of the details of a player's position | |
minPitchSpeed | interface{} | Minimum value to filter on | |
maxPitchSpeed | interface{} | Maximum value to filter on | |
minSpinRate | interface{} | Minimum value to filter on | |
maxSpinRate | interface{} | Maximum value to filter on | |
minExtension | interface{} | Minimum value to filter on | |
maxExtension | interface{} | Maximum value to filter on | |
minExitVelocityAgainst | interface{} | Minimum value to filter on | |
maxExitVelocityAgainst | interface{} | Maximum value to filter on | |
minLaunchAngleAgainst | interface{} | Minimum value to filter on | |
maxLaunchAngleAgainst | interface{} | Maximum value to filter on | |
minExitVelocity | interface{} | Minimum value to filter on | |
maxExitVelocity | interface{} | Maximum value to filter on | |
minLaunchAngle | interface{} | Minimum value to filter on | |
maxLaunchAngle | interface{} | Maximum value to filter on | |
minHomeRunDistance | interface{} | Minimum value to filter on | |
maxHomeRunDistance | interface{} | Maximum value to filter on | |
minHitDistance | interface{} | Minimum value to filter on | |
maxHitDistance | interface{} | Maximum value to filter on | |
minHangTime | interface{} | Minimum value to filter on | |
maxHangTime | interface{} | Maximum value to filter on | |
minHitProbability | interface{} | Minimum value to filter on | |
maxHitProbability | interface{} | Maximum value to filter on | |
minCatchProbability | interface{} | Minimum value to filter on | |
maxCatchProbability | interface{} | Maximum value to filter on | |
minAttackAngle | interface{} | Minimum value to filter on | |
maxAttackAngle | interface{} | Maximum value to filter on | |
minBatSpeed | interface{} | Minimum value to filter on | |
maxBatSpeed | interface{} | Maximum value to filter on | |
minHomeRunXBallparks | interface{} | Minimum value to filter on | |
maxHomeRunXBallparks | interface{} | Maximum value to filter on | |
isBarrel | interface{} | Whether or not a play resulted in a barreled ball | |
hitTrajectories | interface{} | Trajectory of hit (line drive, fly ball, etc...) | |
limit | interface{} | Number of results to return | |
offset | interface{} | The pointer to start for a return set; used for pagination | |
groupBy | interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP | |
compareOver | interface{} | Group stats by PLAYER, TEAM, SEASON, VENUE, SPORT or STAT_GROUP | |
sortStat | interface{} | Baseball stat to sort splits by. | |
sortModifier | interface{} | The prefix modifier for the sort stat. avg, min, max. I.E minExitVelocity, maxLaunchAngle, avgHitDistance | |
sortOrder | interface{} | The order of sorting, ascending or descending | |
percentile | interface{} | Only return averages above this percentile. used for best effort plays | |
minOccurrences | interface{} | Minimum occurrences to filter upon | |
minPlateAppearances | interface{} | Minimum occurrences to filter upon | |
minInnings | interface{} | Minimum occurrences to filter upon | |
qualifierRate | interface{} | Minimum occurrences to filter upon | |
sitCodes | interface{} | Situation code for a given stat split. | |
showTotals | interface{} | Columns to return totals | |
includeNullMetrics | interface{} | Show events with null metrics | |
statFields | interface{} | Baseball stat fields to populate | |
atBatNumbers | interface{} | The at bat number of a given game. Format: 1, 2, 3, etc | |
pitchNumbers | interface{} | The pitch number of a given game. Format: 1, 2, 3, etc | |
fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | |
debug | interface{} | ||
activeStatus | interface{} | Whether or not a player is active |
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]
GetOutsAboveAverage
GetOutsAboveAverage(ctx).GamePk(gamePk).Timecode(timecode).Fields(fields).Execute()
Get outs above average for the current batter
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
gamePk := TODO // interface{} |
timecode := TODO // interface{} | (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.StatsAPI.GetOutsAboveAverage(context.Background()).GamePk(gamePk).Timecode(timecode).Fields(fields).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.GetOutsAboveAverage``: %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 apiGetOutsAboveAverageRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
gamePk | interface{} | ||
timecode | interface{} | ||
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]
GetSprayChart
GetSprayChart(ctx).GamePk(gamePk).Timecode(timecode).Fields(fields).Execute()
Get the spray chart info for the current batter
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
gamePk := TODO // interface{} |
timecode := TODO // interface{} | (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.StatsAPI.GetSprayChart(context.Background()).GamePk(gamePk).Timecode(timecode).Fields(fields).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.GetSprayChart``: %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 apiGetSprayChartRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
gamePk | interface{} | ||
timecode | interface{} | ||
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]
GetStolenBaseProbability
GetStolenBaseProbability(ctx).GamePk(gamePk).Timecode(timecode).Execute()
Get the probability of a hit for the given hit data
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
gamePk := TODO // interface{} |
timecode := TODO // interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.GetStolenBaseProbability(context.Background()).GamePk(gamePk).Timecode(timecode).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.GetStolenBaseProbability``: %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 apiGetStolenBaseProbabilityRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
gamePk | interface{} | ||
timecode | 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]
GroupedStats
GroupedStats(ctx).Stats(stats).Group(group).PersonId(personId).TeamId(teamId).TeamIds(teamIds).GameType(gameType).Season(season).Seasons(seasons).SportId(sportId).SportIds(sportIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).Metrics(metrics).GamePk(gamePk).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).BatterId(batterId).PitcherId(pitcherId).SitCodes(sitCodes).CombineSits(combineSits).OpposingTeamId(opposingTeamId).Fields(fields).SortStat(sortStat).Order(order).PlayerPool(playerPool).Position(position).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).ExcludeTradedPlayers(excludeTradedPlayers).Offset(offset).Limit(limit).StatFields(statFields).SortField(sortField).Execute()
View grouped stats
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
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
personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
teamId := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
teamIds := TODO // interface{} | Comma delimited list of Unique Team identifiers (optional)
gameType := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (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)
sportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
leagueId := TODO // interface{} | Unique League Identifier (optional)
leagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
leagueListId := TODO // interface{} | Unique League List Identifier (optional)
metrics := TODO // interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics (optional)
gamePk := TODO // interface{} | Unique Primary Key Representing a Game (optional)
batterTeamId := TODO // interface{} | A unique identifier for the batter's team (optional)
pitcherTeamId := TODO // interface{} | A unique identifier for the pitcher's team (optional)
batterId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
pitcherId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (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)
opposingTeamId := TODO // interface{} | A unique identifier for the opposing team. Must be used with Team ID (optional)
fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)
sortStat := TODO // interface{} | Baseball stat to sort splits by. (optional)
order := TODO // interface{} | The order of sorting, ascending or descending (optional)
playerPool := TODO // interface{} | Return \"ALL\" or only \"QUALIFIED\" players based on plate appearances. (optional)
position := TODO // interface{} | Position number. Format: 1, 2, 3, etc (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)
excludeTradedPlayers := TODO // interface{} | Excludes players who have since been traded from the input team (optional)
offset := TODO // interface{} | The pointer to start for a return set; used for pagination (optional)
limit := TODO // interface{} | Number of results to return (optional)
statFields := TODO // interface{} | Baseball stat fields to populate (optional)
sortField := TODO // interface{} | Baseball statField to sort on. If no statField is given, sortField defaults to BASIC. If 1 statField is given, that is the default sortField. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.GroupedStats(context.Background()).Stats(stats).Group(group).PersonId(personId).TeamId(teamId).TeamIds(teamIds).GameType(gameType).Season(season).Seasons(seasons).SportId(sportId).SportIds(sportIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).Metrics(metrics).GamePk(gamePk).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).BatterId(batterId).PitcherId(pitcherId).SitCodes(sitCodes).CombineSits(combineSits).OpposingTeamId(opposingTeamId).Fields(fields).SortStat(sortStat).Order(order).PlayerPool(playerPool).Position(position).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).ExcludeTradedPlayers(excludeTradedPlayers).Offset(offset).Limit(limit).StatFields(statFields).SortField(sortField).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.GroupedStats``: %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 apiGroupedStatsRequest 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 | |
personId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
teamId | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
teamIds | interface{} | Comma delimited list of Unique Team identifiers | |
gameType | interface{} | Type of Game. Available types in /api/v1/gameTypes | |
season | interface{} | Season of play | |
seasons | interface{} | Comma delimited list of Seasons of play | |
sportId | interface{} | Top level organization of a sport | |
sportIds | interface{} | Comma delimited list of top level organizations of a sport | |
leagueId | interface{} | Unique League Identifier | |
leagueIds | interface{} | Comma delimited list of Unique league identifiers | |
leagueListId | interface{} | Unique League List Identifier | |
metrics | interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics | |
gamePk | interface{} | Unique Primary Key Representing a Game | |
batterTeamId | interface{} | A unique identifier for the batter's team | |
pitcherTeamId | interface{} | A unique identifier for the pitcher's team | |
batterId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
pitcherId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
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 | |
opposingTeamId | interface{} | A unique identifier for the opposing team. Must be used with Team ID | |
fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | |
sortStat | interface{} | Baseball stat to sort splits by. | |
order | interface{} | The order of sorting, ascending or descending | |
playerPool | interface{} | Return "ALL" or only "QUALIFIED" players based on plate appearances. | |
position | interface{} | Position number. Format: 1, 2, 3, etc | |
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. | |
excludeTradedPlayers | interface{} | Excludes players who have since been traded from the input team | |
offset | interface{} | The pointer to start for a return set; used for pagination | |
limit | interface{} | Number of results to return | |
statFields | interface{} | Baseball stat fields to populate | |
sortField | interface{} | Baseball statField to sort on. If no statField is given, sortField defaults to BASIC. If 1 statField is given, that is the default sortField. |
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]
Leaders2
Leaders2(ctx).LeaderCategories(leaderCategories).LeaderGameTypes(leaderGameTypes).StatGroup(statGroup).Season(season).Expand(expand).SportId(sportId).SportIds(sportIds).Stats(stats).Limit(limit).Offset(offset).TeamId(teamId).TeamIds(teamIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).PlayerPool(playerPool).StatType(statType).PlayerActive(playerActive).Position(position).SitCodes(sitCodes).OpposingTeamId(opposingTeamId).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).GroupBy(groupBy).Fields(fields).Execute()
Get leaders for a statistic
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
leaderCategories := TODO // interface{} | (optional)
leaderGameTypes := TODO // interface{} | (optional)
statGroup := TODO // interface{} | (optional)
season := TODO // interface{} | (optional)
expand := TODO // interface{} | (optional)
sportId := TODO // interface{} | (optional)
sportIds := TODO // interface{} | (optional)
stats := TODO // interface{} | (optional)
limit := TODO // interface{} | (optional)
offset := TODO // interface{} | (optional)
teamId := TODO // interface{} | (optional)
teamIds := TODO // interface{} | (optional)
leagueId := TODO // interface{} | (optional)
leagueIds := TODO // interface{} | (optional)
leagueListId := TODO // interface{} | (optional)
playerPool := TODO // interface{} | (optional)
statType := TODO // interface{} | (optional)
playerActive := TODO // interface{} | (optional)
position := TODO // interface{} | (optional)
sitCodes := TODO // interface{} | (optional)
opposingTeamId := TODO // interface{} | (optional)
startDate := TODO // interface{} | (optional)
endDate := TODO // interface{} | (optional)
daysBack := TODO // interface{} | (optional)
gamesBack := TODO // interface{} | (optional)
groupBy := TODO // interface{} | (optional)
fields := TODO // interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.Leaders2(context.Background()).LeaderCategories(leaderCategories).LeaderGameTypes(leaderGameTypes).StatGroup(statGroup).Season(season).Expand(expand).SportId(sportId).SportIds(sportIds).Stats(stats).Limit(limit).Offset(offset).TeamId(teamId).TeamIds(teamIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).PlayerPool(playerPool).StatType(statType).PlayerActive(playerActive).Position(position).SitCodes(sitCodes).OpposingTeamId(opposingTeamId).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).GroupBy(groupBy).Fields(fields).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.Leaders2``: %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 apiLeaders2Request struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
leaderCategories | interface{} | ||
leaderGameTypes | interface{} | ||
statGroup | interface{} | ||
season | interface{} | ||
expand | interface{} | ||
sportId | interface{} | ||
sportIds | interface{} | ||
stats | interface{} | ||
limit | interface{} | ||
offset | interface{} | ||
teamId | interface{} | ||
teamIds | interface{} | ||
leagueId | interface{} | ||
leagueIds | interface{} | ||
leagueListId | interface{} | ||
playerPool | interface{} | ||
statType | interface{} | ||
playerActive | interface{} | ||
position | interface{} | ||
sitCodes | interface{} | ||
opposingTeamId | interface{} | ||
startDate | interface{} | ||
endDate | interface{} | ||
daysBack | interface{} | ||
gamesBack | interface{} | ||
groupBy | interface{} | ||
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]
MetricStats
MetricStats(ctx).Stats(stats).Metrics(metrics).PersonId(personId).PersonIds(personIds).BatterId(batterId).PitcherId(pitcherId).TeamId(teamId).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Position(position).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).PitchHand(pitchHand).VenueId(venueId).GamePk(gamePk).MinValue(minValue).MaxValue(maxValue).Percentile(percentile).MinOccurrences(minOccurrences).Offset(offset).Limit(limit).Order(order).Date(date).StartDate(startDate).EndDate(endDate).GameType(gameType).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).Fields(fields).Debug(debug).Execute()
View metric stats
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
stats := TODO // interface{} | Type of statistics. Format: Individual, Team, Career, etc. Available types in /api/v1/statTypes
metrics := TODO // interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics
personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
personIds := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
batterId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
pitcherId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
teamId := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
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)
position := TODO // interface{} | All of the details of a player's position (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)
pitchHand := TODO // interface{} | Handedness of pitcher (optional)
venueId := TODO // interface{} | All of the details of a venue (optional)
gamePk := TODO // interface{} | Unique Primary Key Representing a Game (optional)
minValue := TODO // interface{} | Minimum value to filter on (optional)
maxValue := TODO // interface{} | Maximum value to filter on (optional)
percentile := TODO // interface{} | Only return averages above this percentile. used for best effort plays (optional)
minOccurrences := TODO // interface{} | Minimum occurrences to filter upon (optional)
offset := TODO // interface{} | The pointer to start for a return set; used for pagination (optional)
limit := TODO // interface{} | Number of results to return (optional)
order := TODO // interface{} | The order of sorting, ascending or descending (optional)
date := TODO // interface{} | Date of Game. Format: YYYY-MM-DD (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)
gameType := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (optional)
batterTeamId := TODO // interface{} | A unique identifier for the batter's team (optional)
pitcherTeamId := TODO // interface{} | A unique identifier for the pitcher's team (optional)
fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)
debug := TODO // interface{} | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.MetricStats(context.Background()).Stats(stats).Metrics(metrics).PersonId(personId).PersonIds(personIds).BatterId(batterId).PitcherId(pitcherId).TeamId(teamId).Group(group).Season(season).Seasons(seasons).SportId(sportId).OpposingTeamId(opposingTeamId).OpposingPlayerId(opposingPlayerId).Position(position).EventType(eventType).PitchType(pitchType).HitTrajectory(hitTrajectory).BatSide(batSide).PitchHand(pitchHand).VenueId(venueId).GamePk(gamePk).MinValue(minValue).MaxValue(maxValue).Percentile(percentile).MinOccurrences(minOccurrences).Offset(offset).Limit(limit).Order(order).Date(date).StartDate(startDate).EndDate(endDate).GameType(gameType).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).Fields(fields).Debug(debug).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.MetricStats``: %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 apiMetricStatsRequest 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 | |
metrics | interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics | |
personId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
personIds | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
batterId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
pitcherId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
teamId | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
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 | |
position | interface{} | All of the details of a player's position | |
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 | |
pitchHand | interface{} | Handedness of pitcher | |
venueId | interface{} | All of the details of a venue | |
gamePk | interface{} | Unique Primary Key Representing a Game | |
minValue | interface{} | Minimum value to filter on | |
maxValue | interface{} | Maximum value to filter on | |
percentile | interface{} | Only return averages above this percentile. used for best effort plays | |
minOccurrences | interface{} | Minimum occurrences to filter upon | |
offset | interface{} | The pointer to start for a return set; used for pagination | |
limit | interface{} | Number of results to return | |
order | interface{} | The order of sorting, ascending or descending | |
date | interface{} | Date of Game. Format: YYYY-MM-DD | |
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 | |
gameType | interface{} | Type of Game. Available types in /api/v1/gameTypes | |
batterTeamId | interface{} | A unique identifier for the batter's team | |
pitcherTeamId | interface{} | A unique identifier for the pitcher's team | |
fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute | |
debug | 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]
Stats2
Stats2(ctx).Stats(stats).Group(group).PersonId(personId).TeamId(teamId).TeamIds(teamIds).GameType(gameType).Season(season).Seasons(seasons).SportId(sportId).SportIds(sportIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).Metrics(metrics).GamePk(gamePk).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).BatterId(batterId).PitcherId(pitcherId).SitCodes(sitCodes).CombineSits(combineSits).OpposingTeamId(opposingTeamId).Fields(fields).SortStat(sortStat).Order(order).PlayerPool(playerPool).Position(position).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).ExcludeTradedPlayers(excludeTradedPlayers).Offset(offset).Limit(limit).Execute()
View stats
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "//"
)
func main() {
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
personId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
teamId := TODO // interface{} | Unique Team Identifier. Format: 141, 147, etc (optional)
teamIds := TODO // interface{} | Comma delimited list of Unique Team identifiers (optional)
gameType := TODO // interface{} | Type of Game. Available types in /api/v1/gameTypes (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)
sportIds := TODO // interface{} | Comma delimited list of top level organizations of a sport (optional)
leagueId := TODO // interface{} | Unique League Identifier (optional)
leagueIds := TODO // interface{} | Comma delimited list of Unique league identifiers (optional)
leagueListId := TODO // interface{} | Unique League List Identifier (optional)
metrics := TODO // interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics (optional)
gamePk := TODO // interface{} | Unique Primary Key Representing a Game (optional)
batterTeamId := TODO // interface{} | A unique identifier for the batter's team (optional)
pitcherTeamId := TODO // interface{} | A unique identifier for the pitcher's team (optional)
batterId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (optional)
pitcherId := TODO // interface{} | Unique Player Identifier. Format: 434538, 429665, etc (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)
opposingTeamId := TODO // interface{} | A unique identifier for the opposing team. Must be used with Team ID (optional)
fields := TODO // interface{} | (optional)
sortStat := TODO // interface{} | Baseball stat to sort splits by. (optional)
order := TODO // interface{} | The order of sorting, ascending or descending (optional)
playerPool := TODO // interface{} | Return \"ALL\" or only \"QUALIFIED\" players based on plate appearances. (optional)
position := TODO // interface{} | Position number. Format: 1, 2, 3, etc (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)
excludeTradedPlayers := TODO // interface{} | Excludes players who have since been traded from the input team (optional)
offset := TODO // interface{} | The pointer to start for a return set; used for pagination (optional)
limit := TODO // interface{} | Number of results to return (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.StatsAPI.Stats2(context.Background()).Stats(stats).Group(group).PersonId(personId).TeamId(teamId).TeamIds(teamIds).GameType(gameType).Season(season).Seasons(seasons).SportId(sportId).SportIds(sportIds).LeagueId(leagueId).LeagueIds(leagueIds).LeagueListId(leagueListId).Metrics(metrics).GamePk(gamePk).BatterTeamId(batterTeamId).PitcherTeamId(pitcherTeamId).BatterId(batterId).PitcherId(pitcherId).SitCodes(sitCodes).CombineSits(combineSits).OpposingTeamId(opposingTeamId).Fields(fields).SortStat(sortStat).Order(order).PlayerPool(playerPool).Position(position).StartDate(startDate).EndDate(endDate).DaysBack(daysBack).GamesBack(gamesBack).ExcludeTradedPlayers(excludeTradedPlayers).Offset(offset).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsAPI.Stats2``: %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 apiStats2Request 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 | |
personId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
teamId | interface{} | Unique Team Identifier. Format: 141, 147, etc | |
teamIds | interface{} | Comma delimited list of Unique Team identifiers | |
gameType | interface{} | Type of Game. Available types in /api/v1/gameTypes | |
season | interface{} | Season of play | |
seasons | interface{} | Comma delimited list of Seasons of play | |
sportId | interface{} | Top level organization of a sport | |
sportIds | interface{} | Comma delimited list of top level organizations of a sport | |
leagueId | interface{} | Unique League Identifier | |
leagueIds | interface{} | Comma delimited list of Unique league identifiers | |
leagueListId | interface{} | Unique League List Identifier | |
metrics | interface{} | Name of metric(s) for metric log stats. Available metrics in /api/v1/metrics | |
gamePk | interface{} | Unique Primary Key Representing a Game | |
batterTeamId | interface{} | A unique identifier for the batter's team | |
pitcherTeamId | interface{} | A unique identifier for the pitcher's team | |
batterId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
pitcherId | interface{} | Unique Player Identifier. Format: 434538, 429665, etc | |
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 | |
opposingTeamId | interface{} | A unique identifier for the opposing team. Must be used with Team ID | |
fields | interface{} | ||
sortStat | interface{} | Baseball stat to sort splits by. | |
order | interface{} | The order of sorting, ascending or descending | |
playerPool | interface{} | Return "ALL" or only "QUALIFIED" players based on plate appearances. | |
position | interface{} | Position number. Format: 1, 2, 3, etc | |
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. | |
excludeTradedPlayers | interface{} | Excludes players who have since been traded from the input team | |
offset | interface{} | The pointer to start for a return set; used for pagination | |
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]