Tools (20)
Batter Vs Pitcher
Enter a playerID to retrieve a list of players that he's pitched or hit against, and their head to head stats. Providing a pitcher's playerID will retrieve a list of hitters, and providing a hitter's playerID will retrieve a list of pitchers.
Get Injuries By Date
Gets the injury list for a date in format YYYYMMDD. Can be filtered by team abbreviation. List available on and after 5/7/2025.
Get Player Information
Call this to get general information on each player (name, team, experience, birthday, college, image link, etc).
This can accept either "playerID" or "playerName".
If you use playerID then the body will return one object. playerID values can be found from performing a get on the team roster API. playerID is the unique identifier for each player, and is the preferred parameter to use in this call.
If you use playerName then it will return a list of objects, since many players can have the same name. It acts as more of a search/scan than direct access, and will be a slower call than if you use playerID.
Also, you don't have to call the full name with playerName. You can use partial name. For example, if you call with only playerName=smith then it will return all players with smith in their full name.
getStats=true will bring back current season stats for the returned players
statsSeason parameter lets you choose a previous season for stats. This goes back to 2023 only. This will be ignored if getStats is not "true". This defaults to current season if empty.
Get Daily Schedule
Get basic information on which games are being played during a day.
Example call:
/getMLBGamesForDate?gameDate=20220410
The above call will return all of the games from April 10th, 2022. Date must be in the format YYYYMMDD.
Games are returned in a list like shown below:
```
{"statusCode":200
"body":"[{"gameID": "20220410_BAL@TB", "away": "BAL", "gameDate": "20220410", "home": "TB"}, {"gameID": "20220410_TEX@TOR", "away": "TEX", "gameDate": "20220410", "home": "TOR"}, {"gameID": "20220410_SD@ARI", "away": "SD", "gameDate": "20220410", "home": "ARI"}, {"gameID": "20220410_CHW@DET", "away": "CHW", "gameDate": "20220410", "home": "DET"}, {"gameID": "20220410_HOU@LAA", "away": "HOU", "gameDate": "20220410", "home": "LAA"}, {"gameID": "20220410_PIT@STL", "away": "PIT", "gameDate": "20220410", "home": "STL"}, {"gameID": "20220410_BOS@NYY", "away": "BOS", "gameDate": "20220410", "home": "NYY"}, {"gameID": "20220410_NYM@WAS", "away": "NYM", "gameDate": "20220410", "home": "WAS"}, {"gameID": "20220410_MIL@CHC", "away": "MIL", "gameDate": "20220410", "home": "CHC"}, {"gameID": "20220410_LAD@COL", "away": "LAD", "gameDate": "20220410", "home": "COL"}, {"gameID": "20220410_SEA@MIN", "away": "SEA", "gameDate": "20220410", "home": "MIN"}, {"gameID": "20220410_CLE@KC", "away": "CLE", "gameDate": "20220410", "home": "KC"}, {"gameID": "20220410_OAK@PHI", "away": "OAK", "gameDate": "20220410", "home": "PHI"}, {"gameID": "20220410_MIA@SF", "away": "MIA", "gameDate": "20220410", "home": "SF"}, {"gameID": "20220410_CIN@ATL", "away": "CIN", "gameDate": "20220410", "home": "ATL"}]"
}
```
Get MLB Betting Odds
This grabs MLB betting/gambling lines and odds from some of the most popular online sportsbooks (fanduel, betrivers, betmgm, caesars, pointsbet, etc).
Player prop bets can be added by including playerProps=true parameter. Prop bets are new as of 7/4/2023. Happy 4th!
You can call this for specific game or a specific date. Check out the example responses here for the type of data you can expect back. Some of the sportsbooks do not offer live betting, so data from those sportsbooks will not be returned after the game starts.
Either gameDate or gameID is required.
Examples of what the calls can look like:
/getMLBBettingOdds?gameDate=20230410
/getMLBBettingOdds?gameID=20230410_HOU@PIT
Get Box Score - Live - Real Time
Retrieves the entire box score for a game either in progress or already completed. The stats retrieved here are what are normally shown in box scores or used in fantasy games. If there are any stats not here that you'd like to see, we can add them.
The call looks like this /getMLBBoxScore?gameID=20220409_CHW@DET
The call needs to be exactly in the same format as above. 8 digit date, underscore, then the away team abbreviation, @, then home team abbreviation. Complete list of team abbreviations can be retrieved with the getMLBTeams call or various other calls.
But, the best way to find specific game ID's are either from the "getMLBGamesForDate" call, or the "getMLBTeamSchedule" call.
This will also calculate fantasy points earned for each player for the categories listed in the parameters tab. Enable this with fantasyPoints=true . This will give a "fantasyPointsDefault" element for each player that uses a default scoring method of:
Batting: R, BB, RBI, TB 1 point each. Strikeout is -1 pt.
Baserunning: SB 1 point.
Pitching: 1 pt for strikeout, 3 pts for each Inning Pitched. -1 pt for H, BB, ER. 2 pts for Win, Save, and Hold. -2 pts for a Loss.
You can customize all of the points for each parameter. If you do, you'll get a "fantasyPointsCustom" element for each player that calculates your custom scoring system.
Get General Game Information
This returns very basic information about each game. The some data points that you will get from this call which you won't get from other calls are the time that the game starts, the game ID and link for mlb.com and espn.com, and the game status (Postponed/scheduled/completed/in-progress/etc). All game start times are in Eastern time zone.
Example:
/getMLBGameInfo?gameID=20220409_CHW@DET
will return:
```
{
"statusCode":200
"body":"{"espnID": "401354266", "mlbLink": "https://www.mlb.com/gameday/white-sox-vs-tigers/2022/04/09/662864#game_tab=box,game=662864", "gameStatus": "Completed", "season": "2022", "gameDate": "20220409", "gameTime": "1:10p", "away": "CHW", "mlbID": "662864", "gameID": "20220409_CHW@DET", "espnLink": "https://www.espn.com/mlb/boxscore/_/gameId/401354266", "home": "DET"}"
}
```
Get Line Score - Real Time
This endpoint provides the basic "line score" for a game, whether completed earlier this season, or currently happening now, in real time.
A baseball line score consists of the basic R/H/E, plus the scores by inning and any pitching scoring decisions.
Example:
/getMLBLineScore?gameID=20220409_CHW@DET
..will return this:
```
{
"statusCode":200
"body":"{"decisions": [{"name": "Dylan Cease", "team": "CHW", "decision": "W", "playerID": "28018152299"}, {"name": "Bennett Sousa", "team": "CHW", "decision": "HLD", "playerID": "28208115769"}, {"name": "Jose Ruiz", "team": "CHW", "decision": "HLD", "playerID": "28018056809"}, {"name": "Aaron Bummer", "team": "CHW", "decision": "S", "playerID": "28468725739"}, {"name": "Casey Mize", "team": "DET", "decision": "L", "playerID": "28618589089"}], "awayResult": "W", "gameStatus": "Completed", "homeResult": "L", "away": "CHW", "lineScore": {"away": {"H": "10", "R": "5", "team": "CHW", "scoresByInning": {"1": "2", "2": "0", "3": "0", "4": "0", "5": "0", "6": "2", "7": "1", "8": "0", "9": "0"}, "E": "1"}, "home": {"H": "7", "R": "2", "team": "DET", "scoresByInning": {"1": "0", "2": "0", "3": "0", "4": "0", "5": "0", "6": "2", "7": "0", "8": "0", "9": "0"}, "E": "0"}}, "gameDate": "20220409", "gameID": "20220409_CHW@DET", "home": "DET"}"
}
```
Get Daily Scoreboard - Live - Real Time
Use this if you want basic game data returned. It's lighter/quicker than getting the full boxscore, for applications that do not need anything but basic data like line score, away/home, etc.
/getMLBScoresOnly
This can be called using ?gameDate (returns all games for a date, format YYYYMMDD) or ?gameID (returns one game, format YYYYMMDD_AWAY@HOME)
Also can be called with topPerformers=true to get a list of stat leaders in each category, per team.
DFS Salaries
Enter the date (YYYYMMDD) and this will return DFS salaries for various DFS sites. Goes back as far as 20250316
Get Batting and Pitching Splits
Enter the playerID and splitType of either batting or pitching.
Both playerID and splitType are required.
season is optional. season defaults to the current season.
Depth Charts
Updated daily, no parameters needed. Returns Depth Charts.
Get Teams
This endpoint provides you with all teams, their cities, names, abbreviations, and some other general information. This endpoint isn't necessary to call very often, as the data here won't change much throughout the season. Perhaps make a point to call it once a week, as we will most likely be adding information to it every once in a while.
This does not need parameters. It just returns the same full list every time.
Optional parameters are...
topPerformers=true
This will return the best player for each statistical category on each team.
teamStats=true
This will return team level/season long stats for each team
Get ADP (Average Draft Position)
Returns Current ADP in a list.
ADPs updated hourly.
no required parameters.
optional parameter:
adpDate: can be a date in format: YYYYMMDD and goes back as far as 20240924
Get Team Roster
This call returns the current or historical* roster of any team, using the teamID that can be found in "getMLBTeams" call.
Rosters are updated hourly during the day.
Historical rosters are saved on a daily basis as of 20230505 and moving forward.
Here are examples of the two ways to call and get the White Sox roster:
/getMLBTeamRoster?teamID=6
or
/getMLBTeamRoster?teamAbv=CHW
add getStats=true to get player stats.
Add parameter archiveDate to the call to get a list of roster players (playerID's only) for that specific date. Historical roster dates only are kept as far back as 20230505.
getStats does not work with the historical Roster
Get Fantasy Stat Projections
This will retrieve stats projections, regular season only, for 7 days ahead, 14 days ahead, or rest of the regular season.
/getMLBProjections.
projectionType element is required.
options are "season", "7", or "14".
/getMLBProjections?projectionType=season
/getMLBProjections?projectionType=7
/getMLBProjections?projectionType=14
Top News and Headlines
This endpoint will retrieve relevant news links.
/getMLBNews
Options:
- playerID=xxx
Enter a playerID here and get news for that player
-teamID = {teamID}
-teamAbv= {teamAbv}
Enter a teamID or teamAbv to get news for that team, instead of player.
- topNews=true
Retrieves top news
- fantasyNews=true
Retrieves top fantasy-relevant news
- recentNews=true
Retrieves most recent news, whether it's really fantasy relevant or not
- maxItems=xx
Enter a number there to limit the number of responses you'll receive back.
All news will have a "link" and "title" element. Some will have "image" and some will have playerID (single item) or playerIDs (list).
Get Team Schedule
This endpoint returns the full season schedule for any MLB team identified in the parameters.
Example:
/getMLBTeamSchedule?teamID=6
or
/getMLBTeamSchedule?teamAbv=CHW
Calling it either way will return the same result, a list of the White Sox games this season, each game in it's own map. If the game has been played, the linescore and game result will be included in the game's map.
You can also add the "season" parameter if you want to specify season. Right now we only have seasons 2022, 2023, and 2024.
Default season is current season (2024).
Get MLB Games and Stats For a Single Player
This call will grab a map of all of the games a player has played this season.
playerID is a required parameter.
You can also use gameID if you want to only pull back a specific game.
season is an optional parameter. Currently only 2022, 2023 and 2024 (this season) are available. If you do not include season as a parameter, it will return this season's games.
You can limit the amount of games returned with parameter: numberOfGames. For example: &numberOfGames=5 will return the last 5 games this player has an entry for.
Example:
Correct way to get the stats for Aaron Judge for the season opener against SF on 3/30/2023, would be this:
/getMLBGamesForPlayer?playerID=592450&gameID=20230330_SF@NYY
But if you wanted to get all of his games this season, you'd make this call
/getMLBGamesForPlayer?playerID=592450
This call will not work without playerID. If you want stats for all players during a game, then use the getMLBBoxScore call with that specific gameID.
Get Player List
One call grabs the FULL MLB player list. This is mainly used for associating players with their "playerID" which is what you'll want to use when cross referencing with box scores.
No parameters, just make the call:
/getMLBPlayerLIst