mlbstats/api/README.md

53 KiB

Go API client for mlbstats

Official API for Major League Baseball.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./mlbstats"

Documentation for API Endpoints

All URIs are relative to https://statsapi.mlb.com

Class Method HTTP request Description
AnalyticsApi ContextMetrics Get /api/v1/game/{gamePk}/{guid}/contextMetrics Get context metrics for a specific gamePk.
AnalyticsApi ContextMetricsWithAverages Get /api/v1/game/{gamePk}/{guid}/contextMetricsAverages Get a json file containing raw coordinate data and refined calculated metrics.
AnalyticsApi ContextMetricsWithAveragesPost Post /api/v1/game/{gamePk}/{guid}/contextMetricsAverages Get a json file containing raw coordinate data and refined calculated metrics.
AnalyticsApi GameGuids Get /api/v1/game/{gamePk}/guids Get the GUIDs (plays) for a specific game.
AnalyticsApi GameGuidsFromPostgresRange Get /api/v1/analytics/guids Get the GUIDs (plays) for a specific game.
AnalyticsApi GameGuidsFromPostgresRangeByGame Get /api/v1/analytics/game Get all games by updated date.
AnalyticsApi GameLastPitch Get /api/v1/game/lastPitch Get the last pitch for a list of games
AnalyticsApi HomeRunBallparks Get /api/v1/game/{gamePk}/{guid}/homeRunBallparks Get if the play is a home run is each park for a specific play.
AnalyticsApi ParsedJsonFormattedAnalytics Get /api/v1/game/{gamePk}/{guid}/analytics Get Statcast data for a specific play.
AttendanceApi GetTeamAttendance Get /api/v1/attendance Get team attendance
AwardsApi AwardRecipients Get /api/v1/awards/{awardId}/recipients View recipients of an award
AwardsApi Awards Get /api/v1/awards View awards info
AwardsApi Awards1 Get /api/v1/awards/{awardId} View awards info
BatTrackingApi BatTracking Get /api/v1/batTracking/game/{gamePk}/{playId} View Bat Tracking Data by playId and gameId
BiomechanicsApi Biomechanical Get /api/v1/game/{gamePk}/{playId}/analytics/biomechanics/{positionId} View Biomechanical data by playId and gameId filtered by player positionId
BroadcastApi GetAllBroadcasters Get /api/v1/broadcasters Get All Active Broadcasters
BroadcastApi GetBroadcasts Get /api/v1/broadcast Get Broadcasters
ConferenceApi Conferences Get /api/v1/conferences View conference info
ConferenceApi Conferences1 Get /api/v1/conferences/{conferenceId} View conference info
DivisionApi Divisions Get /api/v1/divisions Get division information
DivisionApi Divisions1 Get /api/v1/divisions/{divisionId} Get division information
DraftApi DraftPicks Get /api/v1/draft View MLB Drafted Players
DraftApi DraftPicks1 Get /api/v1/draft/{year} View MLB Drafted Players
DraftApi DraftProspects Get /api/v1/draft/prospects View MLB Draft Prospects
DraftApi DraftProspects1 Get /api/v1/draft/prospects/{year} View MLB Draft Prospects
DraftApi LatestDraftPicks Get /api/v1/draft/{year}/latest Get the last drafted player and the next 5 teams up to pick
GameApi Boxscore Get /api/v1/game/{game_pk}/boxscore Get game boxscore.
GameApi ColorFeed Get /api/v1/game/{game_pk}/feed/color Get game color feed.
GameApi ColorTimestamps Get /api/v1/game/{game_pk}/feed/color/timestamps Retrieve all of the color timestamps for a game.
GameApi Content Get /api/v1/game/{game_pk}/content Retrieve all content for a game.
GameApi CurrentGameStats1 Get /api/v1/game/changes View a game change log
GameApi GetGameContextMetrics Get /api/v1/game/{gamePk}/contextMetrics Get the context metrics for this game based on its current state
GameApi GetGameWithMetrics Get /api/v1/game/{gamePk}/withMetrics Get game info with metrics
GameApi GetWinProbability Get /api/v1/game/{gamePk}/winProbability Get the win probability for this game
GameApi Linescore Get /api/v1/game/{game_pk}/linescore Get game linescore
GameApi LiveGameDiffPatchV1 Get /api/v1.1/game/{game_pk}/feed/live/diffPatch Get live game status diffPatch.
GameApi LiveGameV1 Get /api/v1.1/game/{game_pk}/feed/live Get live game status.
GameApi LiveTimestampv11 Get /api/v1.1/game/{game_pk}/feed/live/timestamps Retrieve all of the play timestamps for a game.
GameApi PlayByPlay Get /api/v1/game/{game_pk}/playByPlay Get game play By Play
GamePaceApi GamePace Get /api/v1/gamePace View time of game info
HighLowApi HighLow Get /api/v1/highLow/{highLowType} View high/low stats by player or team
HighLowApi HighLowStats Get /api/v1/highLow/types View high/low stat types
HomerunDerbyApi HomeRunDerbyBracket Get /api/v1/homeRunDerby/{gamePk} View a home run derby object
HomerunDerbyApi HomeRunDerbyBracket1 Get /api/v1/homeRunDerby View a home run derby object
HomerunDerbyApi HomeRunDerbyBracket2 Get /api/v1/homeRunDerby/{gamePk}/bracket View a home run derby object
HomerunDerbyApi HomeRunDerbyBracket3 Get /api/v1/homeRunDerby/bracket View a home run derby object
HomerunDerbyApi HomeRunDerbyMixedMode Get /api/v1/homeRunDerby/{gamePk}/mixed View home run derby mixed mode (Bracket/Pool combo)
HomerunDerbyApi HomeRunDerbyMixedMode1 Get /api/v1/homeRunDerby/mixed View home run derby mixed mode (Bracket/Pool combo)
HomerunDerbyApi HomeRunDerbyPool Get /api/v1/homeRunDerby/{gamePk}/pool View home run derby pool
HomerunDerbyApi HomeRunDerbyPool1 Get /api/v1/homeRunDerby/pool View home run derby pool
JobApi Datacasters Get /api/v1/jobs/datacasters Get datacaster jobs
JobApi GetJobsByType Get /api/v1/jobs Get jobs by type
JobApi OfficialScorers Get /api/v1/jobs/officialScorers Get official scorers
JobApi UmpireSchedule Get /api/v1/jobs/umpires/games/{umpireId} Get umpires and associated game for umpireId
JobApi Umpires Get /api/v1/jobs/umpires Get umpires
LeagueApi AllStarBallot Get /api/v1/league/allStarBallot View al star ballot info
LeagueApi AllStarBallot1 Get /api/v1/league/{leagueId}/allStarBallot View al star ballot info
LeagueApi AllStarBallot2 Get /api/v1/leagues/allStarBallot View al star ballot info
LeagueApi AllStarBallot3 Get /api/v1/leagues/{leagueId}/allStarBallot View al star ballot info
LeagueApi AllStarFinalVote Get /api/v1/league/{leagueId}/allStarFinalVote View all star final vote info
LeagueApi AllStarFinalVote1 Get /api/v1/leagues/{leagueId}/allStarFinalVote View all star final vote info
LeagueApi AllStarWriteIns Get /api/v1/league/{leagueId}/allStarWriteIns View all star write ins info
LeagueApi AllStarWriteIns1 Get /api/v1/leagues/{leagueId}/allStarWriteIns View all star write ins info
LeagueApi League Get /api/v1/league View league info
LeagueApi League1 Get /api/v1/league/{leagueId} View league info
LeagueApi League2 Get /api/v1/leagues View league info
LeagueApi League3 Get /api/v1/leagues/{leagueId} View league info
MilestonesApi AchievementStatuses Get /api/v1/achievementStatuses View available achievementStatus options
MilestonesApi MilestoneDurations Get /api/v1/milestoneDurations View available milestoneDurations options
MilestonesApi MilestoneLookups Get /api/v1/milestoneLookups View available milestoneLookup options
MilestonesApi MilestoneStatistics Get /api/v1/milestoneStatistics View available milestone statistics options
MilestonesApi MilestoneTypes Get /api/v1/milestoneTypes View available milestoneType options
MilestonesApi Milestones Get /api/v1/milestones View pending and achieved milestones.
MiscApi AggregateSortEnum Get /api/v1/sortModifiers List all stat fields
MiscApi BaseballStats Get /api/v1/baseballStats List all baseball stats
MiscApi BroadcastAvailabilityTypes Get /api/v1/broadcastAvailability View broadcast availability options
MiscApi CoachingVideoTypes Get /api/v1/coachingVideoTypes List all coaching video types
MiscApi EventStatus Get /api/v1/eventStatus List all possible event status types
MiscApi EventTypes Get /api/v1/eventTypes List all event types
MiscApi FielderDetailTypes Get /api/v1/fielderDetailTypes List fielder detail types
MiscApi FreeGameTypes Get /api/v1/freeGameTypes View free game types
MiscApi GameStatus Get /api/v1/gameStatus List all status types
MiscApi GameTypes Get /api/v1/gameTypes List all game types
MiscApi GamedayTypes Get /api/v1/gamedayTypes List all gameday types
MiscApi GetLookupValues Get /api/v1/lookup/values/all View all lookup values
MiscApi GroupByTypes Get /api/v1/groupByTypes List groupBy types
MiscApi HitTrajectories Get /api/v1/hitTrajectories List all hit trajectories
MiscApi JobTypes Get /api/v1/jobTypes List all job types
MiscApi Languages Get /api/v1/languages List all support languages
MiscApi LeagueLeaderTypes Get /api/v1/leagueLeaderTypes List all possible player league leader types
MiscApi LogicalEvents Get /api/v1/logicalEvents List all logical event types
MiscApi MediaStateTypes Get /api/v1/mediaState View media state options
MiscApi Metrics Get /api/v1/metrics List all possible metrics
MiscApi MoundVisitTypes Get /api/v1/moundVisitTypes List all mound visit types
MiscApi PerformerTypes Get /api/v1/performerTypes List all possible performer types
MiscApi PitchCodes Get /api/v1/pitchCodes List all pitch codes
MiscApi PitchTypes Get /api/v1/pitchTypes List all pitch classification types
MiscApi Platforms Get /api/v1/platforms List all possible platforms
MiscApi PlayerStatusCodes Get /api/v1/playerStatusCodes List all player status codes
MiscApi Positions Get /api/v1/positions List all possible positions
MiscApi ReviewReasons Get /api/v1/reviewReasons List all replay review reasons
MiscApi RoofTypes Get /api/v1/roofTypes List all roof types
MiscApi RosterTypes Get /api/v1/rosterTypes List all possible roster types
MiscApi RuleSettings Get /api/v1/ruleSettings List all ruleSettings
MiscApi RunnerDetailTypes Get /api/v1/runnerDetailTypes List runner detail types
MiscApi ScheduleEventTypes Get /api/v1/scheduleEventTypes List all schedule event types
MiscApi ScheduleTypes Get /api/v1/scheduleTypes List all possible schedule types
MiscApi SitCodes Get /api/v1/situationCodes List all situation codes
MiscApi Sky Get /api/v1/sky List all sky options
MiscApi StandingsTypes Get /api/v1/standingsTypes List all standings types
MiscApi StatFields Get /api/v1/statFields List all stat fields
MiscApi StatGroups Get /api/v1/statGroups List all stat groups
MiscApi StatSearchConfig Get /api/v1/stats/search/config Stats Search Config Endpoint
MiscApi StatSearchGroupByTypes Get /api/v1/stats/search/groupByTypes List groupBy types
MiscApi StatSearchParams Get /api/v1/stats/search/params List stat search parameters
MiscApi StatSearchStats Get /api/v1/stats/search/stats List stat search stats
MiscApi StatTypes Get /api/v1/statTypes List all stat types
MiscApi StatcastPositionTypes Get /api/v1/statcastPositionTypes List all statcast position types
MiscApi TrackingSoftwareVersions Get /api/v1/trackingSoftwareVersions List the tracking software versions and notes
MiscApi TrackingSystemOwners Get /api/v1/trackingSystemOwners List all tracking system owners
MiscApi TrackingVendors Get /api/v1/trackingVendors List all tracking vendors
MiscApi TrackingVersions Get /api/v1/trackingVersions List all tracking versions
MiscApi TransactionTypes Get /api/v1/transactionTypes List all transaction types
MiscApi UpdateGameStatuses Post /api/v1/gameStatus Clear all status types
MiscApi UpdateJobTypes Post /api/v1/jobTypes
MiscApi VideoResolutionTypes Get /api/v1/videoResolutionTypes View video resolution options
MiscApi ViolationTypes Get /api/v1/violationTypes View available violationType options
MiscApi WeatherTrajectoryConfidences Get /api/v1/weatherTrajectoryConfidences List all weather trajectories
MiscApi WindDirection Get /api/v1/windDirection List all wind direction options
PersonApi Award Get /api/v1/people/{personId}/awards View a player's awards
PersonApi CurrentGameStats Get /api/v1/people/changes View a player's change log
PersonApi FreeAgents Get /api/v1/people/freeAgents Get free agents
PersonApi Person Get /api/v1/people/{personId} View a player
PersonApi Person1 Get /api/v1/people View a player
PersonApi PlayerGameStats Get /api/v1/people/{personId}/stats/game/{gamePk} View a player's game stats
PersonApi Search Get /api/v1/people/search Search for a player by name
PersonApi Stats3 Get /api/v1/people/{personId}/stats View a players stats
PersonApi StatsMetrics Get /api/v1/people/{personId}/stats/metrics View a player's stat metrics
PredictionsApi GetProps Get /api/v1/props/play/predictions Get play-level predictions based on input scenarios
PredictionsApi GetPropsAdjust Get /api/v1/props/play/predictions/adjust Get play-level predictions based on input scenarios
ReviewsApi GetReviewInfo Get /api/v1/review Get review info
ScheduleApi PostseasonSchedule Get /api/v1/schedule/postseason Get postseason schedule
ScheduleApi PostseasonScheduleSeries Get /api/v1/schedule/postseason/series Get postseason series schedules
ScheduleApi Schedule Get /api/v1/schedule View schedule info based on scheduleType.
ScheduleApi Schedule1 Get /api/v1/schedule/{scheduleType} View schedule info based on scheduleType.
ScheduleApi TieGames Get /api/v1/schedule/games/tied Get tied game schedules
ScheduleApi TrackingEventsSchedule Get /api/v1/schedule/trackingEvents Get tracking event schedules
ScheduleApi TuneIn Get /api/v1/schedule/postseason/tuneIn Get postseason TuneIn schedules
SeasonApi AllSeasons Get /api/v1/seasons/all View all seasons
SeasonApi Seasons Get /api/v1/seasons View season info
SeasonApi Seasons1 Get /api/v1/seasons/{seasonId} View season info
SkeletalApi SkeletalChunked Get /api/v1/game/{gamePk}/{playId}/analytics/skeletalData/chunked View Skeletal Data by playId and gameId chunked
SkeletalApi SkeletalDataFileNames Get /api/v1/game/{gamePk}/{playId}/analytics/skeletalData/files View Skeletal Data by playId and gameId files
SportsApi AllSportBallot Get /api/v1/sports/{sportId}/allSportBallot Get ALL MLB ballot for sport
SportsApi SportPlayers Get /api/v1/sports/{sportId}/players Get all players for a sport level
SportsApi Sports Get /api/v1/sports Get sports information
SportsApi Sports1 Get /api/v1/sports/{sportId} Get sports information
StandingsApi Standings Get /api/v1/standings/{standingsType} View standings for a league
StandingsApi Standings1 Get /api/v1/standings View standings for a league
StatsApi BeastStats Get /api/v1/stats/search View stats from search
StatsApi GetOutsAboveAverage Get /api/v1/stats/analytics/outsAboveAverage Get outs above average for the current batter
StatsApi GetSprayChart Get /api/v1/stats/analytics/sprayChart Get the spray chart info for the current batter
StatsApi GetStolenBaseProbability Get /api/v1/stats/analytics/stolenBaseProbability Get the probability of a hit for the given hit data
StatsApi GroupedStats Get /api/v1/stats/grouped View grouped stats
StatsApi Leaders2 Get /api/v1/stats/leaders Get leaders for a statistic
StatsApi MetricStats Get /api/v1/stats/metrics View metric stats
StatsApi Stats2 Get /api/v1/stats View stats
StreaksApi GetStreaks Get /api/v1/streaks View streaks
StreaksApi StreakTypes Get /api/v1/streaks/types View streaks parameter options
TeamsApi Affiliates Get /api/v1/teams/{teamId}/affiliates View team and affiliate teams
TeamsApi Affiliates1 Get /api/v1/teams/affiliates View team and affiliate teams
TeamsApi AllTeams Get /api/v1/teams/{teamId}/history View historical records for a list of teams
TeamsApi AllTeams1 Get /api/v1/teams/history View historical records for a list of teams
TeamsApi Alumni Get /api/v1/teams/{teamId}/alumni View all team alumni
TeamsApi Coaches Get /api/v1/teams/{teamId}/coaches View all coaches for a team
TeamsApi Leaders Get /api/v1/teams/{teamId}/leaders View team stat leaders
TeamsApi Leaders1 Get /api/v1/teams/stats/leaders View leaders for team stats
TeamsApi Personnel Get /api/v1/teams/{teamId}/personnel View all coaches for a team
TeamsApi Roster Get /api/v1/teams/{teamId}/roster View a teams roster
TeamsApi Roster1 Get /api/v1/teams/{teamId}/roster/{rosterType} View a teams roster
TeamsApi Stats Get /api/v1/teams/{teamId}/stats View a teams stats
TeamsApi Stats1 Get /api/v1/teams/stats View a teams stats
TeamsApi Teams Get /api/v1/teams View info for all teams
TeamsApi Teams1 Get /api/v1/teams/{teamId} View info for all teams
TeamsApi UpdateAlumni Post /api/v1/teams/{teamId}/alumni
TransactionsApi Transactions Get /api/v1/transactions View transaction info
UniformsApi UniformsByGame Get /api/v1/uniforms/game View Game Uniform info
UniformsApi UniformsByTeam Get /api/v1/uniforms/team View Team Uniform info
VenuesApi Venues Get /api/v1/venues View venue info
VenuesApi Venues1 Get /api/v1/venues/{venueId} View venue info
WeatherApi WeatherBasic Get /api/v1/weather/venues/{venueId}/basic Get basic weather for a venue.
WeatherApi WeatherDataBasedOnPlay Get /api/v1/weather/game/{gamePk}/{playId} Get the raw field weather data.
WeatherApi WeatherForecast Get /api/v1/weather/game/{gamePk}/forecast/{roofType} Get the weather forecast for a game.
WeatherApi WeatherFull Get /api/v1/weather/venues/{venueId}/full Get full weather for a venue.

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

bearerAuth

Author