MLB Data
FREE
By theapiguy
Updated 6 months ago

MLB Data API Documentation

Baseball MLB Data about players, teams, reports, and other stats.

Learn more about this API
Reports
GETBroadcast Info
GETInjuries
GETGet Transactions Over Period
GETPitching Leaders
GETHitting Leaders
Stats Data
GETProjected Hitting Stats
GETSeason Pitching Stats
GETCareer Hitting Stats
GETLeague Hitting Stats
GETLeague Pitching Stats
GETCareer Pitching Stats
GETProjected Pitching Stats
GETSeason Hitting Stats
Player Data
GETPlayer Teams
GETPlayer Search
GETPlayer Info
Game Data
GETGame Type Info
Team Data
GETGet Roster by Seasons
GETGet Teams by Season
GETGet 40-Man Roster
GETHitting Leaders

Retrieve n leaders for a given hitting statistic. This endpoint is best used alongside colin/colex to prune response data. Without, it returns entire player objects. For best results, include the player’s name, id, and the stat as a starting point. See: Using colin & colex

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
game_typeSTRING
REQUIREDExample: 'R' The type of games you want career stats for. 'R' - Regular Season 'S' - Spring Training 'E' - Exhibition 'A' - All Star Game 'D' - Division Series 'F' - First Round (Wild Card) 'L' - League Championship 'W' - World Series
sort_columnSTRING
REQUIREDExample: 'ab' The statistic you want leaders for.
resultsSTRING
REQUIREDExample: 5 The number of results to return.
seasonSTRING
REQUIREDExample: '2017'
sports_codeSTRING
REQUIRED
Optional Parameters
leader_hitting_repeater.col_inSTRING
OPTIONALExample: ab
Code Snippet
Install SDK
Response ExampleSchema

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication