MLB Stats Scraper - Scores, Standings, Rosters & Leaders avatar

MLB Stats Scraper - Scores, Standings, Rosters & Leaders

Pricing

from $3.41 / 1,000 schedule & scores

Go to Apify Store
MLB Stats Scraper - Scores, Standings, Rosters & Leaders

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.

Pricing

from $3.41 / 1,000 schedule & scores

Rating

0.0

(0)

Developer

SIÁN OÜ

SIÁN OÜ

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

⚾ MLB Stats Scraper — Scores, Standings, Rosters & Leaders

Actor Pricing Datasets Support

🔎 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 of
schedule -> needs `startDate` + `endDate` (YYYY-MM-DD), ~90-100 games for a week in season
standings -> needs `season`, returns 30 club standings
teams -> needs `season`, returns all 30 clubs with league, division and venue
roster -> needs `teamId` + `season`, returns ~26 players
leaders -> needs `leaderCategory` + `season`, returns up to ~315 ranked players
boxscore -> needs `gamePk`, returns ~52 player lines for one game
Run `teams` first for a club id and `schedule` first for a game id; both come back in
the 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 are
STRINGS 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 .599 and 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. playerId and teamId are consistent across all six datasets.
  • An HTML run report with the records, what you paid, and a fix for anything that failed.

Quick start

  1. Open the Actor and press Start — the default pulls a week of games and scores.
  2. Change operation to pick a different dataset.
  3. 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:

OperationNeedsReturns
schedulestartDate, endDate~90–100 games for a week in season
standingsseason30 club standings
teamsseasonall 30 clubs
rosterteamId, season~26 players
leadersleaderCategory, seasonup to ~315 ranked players
boxscoregamePk~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

FieldTypeDefaultWhat it does
operationselectscheduleWhich of the six datasets to pull
seasonstring2026Four-digit season year
startDatestring2026-08-01Schedule window start, YYYY-MM-DD
endDatestring2026-08-07Schedule window end, YYYY-MM-DD
teamIdinteger147Club for the roster dataset
gamePkinteger822781Game for the box score dataset
leaderCategoryselecthomeRunsStatistic to rank players by
maxResultsinteger200Cap on records returned, and so on what a run charges

Output

Every row carries rowType, so the six datasets sit together unambiguously.

FieldTypeAppears onExample
rowTypestringallgame
seasonstringall2026
gamePkintegergame, boxscore822781
gameDatestringgame2026-08-01T19:07:00Z
gameStatusstringgameFinal
homeTeam / awayTeamstringgameToronto Blue Jays
homeScore / awayScoreintegergame5 / 1
venueNamestringgame, teamRogers Centre
teamId / teamNameinteger / stringmost139 / Rays
wins / lossesintegerstanding82 / 55
winningPercentagestringstanding.599
gamesBackstringstanding-
streakCodestringstandingL1
divisionRank / leagueRankstringstanding1
runsScored / runsAllowedintegerstanding618
playerId / playerNameinteger / stringroster, leader, boxscore656941 / Kyle Schwarber
jerseyNumberstringroster, boxscore39
positionAbbreviation / positionNamestringroster, boxscoreC / Catcher
statCategory / statValue / rankstring / string / integerleaderhomeRuns / 40 / 1
battingHits / battingAtBats / battingRuns / battingRbiinteger, nullableboxscore2
seasonAvgstringboxscore.284
sourceUrl / scrapedAtstringall

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 ApifyClient
client = 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 seeWhat it meansWhat to do
No records, run succeededNothing exists for that request — often out of seasonUse dates inside the regular season, or check the season year
Season "..." is not a four-digit yearRejected before anything was chargedUse 2026, not 26 or 2026-01
Start date is after end dateThe window is invertedSwap the two dates
Team ID "..." is not a positive numberUnknown clubRun the teams operation to list every club's ID
That record does not existThe team or game ID isn't realTake IDs from teams or schedule output
Fewer rows than expected on a free planFree Apify accounts are capped at 25 rows per runAdd credits or a payment method to lift the cap

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

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