Docs
Coverage MatrixDocumentationRelease LogLog In

MLB v7 Overview

Introduction

Sportradar is the Official Provider of real-time MLB statistics. The data collection comes direct from the MLB operations teams on-venue. This provides lightning speed and the highest-quality stats available to power your baseball experiences. All MLB games – including Spring Training – feature full coverage.

The MLB API is consistent in structure, format, and behavior with our other League Specific APIs. Our primary feeds return schedules, standings, team/player data, and real-time scores.

Our other MLB feeds provide a host of complimentary statistics and information, including:

  • Injuries
  • Transactions
  • Pitch metrics
  • League leaders
  • Venues
  • Depth charts
  • Season statistics
  • Seasonal splits

Real-time customers are also offered three delivery Push Feeds to enhance speed.

An extra package containing MLB Statcast data is also available, beginning at the start of the 2020 season. This package includes:

  • Premium Deeper Pitch Data featuring spin rate, vertical and horizontal movement and more specific pitch types
  • Premium Hit Data including exit velocity, launch angle, spin rate and project home run distance
  • Premium Play Level Statcast Data containing deeper information on fielding and base-running performance

🗝️

Authentication is required for all API calls.



API Map

To best utilize the MLB API, you will need several parameters to create your API calls. The map below illustrates how you can obtain the parameters you need.

The primary feeds require only a date or season to call the endpoints. Those feeds provide Game, Team, or Player Ids which can be used to generate the game, team, and player feeds. All of the other feeds require no variables.

See below for descriptions of each feed.


Endpoint Descriptions

Daily Box Score – Inning-by-inning scoring breakdown, top-level runs, hits and errors by team, as well as details on run-scoring events for all games on a given MLB defined day.

Daily Change Log – Provides IDs and timestamps for teams, players, game statistics, schedules, and standings that have been modified on a given date. To receive the data updates, use these unique IDs to pull relevant API feeds.

Daily Schedule – The date, time and location for all games on a given MLB defined day.

Daily Summary – Team lineups as well as team and player statistics for all games on a given MLB defined day.

Daily Transactions – Information concerning all transactions taking place on a given MLB defined day.

Event Tracking – Provides in-depth tracking information for all players on the field during a given event.

Game Boxscore – Inning-by-inning scoring breakdown, hits and errors by team, win/loss results, as well as details on run-scoring events for a given game.

Game Extended Summary – Inning-by-inning scoring, key game events, lineups, and team and player statistics for the given game and season-to-date. 

Game Pitch Metrics – Detailed metrics on pitch type, velocity, and results for all pitchers in a given game.

Game Summary – Team lineups as well as team and player statistics for a given game.

Glossary – Full text descriptions for pitch ids, player status ids, outcome ids, and game status ids.

Injuries – Information concerning all current injuries across the league.

League Depth Charts – Current depth chart positions for every MLB team.

League Hierarchy – Provides top-level information for each team, including league and division distinction, and venue information.

League Leaders – AL, NL, and MLB leader information for various hitting and pitching statistics.

League Schedule – Complete schedule information for a given season, including venue and broadcast info.

Play-By-Play – Detailed, real-time information on every pitch and game event. Includes advanced Statcast data for every pitch and hit.

Player Profile – Player biographical information, including current and historical seasonal statistics and splits.

Rankings – League and division rank for each team, including post season clinching status.

Seasonal Pitch Metrics – Detailed metrics on pitch type, velocity, and results for a given pitcher by season.

Seasonal Splits – Detailed splits for a given team and all players on the roster.

Seasonal Statistics – Detailed season-to-date stats for given team and all players on the roster. 

Seasonal Transactions – Information concerning all transactions taking place in a given MLB season.

Seasons – Provides a complete list of historical season information available in the API.

Series Schedule – Postseason participant information as well as the date, time, location, and other event details for every match-up taking place for the entire postseason.

Series Statistics – Detailed series-to-date stats for a given team and all players on the roster. 

Series Summary – Team and player statistics for a given postseason series. 

