MLB Stats Scraper — Players, Teams, Scores & Standings avatar

MLB Stats Scraper — Players, Teams, Scores & Standings

Pricing

from $3.00 / 1,000 mlb records

Go to Apify Store
MLB Stats Scraper — Players, Teams, Scores & Standings

MLB Stats Scraper — Players, Teams, Scores & Standings

Extract structured MLB player statistics, team rosters, game schedules, scores, standings, and game details. Eight extraction modes with flexible filters and clean JSON output.

Pricing

from $3.00 / 1,000 mlb records

Rating

0.0

(0)

Developer

Zapticx

Zapticx

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Security

Limited permissions

Share

⚾ MLB Stats Scraper — Players, Teams, Scores & Standings

Get Major League Baseball data as clean, structured records: player statistics, team rosters, game schedules and final scores, standings, and box-score game details. Choose one of eight modes, add a few filters, and export to JSON, CSV or Excel, or feed the results into your own tools through the Apify API.

No API key, no code and no browser automation are needed. A typical small run finishes in seconds.

Pricing

You pay only for the records delivered to your dataset.

Apify planPrice per 1,000 recordsPrice per record
Free$4.00$0.0040
Bronze, Silver$3.50$0.0035
Gold and above$3.00$0.0030

There is no start fee, and platform usage is included. You are never charged for failed requests, retries, duplicates, or records past your limit. Set Maximum results or Apify's maximum cost per run, and the run stops there.

The default run returns current standings: 30 records, about $0.12 on the Free plan. New to Apify? The Free plan includes $5 of monthly credit to spend in the Store.

What can you extract?

ModeYou get one record perMain fields
Standings (standings)teamDivision rank, wins, losses, winning percentage, games back, wild-card games back, home, away and last-ten records, streak, runs scored and allowed, clinch status
Teams (teams)team and seasonTeam ID, name, abbreviation, league, division, venue, first year of play, active status
Rosters (rosters)player on a rosterPlayer ID and name, jersey number, position, bats, throws, roster status
Players (players)playerName, primary position, current team, bats, throws, birth date and country, height, weight, MLB debut, active status
Batting stats (batting_stats)stat lineG, PA, AB, R, H, 2B, 3B, HR, RBI, BB, SO, HBP, SB, CS, AVG, OBP, SLG, OPS, BABIP
Pitching stats (pitching_stats)stat lineG, GS, W, L, SV, HLD, IP, H, R, ER, HR, BB, SO, ERA, WHIP, K/9, BB/9, opponents' AVG
Schedules & results (schedules)gameGame ID, local and UTC dates, game type, status, teams, scores, winner, venue, doubleheader details, series, winning, losing and save pitchers, probable pitchers
Game details (game_details)gameLine score by inning, runs, hits and errors, batting lineups, starting pitchers, team batting and pitching totals, decisions, attendance, duration

Key features

  • Search by name. Use NYY, Yankees, New York Yankees or team ID 147. Look up players as Aaron Judge or by ID. If a name matches more than one player, all matches are returned and the run summary lists them.
  • Numbers ready for analysis. Rates such as .331 arrive as the number 0.331, so spreadsheets and models work straight away.
  • Correct innings pitched. Baseball notation is kept and converted properly, so totals add up.
  • Traded players handled properly. Each club's line and the season total are separate rows, so nothing is merged or counted twice.
  • Season, career or year-by-year stats, for the regular season or postseason.
  • Efficient. Whole teams and groups of players are fetched in single requests, so runs stay small and fast.
  • Clear run results. Every run saves a RUN_SUMMARY listing what was delivered, skipped, not found or failed.

How to use it

  1. Open the Actor and choose what you want under What to get.
  2. Add filters, such as seasons, teams, players or dates. Filters that don't apply to your mode are ignored, and the log says so.
  3. Set Maximum results.
  4. Click Start, then open the matching view in the Output tab or export your data.

Input parameters

