MLB Stats Scraper - Scores, Standings, Rosters & Leaders
Pricing
from $3.41 / 1,000 schedule & scores
MLB Stats Scraper - Scores, Standings, Rosters & Leaders
Export MLB data: game scores and schedules, division standings, team rosters, season leaders and full box scores. Six datasets, one actor, no API key needed.
⚾ MLB Stats Scraper — Scores, Standings, Rosters & Leaders
🔎 What is the MLB Stats Scraper — and when should you use it?
The MLB Stats Scraper turns MLB scores, standings, teams, rosters, season leaders and box scores into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.
Use it when you need: any of six MLB datasets for a season or date range. Schedule rows carry both clubs, both scores, status, venue and series position. Standings carry record, win percentage, games back, streak, division and league rank, and runs scored and allowed. Rosters and box scores carry player id, name, jersey number and position, with per-game batting lines on the box score. Season leaders come ranked with the value and the player's club, and player ids are identical across all six so the datasets join without name matching.
Use something else when: you want a different sport, betting markets, or live pitch-level tracking. Use Sports Data Scraper for multi-sport fixtures and results beyond baseball. Use Basketball API Scraper for basketball games, teams and player statistics. Use Football API Scraper for football fixtures, results and league tables. Use Sports Betting Odds Scraper for bookmaker odds across sports and markets. This actor covers MLB's public statistics service only. Live pitch-by-pitch feeds and Statcast tracking live on different services and are not available here at any price.
🤖 Use with AI agents
Already connected to the Apify MCP server? Just ask for this Actor by name: sian.agency/mlb-stats-scraper
Your agent can pay for its own runs. This Actor is eligible for agentic payments, so an agent can discover it, run it and settle the bill over x402 (USDC on Base) or Skyfire — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.
Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:
I want MLB scores, standings, rosters, leaders and box scores using the Apify Actor `sian.agency/mlb-stats-scraper`.Use it when I need: any of six MLB datasets for a season or date range. Schedule rows carry both clubs, both scores, status, venue and series position. Standings carry record, win percentage, games back, streak, division and league rank, and runs scored and allowed. Rosters and box scores carry player id, name, jersey number and position, with per-game batting lines on the box score. Season leaders come ranked with the value and the player's club, and player ids are identical across all six so the datasets join without name matching.Don't use it when: you want a different sport, betting markets, or live pitch-level tracking — use sports-data-scraper or basketball-api-scraper or football-api-scraper or sports-betting-odds-scraper instead.How to call it: set `operation` to one ofschedule -> needs `startDate` + `endDate` (YYYY-MM-DD), ~90-100 games for a week in seasonstandings -> needs `season`, returns 30 club standingsteams -> needs `season`, returns all 30 clubs with league, division and venueroster -> needs `teamId` + `season`, returns ~26 playersleaders -> needs `leaderCategory` + `season`, returns up to ~315 ranked playersboxscore -> needs `gamePk`, returns ~52 player lines for one gameRun `teams` first for a club id and `schedule` first for a game id; both come back inthe output. `season` is a four-digit year and historical seasons work on every route.Win percentage, games back, division rank, jersey number and the leader value areSTRINGS at the source ('.599', '-', '1', '39', '40') and are passed through unchanged..Start with this input:{"operation": "schedule","season": "2026","startDate": "2026-08-01","endDate": "2026-08-07","maxResults": 200}Ask me which dataset I want, and for which season or date range, then run the Actor and summarise the results as a table.
Things you can ask your agent for:
- Pull this week's games and tell me which were decided by one run.
- Get the current standings and show me every division race inside three games.
- Pull the home run leaders and cross-reference them against their club's run differential.
- Get the box score for this game and list every player who reached base more than once.
Machine-readable API, MCP config and OpenAPI definition for this Actor are published at apify.com/sian.agency/mlb-stats-scraper.md.
Overview
Six MLB datasets from one actor: game scores and schedules, division standings, every club, team rosters, season leaders, and per-player box score lines.
No API key, no account and no quota — the source is Major League Baseball's own public
statistics service. Player IDs are the same across every dataset, so a roster row, a leader row
and a box score line all join on playerId without any name matching.
Features
- Six typed datasets, each with its own charge event, so pulling standings is not billed at box-score rates.
- Current and historical seasons on the same routes — change the season and pull 2019 as easily as this year.
- League figures passed through unchanged. Win percentage arrives as
.599and the division leader's games back as-, exactly as MLB publishes them, so your numbers match the official ones. - Honest nulls. A pitcher who never batted has empty batting stats, not zeros — the actor will not invent plate appearances.
- Stable joins.
playerIdandteamIdare consistent across all six datasets. - An HTML run report with the records, what you paid, and a fix for anything that failed.
Quick start
- Open the Actor and press Start — the default pulls a week of games and scores.
- Change
operationto pick a different dataset. - Read the results in the Output tab, or export to JSON, CSV or Excel.
{"operation": "schedule","season": "2026","startDate": "2026-08-01","endDate": "2026-08-07"}
Getting started
Pick the dataset with operation, then fill in the field that dataset needs:
| Operation | Needs | Returns |
|---|---|---|
schedule | startDate, endDate | ~90–100 games for a week in season |
standings | season | 30 club standings |
teams | season | all 30 clubs |
roster | teamId, season | ~26 players |
leaders | leaderCategory, season | up to ~315 ranked players |
boxscore | gamePk | ~52 player lines for one game |
Run teams first if you need a club's ID, and schedule first if you need a game ID — both come
back in the output.
Input configuration
| Field | Type | Default | What it does |
|---|---|---|---|
operation | select | schedule | Which of the six datasets to pull |
season | string | 2026 | Four-digit season year |
startDate | string | 2026-08-01 | Schedule window start, YYYY-MM-DD |
endDate | string | 2026-08-07 | Schedule window end, YYYY-MM-DD |
teamId | integer | 147 | Club for the roster dataset |
gamePk | integer | 822781 | Game for the box score dataset |
leaderCategory | select | homeRuns | Statistic to rank players by |
maxResults | integer | 200 | Cap on records returned, and so on what a run charges |
Output
Every row carries rowType, so the six datasets sit together unambiguously.
| Field | Type | Appears on | Example |
|---|---|---|---|
rowType | string | all | game |
season | string | all | 2026 |
gamePk | integer | game, boxscore | 822781 |
gameDate | string | game | 2026-08-01T19:07:00Z |
gameStatus | string | game | Final |
homeTeam / awayTeam | string | game | Toronto Blue Jays |
homeScore / awayScore | integer | game | 5 / 1 |
venueName | string | game, team | Rogers Centre |
teamId / teamName | integer / string | most | 139 / Rays |
wins / losses | integer | standing | 82 / 55 |
winningPercentage | string | standing | .599 |
gamesBack | string | standing | - |
streakCode | string | standing | L1 |
divisionRank / leagueRank | string | standing | 1 |
runsScored / runsAllowed | integer | standing | 618 |
playerId / playerName | integer / string | roster, leader, boxscore | 656941 / Kyle Schwarber |
jerseyNumber | string | roster, boxscore | 39 |
positionAbbreviation / positionName | string | roster, boxscore | C / Catcher |
statCategory / statValue / rank | string / string / integer | leader | homeRuns / 40 / 1 |
battingHits / battingAtBats / battingRuns / battingRbi | integer, nullable | boxscore | 2 |
seasonAvg | string | boxscore | .284 |
sourceUrl / scrapedAt | string | all | — |
The fields marked string are text at the source. We pass them through rather than reformatting, so they match the official figure exactly — convert on your side if you need arithmetic.
Use cases
- Daily scores feed — pull a date range each morning for a site, newsletter or bot.
- Standings tracker — record standings on a schedule so you can watch a division race develop over weeks rather than reading a single day's table.
- Fantasy and betting models — feed leaders and box score lines into a model, joining on stable player IDs.
- Roster and transaction monitoring — watch a club's roster for changes in players, positions and status.
- Sports journalism and research — pull historical seasons on the same routes with one consistent output shape.
Integration examples
JavaScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('sian.agency/mlb-stats-scraper').call({operation: 'standings',season: '2026',});const { items } = await client.dataset(run.defaultDatasetId).listItems();const leaders = items.filter((r) => r.divisionRank === '1');console.log(leaders.map((t) => `${t.teamName}: ${t.wins}-${t.losses}`).join('\n'));
Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("sian.agency/mlb-stats-scraper").call(run_input={"operation": "schedule","startDate": "2026-08-01","endDate": "2026-08-07",})games = list(client.dataset(run["defaultDatasetId"]).iterate_items())finals = [g for g in games if g.get("gameStatus") == "Final"]print(f"{len(finals)} completed games")
cURL
curl -X POST "https://api.apify.com/v2/acts/sian.agency~mlb-stats-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"operation":"leaders","season":"2026","leaderCategory":"homeRuns"}'
Automation workflows — the Actor runs as a step in n8n, Make or Zapier through Apify's connectors. A common pattern is a nightly schedule that pulls the day's games and appends them to a sheet or database.
FAQ
Do I need an API key or account? No. The source is Major League Baseball's own public statistics service — no key, no login, no quota.
Which seasons can I pull? Current and historical. Teams, standings, rosters and leaders all take a season year; the schedule takes any date range.
Why is win percentage text rather than a number?
Because that is how the league publishes it — .599, and - for the division leader's games back.
We pass those through unchanged so they match the official figure. Convert on your side if you need
arithmetic.
What happens if there are no games in my date range? You get an empty result and a note in the log, not an error. Out of season there genuinely are no games, and that is a real answer.
Why are some batting stats empty rather than zero? Because that player did not bat in that game — usually a pitcher. Writing zeros would invent plate appearances that never happened.
How many records does one run return? 30 clubs or standings, about 26 players on a roster, roughly 90–100 games for a week of schedule, up to about 315 season leaders, and about 52 player lines per box score.
Is this affiliated with MLB? No. It reads MLB's public statistics service and is not affiliated with, endorsed by or sponsored by Major League Baseball.
Troubleshooting
| What you see | What it means | What to do |
|---|---|---|
| No records, run succeeded | Nothing exists for that request — often out of season | Use dates inside the regular season, or check the season year |
Season "..." is not a four-digit year | Rejected before anything was charged | Use 2026, not 26 or 2026-01 |
Start date is after end date | The window is inverted | Swap the two dates |
Team ID "..." is not a positive number | Unknown club | Run the teams operation to list every club's ID |
That record does not exist | The team or game ID isn't real | Take IDs from teams or schedule output |
| Fewer rows than expected on a free plan | Free Apify accounts are capped at 25 rows per run | Add credits or a payment method to lift the cap |
Legal
This Actor reads only data that Major League Baseball publishes openly through its public statistics service. It does not log in, does not bypass authentication, and does not collect personal data.
MLB and Major League Baseball are trademarks of MLB Advanced Media, L.P. This tool is not affiliated with, endorsed by or sponsored by Major League Baseball. You are responsible for ensuring your use of the data complies with applicable law and the source's terms.
Support
- 🐛 Issues: https://apify.com/sian.agency/mlb-stats-scraper/issues
- ⭐ Reviews: https://apify.com/sian.agency/mlb-stats-scraper/reviews
- 🌐 More actors: https://apify.com/sian.agency?fpr=sian
- 🚀 New to Apify? https://apify.com/pricing?fpr=sian
Related sports actors: Sports Data Scraper, Basketball API Scraper, Football API Scraper, Tennis Point by Point Scraper, Sports Betting Odds Scraper.
Keywords for LLM Discovery
mlb api, mlb stats api, baseball data api, mlb scraper, baseball statistics scraper, mlb scores api, baseball scores data, mlb standings api, division standings data, mlb schedule api, baseball schedule scraper, mlb box score api, box score data, mlb roster api, team roster scraper, mlb leaders api, home run leaders data, batting average leaders, era leaders, baseball player stats, mlb player data, statsapi, mlb game data, baseball analytics data, fantasy baseball data, mlb historical stats, season leaders api, run differential data, winning percentage data, baseball venue data, mlb team data, sports data extraction, baseball research dataset