MLB Stats API avatar

MLB Stats API

Pricing

Pay per usage

Go to Apify Store
MLB Stats API

MLB Stats API

Extract baseball data from MLB official free API. Get teams, standings, game schedules/scores, and detailed player statistics for any season.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Monkey Coder

Monkey Coder

Maintained by Community

Actor stats

1

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Share

⚾ MLB Stats API

Extract comprehensive baseball data from MLB's official free API. Get teams, standings, game schedules with scores, and detailed player statistics for any season.

🔧 Features

  • Teams — List all 30 MLB teams with venue, league, division info
  • Standings — Division standings with W/L record, winning percentage, games back, run differential
  • Schedule / Scores — Game schedules and final scores for any date or full season
  • Player Stats — Detailed hitting and pitching statistics for any team's roster

📊 Modes

ModeDescriptionKey Fields
teamsAll 30 MLB teamsname, abbreviation, league, division, venue
standingsDivision standingsteam, wins, losses, pct, games_back, streak
scheduleGame schedule & scoresaway_team, home_team, scores, winner, venue
player_statsPlayer statisticsname, position, avg/hr/rbi (hitting) or era/wins/k (pitching)

🚀 How to Use

  1. Select a Mode from the dropdown
  2. Set the Season year (defaults to current year)
  3. For schedule mode: optionally enter a Date (YYYY-MM-DD)
  4. For player_stats mode: optionally enter a Team ID
  5. Click Start to run

Common Team IDs

TeamIDTeamID
New York Yankees147Los Angeles Dodgers119
Boston Red Sox111Chicago Cubs112
Houston Astros117Atlanta Braves144
Philadelphia Phillies143San Diego Padres135
New York Mets121San Francisco Giants137

📦 Sample Output (Standings)

{
"division": "American League East",
"team": "New York Yankees",
"wins": 82,
"losses": 55,
"pct": ".599",
"games_back": "-",
"division_rank": "1",
"runs_scored": 580,
"runs_allowed": 478,
"run_diff": 102,
"streak": "W3",
"season": "2025",
"mode": "standings",
"index": 1,
"fetched_at": "2025-07-15T12:00:00+00:00"
}

📦 Sample Output (Player Stats — Hitting)

{
"player_id": 660271,
"name": "Shohei Ohtani",
"number": "17",
"position": "DH",
"stat_group": "hitting",
"team": "Los Angeles Dodgers",
"games": 120,
"at_bats": 450,
"hits": 130,
"avg": ".289",
"home_runs": 40,
"rbi": 95,
"ops": "1.012",
"season": "2025",
"mode": "player_stats",
"index": 1,
"fetched_at": "2025-07-15T12:00:00+00:00"
}

📝 Notes

  • No API key required — MLB Stats API is completely free and public
  • Player stats mode makes individual API calls per player (may take 30-60 seconds for a full roster)
  • Schedule without a date returns the full season schedule (can be large)
  • All data comes directly from MLB's official statsapi.mlb.com API