ParameterTypeUsed byDescription
modestringallstandings (default), teams, rosters, players, batting_stats, pitching_stats, schedules or game_details
seasonsarraymost modesSeason years, such as ["2025"]. Up to 30 per run. Empty means the latest season.
teamsarrayteams, rosters, stats, schedules, game detailsTeam ID, abbreviation or name. Empty means all teams.
playerIdsarrayplayers, statsMLB player IDs, such as 592450.
playerNamesarrayplayers, statsPlayer names, such as Aaron Judge.
statTypestringstatsseason (default), career or yearByYear. Career and year-by-year need players.
statsGameTypestringstatsR regular season (default) or P postseason.
playerPoolstringstats league tablesqualified (default) or all.
rosterTypestringrostersactive (default), 40Man or fullSeason.
startDate, endDatestringschedules, game detailsDates as YYYY-MM-DD. Up to 366 days, or 31 days for game details.
gameIdsarraygame detailsMLB game IDs (gamePk), such as 813024.
gameTypesarrayschedules, game detailsR, F, D, L, W, S, A, E. Empty means all games.
gameStatusstringschedulesall (default), completed or upcoming.
maxResultsintegerallDefault 100, maximum 5,000. Game details maximum 250.

How player and team filters work

In the stats modes, the filters you give decide the kind of result:

  • Players given: each player's lines. A traded player gets one row per team plus a total row. If you give both players and teams, players take precedence.
  • Teams given, no players: each player's line for that team only.
  • Neither given: a league table of qualified or all players. A traded player appears once, as a season total with no team name.

Check splitType in each record: team is one club's line and total is a traded player's combined line. Add up only one kind, or you will double-count.

Input examples

Latest standings:

{ "mode": "standings" }

A team's pitching staff for one season:

{ "mode": "pitching_stats", "seasons": ["2024"], "teams": ["NYY"], "maxResults": 100 }

Players' batting lines:

{ "mode": "batting_stats", "seasons": ["2025"], "playerIds": ["592450", "660271"] }

A player's career totals:

{ "mode": "batting_stats", "statType": "career", "playerIds": ["592450"] }

One team's games and scores for a week:

{ "mode": "schedules", "teams": ["NYY"], "startDate": "2025-09-01", "endDate": "2025-09-07" }

Box-score details for specific games:

{ "mode": "game_details", "gameIds": ["813024"] }

Output examples

These are real records, shortened to their main fields. Every record also carries recordType, dedupKey, source, sourceEndpoint and scrapedAt.

Batting stats

{
"recordType": "batting_stats",
"season": 2025,
"statType": "season",
"gameType": "R",
"playerId": 592450,
"playerName": "Aaron Judge",
"splitType": "team",
"teamId": 147,
"teamName": "New York Yankees",
"gamesPlayed": 152,
"plateAppearances": 679,
"atBats": 541,
"runs": 137,
"hits": 179,
"homeRuns": 53,
"rbi": 114,
"avg": 0.331,
"obp": 0.457,
"slg": 0.688,
"ops": 1.145
}

Pitching stats

{
"recordType": "pitching_stats",
"season": 2024,
"statType": "season",
"playerName": "Michael Tonkin",
"splitType": "team",
"teamName": "New York Yankees",
"gamesPlayed": 39,
"wins": 3,
"losses": 2,
"era": 3.38,
"inningsPitched": "56.0",
"inningsPitchedOuts": 168,
"inningsPitchedDecimal": 56.0,
"strikeOuts": 57,
"whip": 1.16,
"saves": 2,
"holds": 1
}

Schedules & results

{
"recordType": "game",
"gamePk": 776489,
"officialDate": "2025-09-02",
"gameDateUtc": "2025-09-03T00:10:00Z",
"gameTypeName": "Regular season",
"statusDetailed": "Final",
"awayTeamName": "New York Yankees",
"awayScore": 7,
"homeTeamName": "Houston Astros",
"homeScore": 1,
"venueName": "Daikin Park",
"doubleHeader": "N",
"winningPitcherName": "Max Fried",
"losingPitcherName": "Framber Valdez",
"savePitcherName": null
}

Game details

{
"recordType": "game_detail",
"gamePk": 813024,
"officialDate": "2025-11-01",
"statusDetailed": "Final",
"venueName": "Rogers Centre",
"awayTeamName": "Los Angeles Dodgers",
"awayRuns": 5,
"awayHits": 11,
"awayErrors": 0,
"homeTeamName": "Toronto Blue Jays",
"homeRuns": 4,
"homeHits": 14,
"homeErrors": 0,
"inningsPlayed": 11,
"awayStartingPitcherName": "Shohei Ohtani",
"homeStartingPitcherName": "Max Scherzer",
"winningPitcherName": "Yoshinobu Yamamoto",
"lineScore": [{ "inning": 1, "awayRuns": 0, "homeRuns": 0 }],
"awayLineup": [{ "battingOrder": 1, "playerId": 660271, "playerName": "Shohei Ohtani", "position": "DH" }],
"awayPitching": { "inningsPitched": "11.0", "inningsPitchedOuts": 33, "earnedRuns": 4, "strikeOuts": 12 },
"attendance": 44713,
"gameDuration": "4:07"
}

Historical data

Add earlier years to seasons for teams, rosters, standings, schedules and stats. Year-by-year stats go back through a player's whole career. The input accepts seasons back to 1876. Older seasons can have fewer fields, because the source recorded less, and such fields come back as null.

How baseball statistics are formatted

  • Innings pitched counts outs after the point, not tenths: 106.2 means 106⅔ innings. You get three fields:
    • inningsPitched: the published text, "106.2"
    • inningsPitchedOuts: outs recorded, 320. Use this for adding up.
    • inningsPitchedDecimal: a true decimal, 106.667
  • Rates such as AVG, OBP, SLG, OPS, ERA and WHIP are numbers.
  • Missing values are null, never 0. A rate with no denominator, published as .--- or -.--, is null.
  • Published values are kept. The source prints .000 for some 0-for-0 batting lines, and that stays 0.
  • Games back: gamesBack keeps the published text (- for the leader) and gamesBackNum gives a number (0 for the leader). In wildCardGamesBack, +9.5 means 9.5 games ahead of the cut line.
  • Dates: officialDate is the local game date and gameDateUtc is the start time in UTC.
  • Jersey numbers are text, so 00 stays 00.

Errors and limits

  • Invalid input stops the run before any data is requested, with a message saying what to fix.
  • Temporary source errors are retried a limited number of times, with pauses between attempts.
  • Partial failures: if one team or batch fails, the run continues and lists the failure in RUN_SUMMARY. If everything fails, the run is marked as failed.
  • Access refusals end the run. The Actor does not use proxies or try to get around restrictions.
  • No matches: a valid search with no results succeeds with 0 records and explains why, and you are not charged.
  • Limits per run: 5,000 records (250 for game details), 30 seasons, 366 days of dates (31 for game details by date), and 600 source requests.
  • Past rosters: for past seasons the source returns the full-season roster, even if you ask for active or 40Man. rosterTypeReturned shows what came back.
  • Postponed games can appear on both the original and the new date.

Use cases

  • Fantasy baseball: track rosters, player lines and schedules.
  • Sports analytics: build multi-season datasets for models and research.
  • Dashboards and reporting: refresh standings and scores on a schedule.
  • Sports media and newsletters: pull tables and game summaries without manual entry.
  • Data science projects: get consistent, typed baseball data for study.

API and automation

Schedule runs in Apify, or connect the Actor to Make, Zapier, n8n or your own code.

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("zapticx/mlb-stats-scraper").call(
run_input={"mode": "standings", "seasons": ["2025"]}
)
for record in client.dataset(run["defaultDatasetId"]).iterate_items():
print(record["teamName"], record["wins"], record["losses"])

JavaScript

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('zapticx/mlb-stats-scraper').call({
mode: 'schedules',
teams: ['NYY'],
startDate: '2025-09-01',
endDate: '2025-09-07',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

cURL

curl -X POST "https://api.apify.com/v2/acts/zapticx~mlb-stats-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode": "standings"}'

FAQ

Do I need an MLB account or API key? No.

Is this live play-by-play? No. Scores and game data come from the source at the time of your run. Live play-by-play is not included, and fielding stats are not included in this version.

How fresh is the data? It follows the source, which can be cached for a few minutes. Don't rely on it for time-critical decisions.

Why did my player search return two people? Some players share a name. Both are included; use playerIds to pick one.

Why does my team's stats run not show a traded player's season total? Team results show that player's line for that team. Use playerIds to get the total.

Why did I get 0 records? Your filters may not match any games or players. For example, there are no regular-season games in December. Check the status message and RUN_SUMMARY.

Is this an official MLB product? No. See below.

Data source, usage limits and disclaimer

Data comes from the MLB Stats API (statsapi.mlb.com) and is © MLB Advanced Media, L.P. This Actor is an independent tool. It is not affiliated with, endorsed by or sponsored by Major League Baseball, MLB Advanced Media or any team. Team and league names are used only to identify the data.

MLB Advanced Media's published notice governs use of its materials, including limits on commercial and bulk use. You are responsible for making sure that your use of the data complies with it and with applicable law. Zapticx does not guarantee the accuracy or completeness of the data.

Support

Found a problem or need a feature? Open a ticket in the Issues tab of this Actor, and include your run ID and input.

About Zapticx

Zapticx builds reliable data tools and automation. See more of our Actors on our Apify Store profile or visit zapticx.com.