MLB Player Stats, Scores & Standings Scraper avatar

MLB Player Stats, Scores & Standings Scraper

Pricing

from $6.15 / 1,000 results

Go to Apify Store
MLB Player Stats, Scores & Standings Scraper

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

Scrapers Lat

Maintained by Community

Actor stats

1

Bookmarked

3

Total users

1

Monthly active users

20 hours ago

Last modified

Share

MLB Player Stats, Scores & Standings Scraper

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

Apify Coverage Output Billing

Table of contents

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:

  • teams returns all 30 MLB clubs for a season.
  • roster returns every player on a team, and when withDetails is 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).
  • players returns a profile and season stats for the specific player IDs you pass.
  • schedule returns games and final scores for a date.
  • standings returns 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

FieldTypeRequiredDefaultDescription
modeenumnostandingsWhat to collect: teams, roster, players, schedule, standings. Each mode uses a different subset of the fields below.
seasonintegerno2025Season year (used by teams, roster, players, standings). Defaults to the current MLB season when empty.
teamIdenumfor roster(none)MLB team ID whose roster to fetch, for example 147 (New York Yankees). Required for roster mode.
playerIdsstring[]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.
statGroupenumnohittingWhich season stat line to attach in players/roster mode: hitting or pitching.
datestringfor schedule(today)Date for schedule mode in YYYY-MM-DD, for example 2025-07-04. Defaults to today.
leagueIdenumno103,104League for standings mode: 103,104 (both), 103 (American), 104 (National).
withDetailsbooleannotrueIn roster mode, also fetch each player's season stats, career totals, year-by-year history and bio. No effect in other modes.
maxRecordsintegerno10Maximum 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.

FieldTypeDescription
titlestringName of the team, player, or game.
idintegerMLB ID of the team or player.
urlstringOfficial MLB.com URL.
teamNamestringTeam name (player and standings modes).
position / positionNamestringPlayer position code and full name (roster/players).
imageUrlstringPlayer headshot URL (roster/players).
primaryNumberstringJersey number.
activebooleanWhether the player is active.
currentAgeintegerPlayer age.
birthDatestringPlayer birth date (YYYY-MM-DD).
birthCity / birthStateProvince / birthCountrystringPlayer birthplace.
height / weightstring / integerPlayer height and weight.
batSide / pitchHandstringBatting side and throwing hand.
mlbDebutDatestringMLB debut date.
draftYearintegerDraft year, or null.
statSeason / statGroupstringSeason and group (hitting/pitching) of the attached stat line.
gamesPlayed, atBats, runs, hits, doubles, triples, homeRuns, rbi, totalBases, baseOnBalls, strikeOuts, stolenBases, ...integerSeason stat counters (full set of hitting or pitching counters as reported by MLB).
battingAverage, onBasePercentage, sluggingPercentage, ops, babip, era, whipstringSeason rate stats (as MLB formats them).
careerStatsobjectCareer totals with the same stat keys.
yearByYearobject[]Per-season history, each with season, teamId, teamName, leagueName and a stats object.
seasoninteger/stringSeason (teams/standings).
wins / losses / winningPctinteger/stringTeam record (standings).
divisionRank / gamesBackstringDivision rank and games back (standings).
leagueRank / sportRankstringRank within league and across MLB (standings).
runsScored / runsAllowed / runDifferentialintegerRun totals and differential (standings).
streak / clinchIndicatorstringCurrent streak and clinch indicator (standings).
homeRecord / awayRecord / lastTenRecord / divisionRecord / oneRunRecord / extraInningsRecord / dayRecord / nightRecord / vsLeftRecord / vsRightRecord / expectedRecordobjectSplit records, each with wins, losses, pct (standings).
wildCardRank / magicNumber / eliminationNumber / clinched / divisionLeader / divisionChamp / hasWildcardmixedPostseason race fields (standings).
homeScore / awayScore / statusinteger/stringGame scores and status (schedule).
homeProbablePitcher / awayProbablePitcherstringProbable starting pitchers (schedule).
rosterStatusstringRoster status of the player (roster mode).
observedAtstringISO 8601 timestamp of when the record was collected.
errorstringnull 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:

# JSON
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"
# CSV
curl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"
# Paginate large datasets
curl "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 (result event). See the pricing tab for the current per-result price.
  • Details add-on. In roster mode with withDetails on, a details charge 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 error field and does not charge for it. Empty runs cost nothing.
  • Spend cap respected. Set maxTotalChargeUsd on 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.

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.