MLB Stats API
Pricing
Pay per usage
Go to Apify Store

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
Maintained by Community
Actor stats
1
Bookmarked
18
Total users
4
Monthly active users
8 days ago
Last modified
Categories
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.
Why use this Actor
Use this Actor when you need structured MLB data without wrestling with unofficial scrapers or brittle HTML parsing. It’s useful for research, dashboards, sports monitoring, and quick season comparisons.
🔧 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
| Mode | Description | Key Fields |
|---|---|---|
teams | All 30 MLB teams | name, abbreviation, league, division, venue |
standings | Division standings | team, wins, losses, pct, games_back, streak |
schedule | Game schedule & scores | away_team, home_team, scores, winner, venue |
player_stats | Player statistics | name, position, avg/hr/rbi (hitting) or era/wins/k (pitching) |
🚀 How to Use
- Select a Mode from the dropdown
- Set the Season year (defaults to current year)
- For
schedulemode: optionally enter a Date (YYYY-MM-DD) - For
player_statsmode: optionally enter a Team ID - Click Start to run
Common Team IDs
| Team | ID | Team | ID |
|---|---|---|---|
| New York Yankees | 147 | Los Angeles Dodgers | 119 |
| Boston Red Sox | 111 | Chicago Cubs | 112 |
| Houston Astros | 117 | Atlanta Braves | 144 |
| Philadelphia Phillies | 143 | San Diego Padres | 135 |
| New York Mets | 121 | San Francisco Giants | 137 |
📦 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"}
🚀 Quick Start
- Choose a mode:
teams,standings,schedule, orplayer_stats. - For schedules, use a date like
2025-07-15. - For player stats, optionally provide a team ID (e.g.
147for the Yankees). - Run the Actor and verify that each item includes
index,mode, andfetched_at.
🔍 Verification Steps
- Test
teamsmode first to confirm the API is reachable. - Run
standingsmode and check that division rows appear in the dataset. - For
schedule, verify the date filter returns games for the requested day. - For
player_stats, start with a small roster and confirm stats fields are populated.
🧪 Example Inputs
Teams
{ "mode": "teams", "season": "2025" }
Schedule
{ "mode": "schedule", "season": "2025", "date": "2025-07-15" }
Player stats
{ "mode": "player_stats", "season": "2025", "team_id": 147, "stat_type": "hitting" }
📝 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.comAPI
💡 Troubleshooting
- Use
YYYY-MM-DDfor the schedule date field. - If you get no results, check that the season is valid and the mode is set correctly.
- For roster stats, try a known team ID first (like
147for the Yankees). - If
player_statsfeels slow, start with a single team to confirm the pipeline before larger runs.