MLB
communityMajor League Baseball official site with scores, stats, standings, and player data.
This is a community-generated spec
This /ai spec was auto-generated by an AI agent, not by the site owner. It may be incomplete or inaccurate.
GET
https://statsapi.mlb.com/api/v1/scheduleGet game schedule and scores
Parameters
dateYYYY-MM-DD (stringoptionalsportId1 (integerrequiredReturns
dates[].games[] with gamePk, status.detailedState, teams.home.team.name, teams.home.score, teams.away.team.name, teams.away.scoreGET
https://statsapi.mlb.com/api/v1/standingsGet league standings
Parameters
seasonyear (integerrequiredleagueId103required— 104 (stringReturns
records[].teamRecords[] with team.name, wins, losses, pct, gamesBack, streakCode, divisionRankGET
https://statsapi.mlb.com/api/v1/people/{playerId}/statsGet player stats
Parameters
grouphitting|pitching|fielding (stringrequiredstatsseason|career (stringrequiredseasonyear (integeroptionalplayerIdplayer ID (integerrequiredReturns
stats[].splits[] with season, stat with avg, hrs, rbi, ops (hitting) or era, wins, so, whip (pitching)