Standings – Detailed standings information for each MLB division. 

Statcast Leaders – Statcast leader information for various hitting and pitching statistics. 

Team Depth Chart – Current depth chart for all positions on a given team. 

Team Profile – Top-level team information including all players currently on the 25-man roster, 40-man roster, or expected to join the team. 

Teams – Provides a complete list of teams in the MLB API database.

Venues – Provides the name, location, and capacity of each venue, along with the dimensions of each field. 

Push Events – Provides detailed, real-time information on every game event. 

Push Linescore – Provides real-time high level scoring by inning. 

Push Probable Pitchers – Provides real-time updates to probable pitchers for upcoming games. 

Push Statistics – Provides real-time game stats at the player level for all live games.


Data Retrieval Examples

To find how many home runs a team has hit when playing at home:

  1. Call the League or Season Schedule and find the Team Id
  2. Call the Seasonal Splits using the Team Id
  3. Find the Home Game statistics, Hitting element, with the Home Run attribute

The home teams number of home runs is displayed.


To find the away teams starting pitcher for a game:

  1. Call the league or season schedule and find id for the game you want
  2. Call the Game Boxscore using the Game ID
  3. Find the Away Team Starting Pitcher element with the First and Last Name attributes

The starting pitcher's name is displayed.


Coverage Levels

We provide three different levels of detail to ensure maximum coverage. We combine coverage levels with the correct feeds to ensure you are getting the most comprehensive data offering in the most efficient manner possible.

Full – We provide live pitch-by-pitch coverage for the entire game. We provide updated live events as well as team- and player-level data in near real time. Full coverage is available for all regular and postseason games.

Boxscore – We provide runs each inning, as well as the total runs, hits, and errors, in a timely manner, as the game progresses. Boxscore coverage is only used as a failover for Spring Training games.

Spring Training – We provide live play-by-play coverage, including all events where an out was recorded or a runner advanced, as well as team and player data in near real-time. Each spring training game will be designated as full coverage, but only select games will feature pitch-by-pitch data.
In the event the MLB feed goes down or begins reporting errors, Sportradar takes over Live Data Entry (LDE) to provide a failover for MLB. During a failover, some data will not be available, and coverage is reduced to boxscore only. After the game is over data entered by Sportradar will be reconciled with the data provided by MLB.

☀️

Spring Training Coverage Note:

Due to varying game rules, limited on-site staff, and training of new on-venue statisticians, you may see data volatility (e.g. stat errors and prolonged game-closing process) for Spring Training games. As a result, there may be a higher than normal frequency of games with data latency or moving to fail-over mode throughout Spring Training.



Integration Links

Postman Workspace

Our entire Media APIs are available on Postman. Click the link above to be taken directly to our MLB API collection.

Feel free to follow and/or fork any collections to receive updates.

Schema Download

Open the zip file below to access our entire MLB API XSD schema.

MLB v7 Schema


Data Entry Workflow

See below for a daily breakdown of data updates for the MLB API.

Sunday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Monday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Tuesday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Wednesday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Thursday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Friday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Transactions (All day)*
  • Injury updates (All day)*
  • Seasonal stats validation (All day)

Saturday

  • Validate game times for today's games (10am CT)
  • Game lineups available at least 30 minutes prior to the first pitch
  • Game stats validated and moved to closed status (within 60 minutes of completion of the game)
  • 5-day probables entered and validated (Midnight CT)
  • Seasonal stats validation (All day)
  • Transactions (All day)*
  • Injury updates (All day)*

* A transaction is typically updated when an official source, or more than one trusted source, reports it as fact.

* We monitor and update injuries throughout the day during the season and as necessary during the offseason, when an injury may impact the next season. We use official and reliable sources.

Important Dates

  • MLB schedule typically becomes available in September of the previous year. This release may differ year-to-year depending on seasonal demands.

Weather Delay Workflow

  • Click here to view our weather delay workflow diagram




All-Star Game FAQ

How do I locate the All-Star game?

The game can be found in the League Schedule or Daily Schedule endpoint. In the League Schedule path use AST in the season parameter to retrieve the All-Star game only. For example:

  • League Schedule - mlb/trial/v7/en/games/2023/AST/schedule
  • Daily Schedule - mlb/trial/v7/en/games/2023/07/11/schedule

Every game-centric feed (e.g. Play-by-Play, Game Summary, Push Events, etc) can be accessed during the game.

Click here for for a Game Summary or Play-by-Play sample of the 2022 game.

<league xmlns="http://feed.elasticstats.com/schema/baseball/v7/schedule.xsd" alias="MLB" name="Major League Baseball" id="2fa448bc-fc17-4d3d-be03-e60e080fdc26">
    <season-schedule id="35ed1eb2-5b9b-4816-8a6c-7e2a3f50488e" year="2022" type="AST">
        <games>
            <game id="7a7a0a1b-3f9b-4773-90af-8875041170f2" status="closed" coverage="full" game_number="1" day_night="D" scheduled="2022-07-20T00:00:00+00:00" home_team="3bbb3b39-b5cb-4fc9-bd22-522521f0f329" away_team="dd59d49e-caee-4443-9220-f05d0d9bd1e1" attendance="52518" duration="3:11" double_header="false" entry_mode="STOMP" reference="663466">
                <venue name="Dodger Stadium" market="Los Angeles" capacity="56000" surface="grass" address="1000 Vin Scully Avenue" city="Los Angeles" state="CA" zip="90012" country="USA" id="66a19c3d-24fe-477d-bee7-c6ef1b98352f" field_orientation="NE" stadium_type="outdoor">
                    <location lat="34.0745409" lng="-118.2408881"/>
                </venue>
                <home name="National League" market="NL" abbr="NL" id="3bbb3b39-b5cb-4fc9-bd22-522521f0f329"/>
                <away name="American League" market="AL" abbr="AL" id="dd59d49e-caee-4443-9220-f05d0d9bd1e1"/>
                <broadcast network="FOX"/>
            </game>
        </games>
    </season-schedule>
</league>
{
    "league": {
        "alias": "MLB",
        "name": "Major League Baseball",
        "id": "2fa448bc-fc17-4d3d-be03-e60e080fdc26"
    },
    "season": {
        "id": "35ed1eb2-5b9b-4816-8a6c-7e2a3f50488e",
        "year": 2022,
        "type": "AST"
    },
    "games": [
        {
            "id": "7a7a0a1b-3f9b-4773-90af-8875041170f2",
            "status": "closed",
            "coverage": "full",
            "game_number": 1,
            "day_night": "D",
            "scheduled": "2022-07-20T00:00:00+00:00",
            "home_team": "3bbb3b39-b5cb-4fc9-bd22-522521f0f329",
            "away_team": "dd59d49e-caee-4443-9220-f05d0d9bd1e1",
            "attendance": 52518,
            "duration": "3:11",
            "double_header": false,
            "entry_mode": "STOMP",
            "reference": "663466",
            "venue": {
                "name": "Dodger Stadium",
                "market": "Los Angeles",
                "capacity": 56000,
                "surface": "grass",
                "address": "1000 Vin Scully Avenue",
                "city": "Los Angeles",
                "state": "CA",
                "zip": "90012",
                "country": "USA",
                "id": "66a19c3d-24fe-477d-bee7-c6ef1b98352f",
                "field_orientation": "NE",
                "stadium_type": "outdoor",
                "location": {
                    "lat": "34.0745409",
                    "lng": "-118.2408881"
                }
            },
            "home": {
                "name": "National League",
                "market": "NL",
                "abbr": "NL",
                "id": "3bbb3b39-b5cb-4fc9-bd22-522521f0f329"
            },
            "away": {
                "name": "American League",
                "market": "AL",
                "abbr": "AL",
                "id": "dd59d49e-caee-4443-9220-f05d0d9bd1e1"
            },
            "broadcast": {
                "network": "FOX"
            }
        }
    ],
    "_comment": "Generation started @ 2023-04-03 14:11:01 UTC ended @ 2023-04-03 14:11:01 UTC"
}

Is the All-Star game covered in realtime?

Yes. The game is covered in realtime, including the same level of team and player statistics as a regular season game (including Statcast data).

When are the All-Star rosters set?

All-Star rosters will be available within 24 hours after they are announced by MLB. Sportradar updates each roster with any additions from the announcement of the original starters to the replacement players.

Please note that we only provide game rosters (not team rosters) for each game. Request the Game Summary or Daily Summary endpoint prior to the game to receive rosters.

What if the game ends in a tie?

In the case of a tie, the All-Star game will be decided by a Home Run Derby. Should this happen, the data will appear as follows in our MLB API:

  • The game will result in a tie (example: 3-3)
  • The tiebreaker of a home run derby will not be shown in any feed
  • There will not be an indication of who won the Home Run Derby portion of the event.


Legacy Simulations

New Simulations Available!

This section is specific to our Legacy Simulations. Click here for our new MLB simulations.

Our MLB simulations give you the opportunity to test your code against a simulation of live data before Spring Training or any time! Our simulation system replays select completed games allowing you to view our API feeds as if they were happening live.

Simulations run every day according to the below schedule. Data is reset for each day's simulations at 10:00am UTC.

Quick Access
Start Time (UTC) Game (Original game date) Game ID
1:00pmCWS at SEA (9/14/19)b946e7e5-3d02-45ad-a4bc-b0a75832a25e​
1:00pmMIN at CLE (9/14/19, Game 1 Doubleheader)6fc55b0d-29a8-43bf-bc08-932366c1dda3
5:00pmMIN at CLE (9/14/19, Game 2 Doubleheader)02aef4b5-9025-43b9-bbf6-f29061c025ae
5:00pmHOU at KC (9/15/19)eaa42c5a-0f07-45e8-8838-b29f6c0300c9
9:00pmCWS at MIN (9/16/19)1785193a-599c-45bd-b13b-a3d5e68b4afe
9:00pmKC at OAK (9/17/19)dff5b8c4-a972-4a44-9b9e-642b1e3fd5a4​
11:30pmHOU at KC (9/14/19)fb2559d7-12d6-45a3-b991-829283f1a532
11:30pmCWS at SEA (9/15/19)d5b72bd7-7902-4de2-820d-57d11d7eaffb​

To retrieve the game IDs, team IDs, and other associated information for each game listed above, you can use the following Daily Schedule URL with the syntax noted below. If you have an existing MLB API key, simply replace the access_level (trial or production) in the URL of a feed with simulation.

❗️

The current date must be used when calling the simulation daily schedule.


Simulation Parameters

Daily Schedule:
https://api.sportradar.com/mlb/simulation/{version}/en/games/{year}/{month}/{day}/schedule.{format}?api_key={your_api_key}
Play-by-Play Sample:
https://api.sportradar.com/mlb/simulation/{version}/en/games/1785193a-599c-45bd-b13b-a3d5e68b4afe/pbp.{format}?api_key={your_api_key}
ParameterDescription
versionVersion number of the API you are accessing (Current Version: v7).
yearThe current year in 4 digit format (YYYY).
Use 2019 for Seasonal simulation feeds and the current date for Daily feeds
monthThe current month in 2 digit format (MM).
dayThe current day of the month in 2 digit format (DD).
mlb_seasonRegular Season (REG).
formatxml or json.
your_api_keyYour API key.

Feeds Available: Daily Boxscore, Daily Change Log, Daily Schedule, Daily Summary, Game Boxscore, Game Extended Summary, Game Pitch Metrics, Game Summary, Injuries, League Depth Chart, League Hierarchy, League Schedule, Play By Play, Player Profile, Rankings, Seasonal Pitch Metrics, Seasonal Splits, Seasonal Statistics, Seasonal Transactions, Seasons, Standings, Team Depth Chart, Team Profile, Venues, Push Events, Push Linescores, and Push Statistics.

For syntax structure on each feed, please reference the endpoint documentation.