MLB Player Stats, Scores & Standings Scraper
Pricing
from $6.15 / 1,000 results
MLB Player Stats, Scores & Standings Scraper
Scrape MLB teams, rosters, player season stats, schedules, final scores and division standings from the official MLB Stats API. Covers all 30 Major League Baseball clubs with wins, losses, runs and records. Export to JSON, CSV or Excel.
Pricing
from $6.15 / 1,000 results
Rating
5.0
(1)
Developer
Scrapers Lat
Maintained by CommunityActor stats
1
Bookmarked
3
Total users
1
Monthly active users
20 hours ago
Last modified
Categories
Share
MLB Player Stats, Scores & Standings Scraper
Here is one real result, with every field the actor returns (a player from roster mode with stats and bio; yearByYear trimmed to 2 of 7 real seasons for readability, all values unchanged):
{"imageUrl": "https://img.mlbstatic.com/mlb-photos/image/upload/d_people:generic:headshot:67:current.png/w_213,q_auto:best/v1/people/645305/headshot/67/current","title": "Ali Sánchez","id": 645305,"url": "https://www.mlb.com/player/ali-sanchez-645305","primaryNumber": "39","position": "C","positionName": "Catcher","active": true,"currentAge": 29,"birthDate": "1997-01-20","birthCity": "Carora","birthStateProvince": null,"birthCountry": "Venezuela","height": "6' 0\"","weight": 200,"batSide": "Right","pitchHand": "Right","mlbDebutDate": "2020-08-10","draftYear": null,"statSeason": "2026","statGroup": "hitting","gamesPlayed": 32,"plateAppearances": 60,"atBats": 56,"runs": 5,"hits": 15,"doubles": 2,"triples": 0,"homeRuns": 1,"rbi": 7,"totalBases": 20,"baseOnBalls": 1,"strikeOuts": 15,"stolenBases": 0,"battingAverage": ".268","onBasePercentage": ".300","sluggingPercentage": ".357","ops": ".657","babip": ".341","careerStats": {"gamesPlayed": 82,"atBats": 176,"hits": 37,"homeRuns": 1,"rbi": 11,"battingAverage": ".210","onBasePercentage": ".246","sluggingPercentage": ".273","ops": ".519"},"yearByYear": [{ "season": "2020", "teamId": 121, "teamName": "New York Mets", "leagueName": "National League", "stats": { "gamesPlayed": 5, "atBats": 9, "hits": 1, "battingAverage": ".111", "ops": ".311" } },{ "season": "2026", "teamId": 147, "teamName": "New York Yankees", "leagueName": "American League", "stats": { "gamesPlayed": 32, "atBats": 56, "hits": 15, "homeRuns": 1, "battingAverage": ".268", "ops": ".657" } }],"teamId": 147,"rosterStatus": "Active","observedAt": "2026-08-08T21:22:57.366Z","error": null}
The most complete MLB stats scraper available. It pulls teams, rosters, per-player season and career stats, schedules with final scores, and division standings from the official MLB Stats API, covering all 30 clubs, and gives you five modes plus season, team, player, date and league parameters to target exactly the data you need.
📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples
Table of contents
- What it does
- Quickstart
- Input reference
- Output reference
- Example output record
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
What it does
The actor reads the official MLB Stats API and writes one normalized record per item to the run's dataset. Pick one of five modes:
teamsreturns all 30 MLB clubs for a season.rosterreturns every player on a team, and whenwithDetailsis on adds each player's season hitting or pitching line, career totals, year-by-year history and bio (height, weight, bat side, throwing hand, birthplace).playersreturns a profile and season stats for the specific player IDs you pass.schedulereturns games and final scores for a date.standingsreturns division standings for a league and season.
Each mode uses a different subset of the parameters below and returns the fields relevant to that mode. Missing source values are returned as null.
Quickstart
Open the actor, paste this into the input, and press Run. It returns 3 New York Yankees players with full season stats and bio.
{"mode": "roster","teamId": "147","maxRecords": 3,"withDetails": true,"statGroup": "hitting","leagueId": "103,104"}
For standings, use {"mode":"standings","leagueId":"103,104","season":2025}. For a day's scores, use {"mode":"schedule","date":"2025-07-04"}.
Input reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
mode | enum | no | standings | What to collect: teams, roster, players, schedule, standings. Each mode uses a different subset of the fields below. |
season | integer | no | 2025 | Season year (used by teams, roster, players, standings). Defaults to the current MLB season when empty. |
teamId | enum | for roster | (none) | MLB team ID whose roster to fetch, for example 147 (New York Yankees). Required for roster mode. |
playerIds | string[] | for players | ["592450","660271"] | MLB player IDs to look up in players mode, for example 592450 (Aaron Judge), 660271 (Shohei Ohtani). Find IDs in teams or roster output. |
statGroup | enum | no | hitting | Which season stat line to attach in players/roster mode: hitting or pitching. |
date | string | for schedule | (today) | Date for schedule mode in YYYY-MM-DD, for example 2025-07-04. Defaults to today. |
leagueId | enum | no | 103,104 | League for standings mode: 103,104 (both), 103 (American), 104 (National). |
withDetails | boolean | no | true | In roster mode, also fetch each player's season stats, career totals, year-by-year history and bio. No effect in other modes. |
maxRecords | integer | no | 10 | Maximum number of records to collect in one run. |
Output reference
One dataset item per team, player, game or standings row depending on mode. Fields present depend on the mode. Types: string, integer, number, boolean, object, object[], or null when absent.
| Field | Type | Description |
|---|---|---|
title | string | Name of the team, player, or game. |
id | integer | MLB ID of the team or player. |
url | string | Official MLB.com URL. |
teamName | string | Team name (player and standings modes). |
position / positionName | string | Player position code and full name (roster/players). |
imageUrl | string | Player headshot URL (roster/players). |
primaryNumber | string | Jersey number. |
active | boolean | Whether the player is active. |
currentAge | integer | Player age. |
birthDate | string | Player birth date (YYYY-MM-DD). |
birthCity / birthStateProvince / birthCountry | string | Player birthplace. |
height / weight | string / integer | Player height and weight. |
batSide / pitchHand | string | Batting side and throwing hand. |
mlbDebutDate | string | MLB debut date. |
draftYear | integer | Draft year, or null. |
statSeason / statGroup | string | Season and group (hitting/pitching) of the attached stat line. |
gamesPlayed, atBats, runs, hits, doubles, triples, homeRuns, rbi, totalBases, baseOnBalls, strikeOuts, stolenBases, ... | integer | Season stat counters (full set of hitting or pitching counters as reported by MLB). |
battingAverage, onBasePercentage, sluggingPercentage, ops, babip, era, whip | string | Season rate stats (as MLB formats them). |
careerStats | object | Career totals with the same stat keys. |
yearByYear | object[] | Per-season history, each with season, teamId, teamName, leagueName and a stats object. |
season | integer/string | Season (teams/standings). |
wins / losses / winningPct | integer/string | Team record (standings). |
divisionRank / gamesBack | string | Division rank and games back (standings). |
leagueRank / sportRank | string | Rank within league and across MLB (standings). |
runsScored / runsAllowed / runDifferential | integer | Run totals and differential (standings). |
streak / clinchIndicator | string | Current streak and clinch indicator (standings). |
homeRecord / awayRecord / lastTenRecord / divisionRecord / oneRunRecord / extraInningsRecord / dayRecord / nightRecord / vsLeftRecord / vsRightRecord / expectedRecord | object | Split records, each with wins, losses, pct (standings). |
wildCardRank / magicNumber / eliminationNumber / clinched / divisionLeader / divisionChamp / hasWildcard | mixed | Postseason race fields (standings). |
homeScore / awayScore / status | integer/string | Game scores and status (schedule). |
homeProbablePitcher / awayProbablePitcher | string | Probable starting pitchers (schedule). |
rosterStatus | string | Roster status of the player (roster mode). |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | null on success. On a failed run, a single item with a populated error field is written instead. |
Example output record
A real standings record from a live run (input {"mode":"standings","season":2025,"leagueId":"103,104"}):
{"title": "Blue Jays","id": 141,"url": "https://www.mlb.com/team/141","teamName": "Blue Jays","season": "2025","wins": 94,"losses": 68,"winningPct": ".580","divisionRank": "1","leagueRank": "1","sportRank": "3","gamesBack": "-","gamesPlayed": 162,"runsScored": 798,"runsAllowed": 721,"runDifferential": 77,"streak": "W4","clinchIndicator": "z","wildCardRank": null,"clinched": true,"divisionLeader": true,"divisionChamp": true,"hasWildcard": true,"homeRecord": { "wins": 54, "losses": 27, "pct": ".667" },"awayRecord": { "wins": 40, "losses": 41, "pct": ".494" },"lastTenRecord": { "wins": 5, "losses": 5, "pct": ".500" },"divisionRecord": { "wins": 29, "losses": 23, "pct": ".558" },"oneRunRecord": { "wins": 27, "losses": 20, "pct": ".574" },"expectedRecord": { "wins": 88, "losses": 74, "pct": ".543" },"observedAt": "2026-08-10T14:40:45.707Z","error": null}
Standings records also carry dayRecord, nightRecord, vsLeftRecord, vsRightRecord, extraInningsRecord, magicNumber and eliminationNumber. The hero record above shows the full roster/player shape.
Run via API and CLI
Start a run and wait for it to finish, then read the dataset. Replace <TOKEN> with your Apify API token.
Run synchronously and get dataset items in one call:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"roster","teamId":"147","maxRecords":25,"withDetails":true,"statGroup":"hitting"}'
Start a run asynchronously:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~mlb-stats-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"mode":"players","playerIds":["592450","660271"],"statGroup":"hitting"}'
Apify CLI:
apify call scrapers_lat/mlb-stats-scraper \--input '{"mode":"standings","leagueId":"103,104","season":2025}'
Fetch results
Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.
Billing and limits
- Pay per result. You are charged per record returned (
resultevent). See the pricing tab for the current per-result price. - Details add-on. In
rostermode withwithDetailson, adetailscharge applies once per player whose full stats and bio are fetched. Turn it off for a faster roster listing. - No charge on failure. If a run errors, the actor writes a single item with a populated
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon the run; once reached, the actor stops emitting and charging further billable results. - Free Apify plans are capped at 10 records per run. Upgrade for higher
maxRecords.
FAQ and troubleshooting
How do I find a player ID?
Run teams or roster mode first; each player record includes its MLB id. Pass those IDs to players mode.
Do I get hitting or pitching stats?
Set statGroup to hitting or pitching in roster or players mode. The chosen line is attached to each player.
Why are some fields null or empty?
Fields depend on the mode. A standings record has no batting stats; a schedule record has scores instead of player bio. Missing source values are returned as null, never invented.
Which season does it use by default?
The current MLB season when season is empty. Set season to pull historical teams, rosters or standings.
Is this an official MLB tool? No. This actor is independent and has no affiliation with Major League Baseball. It reads only data that is publicly available through the MLB Stats API. Use it in accordance with MLB's terms.
Related scrapers
- ESPN Soccer Scraper: soccer scores, standings and teams.
- FIFA World Cup Scraper: World Cup matches and standings.
- ESPN and league sports data: more sports scrapers in the catalog.
- Kalshi Markets Scraper: event and sports prediction markets.
- Eventbrite Scraper: live events and tickets.
- Google News Scraper: sports and general news coverage.
More scrapers at scrapers.lat
Built and maintained by scrapers.lat, where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.
Independent tool, not affiliated with Major League Baseball. Accesses only publicly available MLB Stats API data. Use in accordance with MLB's terms.
