# MLB Stats Scraper (`neuro-scraper/mlb-stats-scraper`) Actor

MLB Stats Scraper exports Major League Baseball data: schedules and scores with line scores and top performers, standings, teams, rosters with bios, player stat leaderboards, player profiles and league leaders. No login.

- **URL**: https://apify.com/neuro-scraper/mlb-stats-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.19 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### MLB Stats Scraper

MLB Stats Scraper exports Major League Baseball data in clean rows: schedules and final or live scores with the inning-by-inning line score, hits, errors, winning and losing pitcher and top performers; standings with wins, losses, games back, streak and run differential; all 30 teams; rosters with full player bios; player stat leaderboards for hitting, pitching and fielding; single players with season and career stats; and league leaders.

MLB Stats Scraper is built for fantasy baseball players, sports bettors and analysts, journalists, sports apps and data teams that need MLB scores and stats in a spreadsheet or database every day - from the current season back to the 1800s.

MLB Stats Scraper needs no account, no cookies and no API key: choose a mode, press Start, and MLB Stats Scraper saves structured rows you can download as JSON, CSV, Excel, XML or HTML, or read with the Apify API.

> **Also from us: [Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper)** - export public Facebook Reels with views, likes, comments, captions and video files. Pairs well with MLB Stats Scraper when you follow teams and players on social media.

#### What does MLB Stats Scraper do?

MLB Stats Scraper writes one row per MLB record, with the same columns in the same order on every row, so the export drops straight into a spreadsheet, a BI tool, a database or a data pipeline. Key features of MLB Stats Scraper:

- Seven modes in one tool: schedule + scores, game details, standings, teams, players (rosters), player stats, league leaders.
- Scores with line score, hits, errors, inning-by-inning runs, winning / losing / save pitcher, probable pitchers and series status.
- Top performers of every game plus attendance, weather, wind and game duration.
- Standings with games back, division rank, streak, run differential, magic number, home / away / last-10 records.
- Player stats leaderboards with every stat, any sort stat, qualified / all / rookie pools, paged 50 players at a time.
- Several seasons, dates, game ids, team ids and player ids per run; the current season is found automatically.

#### How to use MLB Stats Scraper

1. **Open MLB Stats Scraper** on Apify and click **Try for free** (or **Start** if you already use it). Choose **What to scrape** (`mode`), e.g. `schedule` with a `date`, or `standings`. Every other option is optional and has a safe default.
2. **Set the filters and limits** you need - each one is explained under "Features and how they work" below. Start small (for example 20 rows) to see the columns, then raise the limit.
3. **Press Start and watch the log.** MLB Stats Scraper logs every step, e.g. "2026-09-01..2026-09-02: 30 games" or "2026 pitching: page 2, 50 players (total 100 of 868)". The last line of the log and the run's status message sum up every target: how many rows were saved and why each one stopped (limit reached, last page, filter, or a target that could not be read).
4. **Download the results** from the **Output** tab as JSON, CSV, Excel, XML or HTML, or read the dataset with the Apify API (examples below).
5. **Automate it:** create a schedule (hourly, daily, weekly) in Apify Console and connect an integration - Google Sheets, Zapier, Make, n8n, Slack, email or a webhook that fires when a run of MLB Stats Scraper finishes.

#### Features and how they work

Every input option of MLB Stats Scraper is explained below: what it does, how MLB Stats Scraper applies it, the allowed values and the default, an example, a tip and how it combines with the other options.

##### `mode` - What to scrape

**What it does:** Chooses which MLB data MLB Stats Scraper collects: schedule and scores, game details, standings, teams, players (rosters), player stats or league leaders.

**How it works:** Each mode writes its own row type (see the `recordType` column). Schedule writes one row per game with the line score; game details adds box-score team totals and umpires; standings writes one row per team with wins, losses and games back; teams lists the 30 clubs; players lists the roster of each team with full bios; player stats writes a leaderboard (or the players you name) with every stat; leaders writes the top players of each stat category.

**Allowed values and default:** one of `schedule`, `gameDetails`, `standings`, `teams`, `players`, `playerStats`, `leaders`; default: `"schedule"`.

**Example:** `"mode": "standings"`

**Tip:** Start with `schedule` for scores or `standings` for the table - both finish in seconds.

**Combinations:** Dates, game ids and the top-performers switch apply to schedule and game details; stat group, player pool and sorting apply to player stats and leaders; team ids and league filter every mode.

##### `task` - Task (alternative name for the mode)

**What it does:** The same choice as `mode`, under the task names some other MLB tools use (team_roster, game_boxscore, player_stats ...).

**How it works:** When you set a task, MLB Stats Scraper maps it to its mode and uses it instead of `mode`: teams = teams, team_roster = players, team_schedule = schedule (add a team id), standings = standings, player_stats = playerStats, game_boxscore = gameDetails, schedule = schedule, leaders = leaders.

**Allowed values and default:** one of `teams`, `team_roster`, `team_schedule`, `standings`, `player_stats`, `game_boxscore`, `schedule`, `leaders`; default: empty (not used).

**Example:** `"task": "team_roster"`

**Tip:** Useful when you move saved inputs from another tool; new users can ignore it and use `mode`.

**Combinations:** Leave it empty to use `mode`. With `team_schedule` or `team_roster` add `teamId` to get one club only.

##### `seasons` - Seasons

**What it does:** One or more MLB seasons to collect, for example 2025 and 2026.

**How it works:** MLB Stats Scraper runs the chosen mode once per season and merges the rows; with the field empty it asks for the current season when the run starts, so a scheduled run follows the new season automatically. Historical seasons go back to the 1800s for standings and stats.

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"seasons": ["2025", "2026"]`

**Tip:** For multi-year analysis of standings or leaderboards list each year - one run covers them all.

**Combinations:** Merged with `season`. Max rows per season limits each season separately; Max rows in total caps the whole run.

##### `season` - Season (single)

**What it does:** A shortcut for one season, as a number, e.g. 2026.

**How it works:** MLB Stats Scraper adds the number to the `seasons` list. In schedule mode a season without any date walks the whole season from its first to its last day in 7-day steps until the row limit is reached.

**Allowed values and default:** a whole number from 1876 to 2,100; default: empty (not used).

**Example:** `"season": 2026`

**Tip:** Leave both season fields empty to always get the current season.

**Combinations:** Merged with `seasons`; duplicates are removed.

##### `date` - Date

**What it does:** One day of games for schedule and game details, in YYYY-MM-DD form.

**How it works:** MLB Stats Scraper collects every game played or scheduled on that day (all ballparks), with scores and the inning-by-inning line score. Without any date, range, game id or season MLB Stats Scraper uses today.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"date": "2026-09-01"`

**Tip:** Use the date of yesterday in a daily schedule to collect final scores every morning.

**Combinations:** Ignored when Game dates or Game IDs are set. Combine with Team IDs for one club and Game type for postseason only.

##### `fromDate` - From date

**What it does:** Start of a date range for schedule and game details (YYYY-MM-DD).

**How it works:** MLB Stats Scraper walks from this day to `toDate` in 7-day steps and writes every game in the range in date order. Relative values like "7 days" (= from 7 days ago) work too.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"fromDate": "2026-08-01"`

**Tip:** A full month of games is about 400 rows - set Max rows in total accordingly.

**Combinations:** Use with `toDate`; without it the range ends today. Team IDs and Game type filter the range.

##### `toDate` - To date

**What it does:** End of the date range for schedule and game details (YYYY-MM-DD).

**How it works:** MLB Stats Scraper stops after the games of this day. When it is earlier than `fromDate` the two are swapped, so the order never matters.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"toDate": "2026-08-31"`

**Tip:** Leave it empty to collect everything up to today.

**Combinations:** Only used together with `fromDate`.

##### `gameDates` - Game dates (several days)

**What it does:** Several single days of games, one per line, YYYY-MM-DD or YYYYMMDD (20260901).

**How it works:** MLB Stats Scraper collects each listed day separately (duplicates removed, sorted) - handy for scoreboards of scattered dates such as every Opening Day or every game of a series.

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"gameDates": ["20260901", "20260915"]`

**Tip:** Both date formats can be mixed in one list.

**Combinations:** Wins over `date` and the date range. With includeTopPerformers each game also gets its top performers.

##### `gamePks` - Game IDs (gamePk)

**What it does:** Specific games by their MLB game id (gamePk), one per line.

**How it works:** MLB Stats Scraper looks up exactly these games, writes one row each and logs an error line for any id that does not exist. The game id is in the `gamePk` column of every schedule row and in MLB Gameday links.

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"gamePks": ["824472", "824473"]`

**Tip:** Use gameDetails mode with game ids to get box-score team totals, umpires, weather and attendance.

**Combinations:** Wins over every date option. Merged with `gamePk` and `gameId`.

##### `gamePk` - Game ID (single)

**What it does:** A shortcut for one MLB game id.

**How it works:** MLB Stats Scraper adds the id to the `gamePks` list and collects that game in schedule or game-details mode with the same columns as a date search, including the line score.

**Allowed values and default:** a whole number from 1; default: empty (not used).

**Example:** `"gamePk": 824472`

**Tip:** Copy the id from the `gamePk` column of an earlier run.

**Combinations:** Merged with `gamePks` and `gameId`.

##### `gameId` - Game ID (other name)

**What it does:** The same as `gamePk`, under the name other tools use for the game id.

**How it works:** MLB Stats Scraper merges it into the game id list, so saved inputs from other tools keep working unchanged and return the same game row with scores, line score and box-score information.

**Allowed values and default:** a whole number from 1; default: empty (not used).

**Example:** `"gameId": 824473`

**Tip:** Use either name - the result is the same.

**Combinations:** Merged with `gamePks` and `gamePk`.

##### `teamIds` - Team IDs

**What it does:** Limits the run to these MLB clubs by team id (147 Yankees, 119 Dodgers, 111 Red Sox ...).

**How it works:** MLB Stats Scraper filters every mode by club: schedule returns only games of these teams, players reads only their rosters, standings and teams keep only these clubs, player stats and leaders keep players of these clubs. Team ids are in the `teamId` column of a teams or standings run.

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"teamIds": ["147", "119"]`

**Tip:** Run mode `teams` once to see all 30 ids.

**Combinations:** Merged with `teamId`. Works with every other filter.

##### `teamId` - Team ID (single)

**What it does:** A shortcut for one MLB team id.

**How it works:** MLB Stats Scraper adds the id to the `teamIds` list. With one team in player-stats mode the leaderboard is asked for that club directly, so all its players are listed and ranked.

**Allowed values and default:** a whole number from 1; default: empty (not used).

**Example:** `"teamId": 147`

**Tip:** With `team_schedule` as task, a single team id gives that club's full schedule.

**Combinations:** Merged with `teamIds`.

##### `playerIds` - Player IDs

**What it does:** Player stats for these players by MLB person id (660271 = Shohei Ohtani, 592450 = Aaron Judge).

**How it works:** MLB Stats Scraper writes one row per player with the full bio (birth date and place, height, weight, bats/throws, debut), the season stats of the chosen stat group as columns and the career totals in `careerStats`. Ids that do not exist are logged. Person ids are in the `playerId` column of roster, leaderboard and leader rows.

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"playerIds": ["660271", "592450"]`

**Tip:** Use stat group `pitching` for pitchers - a two-way player has both.

**Combinations:** Only used in playerStats mode; without ids that mode writes a leaderboard instead. Merged with `playerId`.

##### `playerId` - Player ID (single)

**What it does:** A shortcut for one MLB person id.

**How it works:** MLB Stats Scraper adds the id to the `playerIds` list and writes that player's bio, season stats and career stats in player-stats mode, for every season you list.

**Allowed values and default:** a whole number from 1; default: empty (not used).

**Example:** `"playerId": 660271`

**Tip:** Add several seasons to get a year-by-year table of one player.

**Combinations:** Merged with `playerIds`.

##### `leagueId` - League

**What it does:** Keeps one league (American or National) or both.

**How it works:** MLB Stats Scraper looks up the league ids of the season when the run starts and filters teams, rosters and standings by league; player stats leaderboards are asked for that league only.

**Allowed values and default:** one of `both`, `AL`, `NL`; default: `"both"`.

**Example:** `"leagueId": "AL"`

**Tip:** Use `AL` or `NL` for league-only tables such as wild-card races.

**Combinations:** Works with Team IDs (both must match). Not used for schedule and leaders.

##### `statGroup` - Stat group

**What it does:** Which statistics player stats and leaders return: hitting, pitching or fielding.

**How it works:** MLB Stats Scraper asks for that group's stats - hitting adds AVG, OBP, SLG, OPS, home runs, RBI, stolen bases; pitching adds ERA, WHIP, wins, saves, strikeouts, innings; fielding adds putouts, assists, errors and fielding percentage.

**Allowed values and default:** one of `hitting`, `pitching`, `fielding`; default: `"hitting"`.

**Example:** `"statGroup": "pitching"`

**Tip:** Pitching leaderboards sort by ERA (lowest first) unless you choose another stat.

**Combinations:** Sets the default sort stat and the default leader categories.

##### `gameType` - Game type

**What it does:** Which games (schedule, game details) or which part of the season (player stats, leaders) to use.

**How it works:** MLB Stats Scraper sends the game type with every request: R regular season, S spring training, P postseason, F wild card, D division series, L league championship, W World Series, A All-Star game, E exhibition, ALL every type.

**Allowed values and default:** one of `ALL`, `R`, `S`, `P`, `F`, `D`, `L`, `W`, `A`, `E`; default: `"ALL"`.

**Example:** `"gameType": "W"`

**Tip:** Leave ALL for date searches - a regular-season-only filter would hide October games.

**Combinations:** Overrides `seasonType`. In schedule mode with only a season, R walks the regular season and S spring training.

##### `seasonType` - Season type (shortcut)

**What it does:** A simpler shortcut for the game type: regular season, postseason or spring training.

**How it works:** MLB Stats Scraper turns `regular` into R, `post` into all postseason rounds (wild card, division series, LCS, World Series) and `spring` into S, and uses that as the game type.

**Allowed values and default:** one of `any`, `regular`, `post`, `spring`; default: `"any"`.

**Example:** `"seasonType": "post"`

**Tip:** Use `post` to get every playoff game of a season in one run.

**Combinations:** Only used when Game type is ALL; a specific Game type always wins.

##### `includeTopPerformers` - Include top performers and game info

**What it does:** Adds each game's top performers plus attendance, weather, wind and game duration to schedule rows.

**How it works:** MLB Stats Scraper opens every game's box score in parallel and adds `topPerformers` (up to three players with their batting or pitching line, e.g. "2-5 | 2 HR, 2 RBI") and the game info lines. Off = faster, smaller rows without those columns.

**Allowed values and default:** `true` or `false`; default: `true`.

**Example:** `"includeTopPerformers": true`

**Tip:** Keep it on for game recaps and fantasy research; turn it off for long seasons where only scores matter.

**Combinations:** Always on in gameDetails mode. Parallel requests follow Max parallel requests.

##### `playerPool` - Player pool (player stats)

**What it does:** Which players the player-stats leaderboard lists: all, qualified or rookies.

**How it works:** MLB Stats Scraper sends the pool with the leaderboard request. Qualified players have enough plate appearances or innings for rate stats (batting average, ERA), so sorting by a rate is meaningful; All includes everyone who played.

**Allowed values and default:** one of `ALL`, `QUALIFIED`, `ROOKIES`; default: `"QUALIFIED"`.

**Example:** `"playerPool": "ALL"`

**Tip:** Use ALL with a counting stat such as homeRuns to list every player; QUALIFIED for AVG / OPS / ERA tables.

**Combinations:** Only for playerStats without player ids. Rookies lists first-year players only.

##### `sortStat` - Sort by stat (player stats)

**What it does:** The stat the leaderboard is sorted by, e.g. homeRuns, battingAverage, onBasePlusSlugging, earnedRunAverage, strikeouts.

**How it works:** MLB Stats Scraper asks for the leaderboard in this order and pages 50 players at a time until the limit or the last player; rate stats like ERA and WHIP sort lowest first automatically. Empty = OPS for hitting, ERA for pitching, fielding percentage for fielding.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"sortStat": "homeRuns"`

**Tip:** The sort stat is written in the `sortStat` column so you always know how a table was ranked.

**Combinations:** Works with Player pool and Sort order. Ranks (`rank`) follow this stat; tied players share a rank.

##### `sortOrder` - Sort order (player stats)

**What it does:** The direction of the leaderboard: automatic, highest first or lowest first.

**How it works:** MLB Stats Scraper uses lowest first for ERA, WHIP and similar "lower is better" stats and highest first for everything else when set to automatic; desc or asc override that.

**Allowed values and default:** one of `auto`, `desc`, `asc`; default: `"auto"`.

**Example:** `"sortOrder": "desc"`

**Tip:** Use `asc` with strikeOuts for hitters to find the hardest to strike out.

**Combinations:** Only used in playerStats leaderboards.

##### `leaderCategories` - Leader categories

**What it does:** Leaders mode: the stat categories to list leaders for, one per line.

**How it works:** MLB Stats Scraper writes the top players of each category with rank, value, team and league. Short names like rbi, era, avg and hr are turned into the full category names. Empty = home runs, batting average and RBI (hitting) or ERA, strikeouts and wins (pitching).

**Allowed values and default:** a list of text values (one per line in the form); default: empty (not used).

**Example:** `"leaderCategories": ["homeRuns", "stolenBases", "onBasePlusSlugging"]`

**Tip:** Unknown categories are named in the log as an error line.

**Combinations:** Players per category = Max rows per season (default 10). Merged with `leaderCategory`.

##### `leaderCategory` - Leader category (single)

**What it does:** A shortcut for one leader category (homeRuns, battingAverage, rbi, wins, era, strikeouts).

**How it works:** MLB Stats Scraper adds it to the `leaderCategories` list and writes the top players of that category for every season listed, with rank, value, team and league.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"leaderCategory": "era"`

**Tip:** Use with stat group pitching for pitching categories such as era, wins and saves.

**Combinations:** Merged with `leaderCategories`.

##### `rosterType` - Roster type (players)

**What it does:** Players mode: which roster of each team to list.

**How it works:** MLB Stats Scraper asks every team for this roster: active (26-man), 40-man, everyone who played for the club that season, the full roster, the depth chart or the all-time roster, and writes one row per player with the full bio.

**Allowed values and default:** one of `active`, `40Man`, `fullSeason`, `fullRoster`, `depthChart`, `allTime`; default: `"active"`.

**Example:** `"rosterType": "40Man"`

**Tip:** Use `fullSeason` after the season to include players who were traded or sent down.

**Combinations:** Filtered by Team IDs and League; Max rows per season caps players per season.

##### `maxItems` - Max rows in total

**What it does:** The most rows MLB Stats Scraper saves in the whole run.

**How it works:** MLB Stats Scraper stops as soon as this many rows are saved, over all seasons, dates and teams - you are never charged for more. 0 = no total limit.

**Allowed values and default:** a whole number from 0; default: `200`.

**Example:** `"maxItems": 500`

**Tip:** The easiest way to cap the cost of a run.

**Combinations:** Works on top of Max rows per season.

##### `maxItemsPerSeason` - Max rows per season (players, stats, leaders)

**What it does:** The most rows per season for players, player stats and leaders.

**How it works:** MLB Stats Scraper counts rows per season separately: 50 with two seasons = up to 100 rows. Player-stats leaderboards page 50 players at a time until this number or the last player. In leaders mode it is the number of players per category (0 = 10). 0 = every row.

**Allowed values and default:** a whole number from 0; default: `0`.

**Example:** `"maxItemsPerSeason": 50`

**Tip:** Use 0 to get a full leaderboard (751 hitters in 2026).

**Combinations:** Max rows in total can stop the run earlier.

##### `maxConcurrency` - Max parallel requests

**What it does:** How many requests MLB Stats Scraper sends at the same time.

**How it works:** MLB Stats Scraper opens that many anonymous sessions and spreads box scores and team rosters over them, so a day of 15 games with top performers or all 30 rosters finish in seconds.

**Allowed values and default:** a whole number from 1 to 32; default: `8`.

**Example:** `"maxConcurrency": 8`

**Tip:** The default is fast and polite; raise it to 16 for full seasons with top performers.

**Combinations:** Matters most with includeTopPerformers, gameDetails and players mode.

##### `webhookUrl` - Webhook URL (optional)

**What it does:** An optional web address that receives the rows as JSON when the run ends.

**How it works:** MLB Stats Scraper sends a POST with `mode`, `runId`, `count` and the rows (in batches of 500) to this address after the last row is saved - for Zapier, Make or n8n catch hooks or your own server. Delivery problems are logged, never fail the run.

**Allowed values and default:** text; default: empty (not used).

**Example:** `"webhookUrl": "https://hooks.zapier.com/hooks/catch/123/abc/"`

**Tip:** Apify integrations do the same with retries; use this for a quick one-off push.

**Combinations:** Works with every mode. Up to 5,000 rows are sent.

##### `proxyConfiguration` - Proxy configuration

**What it does:** Chooses the proxy servers the run uses.

**How it works:** MLB Stats Scraper sends its requests through Apify Proxy. Residential IPs are the default because they are refused far less often than datacenter IPs; when one IP is blocked, MLB Stats Scraper retries with a fresh session automatically.

**Allowed values and default:** default: `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}`.

**Example:** `"proxyConfiguration": {"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}`

**Tip:** Keep the default unless you have your own proxy. Switching to datacenter proxies saves a little platform usage but makes blocks more likely on large runs.

**Combinations:** Works with every other option; it changes only how requests are sent, never which rows you get.

#### Ready-to-copy input examples for MLB Stats Scraper

**Scores of two days** - every game of 1-2 September 2026 with line score and top performers (30 rows).

```json
{
  "mode": "schedule",
  "fromDate": "2026-09-01",
  "toDate": "2026-09-02",
  "includeTopPerformers": true,
  "maxItems": 30
}
```

**American League standings** - the 15 AL teams with wins, losses, games back, streak and run differential.

```json
{
  "mode": "standings",
  "season": 2026,
  "leagueId": "AL"
}
```

**Home-run leaderboard of two seasons** - the top 50 home-run hitters of 2025 and of 2026 (100 rows) with every hitting stat.

```json
{
  "mode": "playerStats",
  "seasons": [
    "2025",
    "2026"
  ],
  "statGroup": "hitting",
  "playerPool": "ALL",
  "sortStat": "homeRuns",
  "maxItemsPerSeason": 50,
  "maxItems": 100
}
```

**Yankees and Dodgers rosters** - the active rosters of two clubs with birth date, height, weight, bats / throws and debut date.

```json
{
  "mode": "players",
  "teamIds": [
    "147",
    "119"
  ],
  "rosterType": "active"
}
```

**Two players, season and career** - bio, 2025 season stats and career totals of Shohei Ohtani and Aaron Judge.

```json
{
  "mode": "playerStats",
  "playerIds": [
    "660271",
    "592450"
  ],
  "season": 2025
}
```

#### Output fields of MLB Stats Scraper

Every row of MLB Stats Scraper has the columns below. "Filled in test" is measured on our latest test run (30 rows). A value is empty (null) when the MLB record does not publish it - MLB Stats Scraper never guesses or fills old values, so exports keep a stable shape from run to run. Several columns carry the same value under the name other tools use, so imports built for another tool keep working.

| Field | Type | Meaning | Example | Filled in test / when empty |
|---|---|---|---|---|
| `recordType` | text | Row type: `game`, `standing`, `team`, `player`, `playerStats` or `leader`. | `game` | 30/30 |
| `task` | text | The mode (or task name) that produced the row. | `schedule` | 30/30 |
| `success` | boolean | `true` for every saved row. | `true` | 30/30 |
| `season` | text | Season of the row, e.g. "2026". | `2026` | 30/30 |
| `name` | text | Row title: "Away @ Home" for games, team name, or player name. | `San Diego Padres @ Cincinnati Reds` | 30/30 |
| `url` | URL | MLB.com page of the game (Gameday), team or player. | `https://www.mlb.com/gameday/824472` | 30/30 |
| `link` | URL | Same value as `url`. | `https://www.mlb.com/gameday/824472` | 30/30 |
| `teamId` | text | MLB team id (team, standings, roster and stats rows). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `team` | text | Team name (club name on team / standings rows). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `league` | text | League name, e.g. American League. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `leagueName` | text | Same value as `league`. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `division` | text | Division name, e.g. American League East. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `divisionName` | text | Same value as `division`. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `wins` | array | Wins (standings; pitcher wins on pitching rows). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `losses` | array | Losses (standings; pitcher losses on pitching rows). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `pct` | text | Winning percentage, e.g. ".605". | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `winningPercentage` | text | Same value as `pct`. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `gamesBack` | text | Games behind the division leader ("-" for the leader). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `divisionRank` | text | Place in the division. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `streak` | text | Current streak, e.g. W3 or L1. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `runDifferential` | text | Runs scored minus runs allowed. | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `magicNumber` | number | Magic number to clinch ("-" when not applicable). | - | 0/30 - empty on game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `gamePk` | number | MLB game id. | `824472` | 30/30 |
| `gameID` | text | Game id as text (same number as `gamePk`). | `824472` | 30/30 |
| `gameGuid` | text | Global unique game id. | `01300cd5-6508-49d5-9828-a022f95bedd4` | 30/30 |
| `gameDate` | date (ISO) | First pitch time in UTC (ISO 8601). | `2026-09-01T22:40:00Z` | 30/30 |
| `officialDate` | date (ISO) | Official game date (YYYY-MM-DD). | `2026-09-01` | 30/30 |
| `gameTime` | text | First pitch in US Eastern time, e.g. "6:40 PM ET". | `6:40 PM ET` | 30/30 |
| `gameType` | text | R regular, P/F/D/L/W postseason, S spring, A All-Star. | `R` | 30/30 |
| `gamedayType` | text | Gameday coverage level code. | `P` | 30/30 |
| `seasonDisplay` | text | Season shown for the game. | `2026` | 30/30 |
| `tiebreaker` | text | `Y` for a tie-breaker game. | `N` | 30/30 |
| `seriesDescription` | text | Series name, e.g. Regular Season, World Series. | `Regular Season` | 30/30 |
| `seriesGameNumber` | number | Game number within the series. | `2` | 30/30 |
| `gamesInSeries` | number | Games in the series. | `3` | 30/30 |
| `status` | text | Detailed status: Scheduled, In Progress, Final, Postponed ... | `Final` | 30/30 |
| `gameStatus` | text | Short status: Preview, Live or Final. | `Final` | 30/30 |
| `currentInning` | text | Inning now (e.g. "Top 7th"), "Final" or "Final (10 innings)". | `Final` | 30/30 |
| `matchup` | text | Short matchup, e.g. "SD @ CIN". | `SD @ CIN` | 30/30 |
| `awayTeam` | text | Away team name. | `San Diego Padres` | 30/30 |
| `homeTeam` | text | Home team name. | `Cincinnati Reds` | 30/30 |
| `awayScore` | number | Away runs. | `3` | 30/30 |
| `homeScore` | number | Home runs. | `4` | 30/30 |
| `awayHits` | number | Away hits. | `7` | 30/30 |
| `homeHits` | number | Home hits. | `8` | 30/30 |
| `awayErrors` | number | Away errors. | `0` | 30/30 |
| `homeErrors` | number | Home errors. | `0` | 30/30 |
| `awayInningScores` | array | Away runs per inning, as a list. | `[1, 0, 0, 0, 1, 0, 0, 0, 1]` | 30/30 |
| `homeInningScores` | array | Home runs per inning, as a list (null = bottom of the inning not played). | `[1, 0, 0, 0, 1, 0, 0, 2, null]` | 30/30 |
| `winner` | text | `home` or `away` once the game is final. | `home` | 30/30 |
| `winningTeam` | text | Name of the winning team. | `Cincinnati Reds` | 30/30 |
| `venueName` | text | Ballpark name. | `Great American Ball Park` | 30/30 |
| `topPerformers` | array | Up to three top players of the game with type, game score, team, position and batting / pitching line. | `[{"type": "hitter", "gameScore": 64, "playerI...` | 30/30 |
| `timestamp` | date (ISO) | When MLB Stats Scraper saved the row (ISO 8601, UTC). | `2026-11-21T15:59:32+00:00` | 30/30 |
| `scrapedAt` | date (ISO) | Same value as `timestamp`. | `2026-11-21T15:59:32+00:00` | 30/30 |
| `awayTeamId` | number | Away team id. | `135` | 30/30 |
| `homeTeamId` | number | Home team id. | `113` | 30/30 |
| `awayTeamAbbreviation` | text | Away team code, e.g. SD. | `SD` | 30/30 |
| `homeTeamAbbreviation` | text | Home team code, e.g. CIN. | `CIN` | 30/30 |
| `awayRecord` | text | Away team record after the game, e.g. "73-66". | `73-66` | 30/30 |
| `homeRecord` | text | Home team record after the game. | `66-73` | 30/30 |
| `awayLeftOnBase` | number | Away runners left on base. | `8` | 30/30 |
| `homeLeftOnBase` | number | Home runners left on base. | `7` | 30/30 |
| `awayProbablePitcher` | text | Away starting (probable) pitcher. | `Randy Vásquez` | 30/30 |
| `homeProbablePitcher` | text | Home starting (probable) pitcher. | `Nick Lodolo` | 30/30 |
| `winningPitcher` | text | Pitcher credited with the win. | `Brock Burke` | 30/30 |
| `losingPitcher` | text | Pitcher charged with the loss. | `Adrian Morejon` | 30/30 |
| `savePitcher` | text | Pitcher credited with the save. | `Emilio Pagán` | 8/30 - empty when no pitcher earned a save (measured: 22 of 30 games had none - a save only exists in close wins) |
| `dayNight` | text | `day` or `night`. | `night` | 30/30 |
| `doubleHeader` | text | `N`, `Y` (traditional) or `S` (split) double-header. | `N` | 30/30 |
| `gameNumber` | number | Game of the day (2 in a double-header). | `1` | 30/30 |
| `scheduledInnings` | number | Scheduled innings (9; 7 in some double-headers). | `9` | 30/30 |
| `venueId` | number | Ballpark id. | `2602` | 30/30 |
| `seriesStatus` | text | Series standing, e.g. "Series tied 1-1". | `Series tied 1-1` | 30/30 |
| `isTie` | boolean | `true` when the game ended tied. | `false` | 30/30 |
| `attendance` | number | Paid attendance. | `19376` | 30/30 |
| `weather` | text | Weather at first pitch, e.g. "92 degrees, Clear". | `92 degrees, Clear` | 30/30 |
| `wind` | text | Wind at first pitch. | `5 mph, R To L` | 30/30 |
| `gameDuration` | text | Game duration (h:mm). | `2:47` | 30/30 |
| `firstPitch` | text | Local first-pitch time as announced. | `6:41 PM` | 30/30 |

#### Which columns can be empty in MLB Stats Scraper

Measured on our latest test run (30 rows): these columns were empty on more than 10% of the rows. Each one was checked against what the site itself shows for those rows - MLB Stats Scraper leaves a column empty only when the site does not publish the value for that row (or when the option that fills it is off). Nothing is guessed.

| Column | Empty in test | Why (measured) |
|---|---|---|
| `teamId` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `team` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `league` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `leagueName` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `division` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `divisionName` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `wins` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `losses` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `pct` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `winningPercentage` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `gamesBack` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `divisionRank` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `streak` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `runDifferential` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `magicNumber` | 30 of 30 | On game rows - these are standings / team columns, filled on `standing`, `team`, `player` and stats rows (each game row carries both clubs in the away / home columns instead) |
| `savePitcher` | 22 of 30 | When no pitcher earned a save (measured: 22 of 30 games had none - a save only exists in close wins) |

#### Example row of MLB Stats Scraper

One real row from a test run of MLB Stats Scraper (long texts shortened):

```json
{
  "recordType": "game",
  "task": "schedule",
  "success": true,
  "season": "2026",
  "name": "San Diego Padres @ Cincinnati Reds",
  "url": "https://www.mlb.com/gameday/824472",
  "link": "https://www.mlb.com/gameday/824472",
  "teamId": null,
  "team": null,
  "league": null,
  "leagueName": null,
  "division": null,
  "divisionName": null,
  "wins": null,
  "losses": null,
  "pct": null,
  "winningPercentage": null,
  "gamesBack": null,
  "divisionRank": null,
  "streak": null,
  "runDifferential": null,
  "magicNumber": null,
  "gamePk": 824472,
  "gameID": "824472",
  "gameGuid": "01300cd5-6508-49d5-9828-a022f95bedd4",
  "gameDate": "2026-09-01T22:40:00Z",
  "officialDate": "2026-09-01",
  "gameTime": "6:40 PM ET",
  "gameType": "R",
  "gamedayType": "P",
  "seasonDisplay": "2026",
  "tiebreaker": "N",
  "seriesDescription": "Regular Season",
  "seriesGameNumber": 2,
  "gamesInSeries": 3,
  "status": "Final",
  "gameStatus": "Final",
  "currentInning": "Final",
  "matchup": "SD @ CIN",
  "awayTeam": "San Diego Padres",
  "homeTeam": "Cincinnati Reds",
  "awayScore": 3,
  "homeScore": 4,
  "awayHits": 7,
  "homeHits": 8,
  "awayErrors": 0,
  "homeErrors": 0,
  "awayInningScores": [
    1,
    0,
    0
  ],
  "homeInningScores": [
    1,
    0,
    0
  ],
  "winner": "home",
  "winningTeam": "Cincinnati Reds",
  "venueName": "Great American Ball Park",
  "topPerformers": [
    {
      "type": "hitter",
      "gameScore": 64,
      "playerId": 665487,
      "name": "Fernando Tatis Jr.",
      "team": "San Diego Padres",
      "position": "2B",
      "batting": "2-5 | 2 HR, K, 2 RBI",
      "pitching": null
    },
    {
      "type": "starter",
      "gameScore": 55,
      "playerId": 666157,
      "name": "Nick Lodolo",
      "team": "Cincinnati Reds",
      "position": "P",
      "batting": null,
      "pitching": "6.0 IP, 2 ER, 5 K, 2 BB"
    },
    {
      "type": "hitter",
      "gameScore": 53,
      "playerId": 669392,
      "name": "Samad Taylor",
      "team": "San Diego Padres",
      "position": "LF",
      "batting": "2-4 | 3B, HBP, K",
      "pitching": null
    }
  ],
  "timestamp": "2026-11-21T15:59:32+00:00",
  "scrapedAt": "2026-11-21T15:59:32+00:00",
  "awayTeamId": 135,
  "homeTeamId": 113,
  "awayTeamAbbreviation": "SD",
  "homeTeamAbbreviation": "CIN",
  "awayRecord": "73-66",
  "homeRecord": "66-73",
  "awayLeftOnBase": 8,
  "homeLeftOnBase": 7,
  "awayProbablePitcher": "Randy Vásquez",
  "homeProbablePitcher": "Nick Lodolo",
  "winningPitcher": "Brock Burke",
  "losingPitcher": "Adrian Morejon",
  "savePitcher": "Emilio Pagán",
  "dayNight": "night",
  "doubleHeader": "N",
  "gameNumber": 1,
  "scheduledInnings": 9,
  "venueId": 2602,
  "seriesStatus": "Series tied 1-1",
  "isTie": false,
  "attendance": 19376,
  "weather": "92 degrees, Clear",
  "wind": "5 mph, R To L",
  "gameDuration": "2:47",
  "firstPitch": "6:41 PM"
}
```

#### MLB Stats Scraper compared with the top 5 tools of its kind

We compared MLB Stats Scraper with the five most-used tools of its kind on the Apify Store and added every input option and output field they offer that can be collected without logging in. The table shows the main features.

| Feature | Offered by (of the top 5) | MLB Stats Scraper |
|---|---|---|
| Schedule and scores | 4 of 5 | yes |
| Line score, hits, errors, inning scores | 1 of 5 | yes |
| Top performers | 1 of 5 | yes |
| Standings | 4 of 5 | yes |
| Teams | 4 of 5 | yes |
| Rosters with bios | 4 of 5 | yes |
| Player stats | 5 of 5 | yes (leaderboard + by id) |
| League leaders | 2 of 5 | yes |
| Game details (box score) | 4 of 5 | yes |
| Several seasons / dates / ids in one run | 2 of 5 | yes |
| Webhook delivery | 1 of 5 | yes |

#### Use cases for MLB Stats Scraper

- Fantasy baseball: daily box-score lines and leaderboards for waiver and lineup decisions.
- Betting models: final scores, run lines, starting pitchers and team form (streak, last 10).
- Sports media: standings tables and game recaps with top performers.
- Analytics: multi-season player stats for sabermetric research in a spreadsheet, BI tool or notebook.
- Apps and bots: a scheduled run feeds scores and standings to a website, Slack or Discord.

#### Tips for the best results with MLB Stats Scraper

- Schedule MLB Stats Scraper every morning with yesterday's date to collect all final scores.
- Use `playerPool` QUALIFIED with rate stats (AVG, OPS, ERA) and ALL with counting stats (home runs).
- Turn off top performers for full-season schedules when only scores matter - rows are smaller and the run is faster.
- Run `teams` once to see all team ids, then filter other modes with them.

#### Limits of MLB Stats Scraper (measured)

- Live games show the score so far; re-run MLB Stats Scraper after the last out for the final line.
- Leaderboards are paged 50 players at a time; a full 2026 hitting table has 751 players (16 pages).
- A whole season of games is about 2,430 rows; set Max rows in total accordingly.
- Off-season dates (November to February) have no games - the log says "0 games".

#### How much does MLB Stats Scraper cost?

MLB Stats Scraper uses pay-per-event pricing: you pay per result row that MLB Stats Scraper saves (event `result`), plus the Apify platform usage of the run. There is no monthly rental and no start fee from us. One result = one row of the dataset (one game, team, standings line, player or leader entry).

| Apify plan | Price per 1,000 results | 1,000 rows | 10,000 rows |
|---|---|---|---|
| Free | $1.49 | $1.49 | $14.90 |
| Starter | $1.39 | $1.39 | $13.90 |
| Scale | $1.29 | $1.29 | $12.90 |
| Business | $1.19 | $1.19 | $11.90 |

**Worked example:** a daily run of 15 games on the Starter plan = 15 / 1,000 x $1.39 = **$0.02** per day, about $0.63 a month.

Platform usage measured on our test run: 30 rows used about $0.0001 of compute and proxy, so the result price is the main part of the cost.

**Free plan:** Apify free-plan users can run MLB Stats Scraper with up to 30 rows per run (30 x $1.49 / 1,000 = about $0.045), enough to check the data before a larger run. **Capping the cost:** set the "Max" limits in the input and, in the run options, a **maximum cost per run** - MLB Stats Scraper stops cleanly when the budget is reached and keeps every row it already saved.

#### Use MLB Stats Scraper with the API

Start MLB Stats Scraper from your own code with the same input as in the examples above. Replace `<YOUR_APIFY_TOKEN>` with the token from Apify Console > Settings > Integrations.

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run_input = {
    "mode": "schedule",
    "fromDate": "2026-09-01",
    "toDate": "2026-09-02",
    "includeTopPerformers": True,
    "maxItems": 30
}
run = client.actor("neuro-scraper/mlb-stats-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**Node.js** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('neuro-scraper/mlb-stats-scraper').call({"mode": "schedule", "fromDate": "2026-09-01", "toDate": "2026-09-02", "includeTopPerformers": true, "maxItems": 30});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**HTTP** (one call that runs the Actor and returns the rows):

```bash
curl -X POST 'https://api.apify.com/v2/acts/neuro-scraper~mlb-stats-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"mode": "schedule", "fromDate": "2026-09-01", "toDate": "2026-09-02", "includeTopPerformers": true, "maxItems": 30}'
```

MLB Stats Scraper also works with the Apify MCP server, so AI agents (Claude, ChatGPT, Cursor) can call it as a tool, and with every Apify integration: Google Sheets, Zapier, Make, n8n, Airbyte, Slack, email and webhooks.

#### Related Actors

Other scrapers from us that pair well with MLB Stats Scraper:

| Actor | What it extracts |
|---|---|
| [ESPN Scores Scraper](https://apify.com/neuro-scraper/espn-scores-scraper) | Live and final scores of many sports and leagues |
| [SofaScore Matches & Stats Scraper](https://apify.com/neuro-scraper/sofascore-matches-stats-scraper) | Matches, line-ups and match statistics |
| [Flashscore Scores & Odds Scraper](https://apify.com/neuro-scraper/flashscore-scores-odds-scraper) | Scores, fixtures and odds of many sports |
| [Sports Betting Odds Scraper](https://apify.com/neuro-scraper/sports-betting-odds-scraper) | Betting odds and lines of upcoming games |
| [Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper) | Public Facebook Reels with views, likes and comments |

#### FAQ about MLB Stats Scraper

**Why did MLB Stats Scraper return fewer rows than the maximum?**

The date range had fewer games, the leaderboard had fewer players, or a filter (team ids, league) removed rows. The status message lists what each season or date range returned.

**Why are the standings columns empty on game rows of MLB Stats Scraper?**

Every row of MLB Stats Scraper has the same columns so exports keep one shape. Game rows fill the game columns; the standings columns (wins, losses, games back ...) are filled on standings rows.

**How do I get only new games with MLB Stats Scraper?**

Schedule MLB Stats Scraper daily with yesterday's date (or fromDate "1 day"); every game appears once.

**Can I run many dates, teams or players in one run of MLB Stats Scraper?**

Yes - use Game dates, a date range, several seasons, Team IDs or Player IDs.

**How fast is MLB Stats Scraper?**

Our 30-game test with top performers took about 10 seconds; a 60-player leaderboard about 13 seconds.

**Do I need an account, cookies or an API key for MLB Stats Scraper?**

No. MLB Stats Scraper works without any login, cookies or API key of yours - you only need an Apify account to run it.

**Is it legal to use MLB Stats Scraper?**

MLB Stats Scraper collects only public data that anyone can see without logging in. You are responsible for how you use the results: respect the platform's terms, copyright and privacy laws such as GDPR and CCPA, and do not collect personal data without a legitimate reason. If in doubt, ask a lawyer.

**Can I get help or ask for a feature of MLB Stats Scraper?**

Yes - open an issue on the Issues tab of MLB Stats Scraper. We read every issue and usually answer within a day.

# Actor input Schema

## `mode` (type: `string`):

Which MLB data to collect. Each mode is explained in the README.

## `task` (type: `string`):

Same as 'What to scrape', with the task names other MLB tools use. When set, it is used instead of 'What to scrape'.

## `seasons` (type: `array`):

One or more seasons, e.g. 2025 and 2026. Empty = the current season.

## `season` (type: `integer`):

Shortcut for one season, e.g. 2026. Merged with Seasons.

## `date` (type: `string`):

Schedule / game details for one day, YYYY-MM-DD, e.g. 2026-09-01. Empty with no range = today.

## `fromDate` (type: `string`):

Start of a date range (YYYY-MM-DD) for schedule / game details.

## `toDate` (type: `string`):

End of the date range (YYYY-MM-DD). Empty = today.

## `gameDates` (type: `array`):

Several single days, YYYY-MM-DD or YYYYMMDD (e.g. 20260901).

## `gamePks` (type: `array`):

Specific games by MLB game id, e.g. 824472. Used by schedule and game details.

## `gamePk` (type: `integer`):

One MLB game id. Merged with Game IDs.

## `gameId` (type: `integer`):

Same as Game ID (single), under the name other tools use.

## `teamIds` (type: `array`):

Limit to these MLB team ids, e.g. 147 (Yankees), 119 (Dodgers), 111 (Red Sox). Empty = all teams.

## `teamId` (type: `integer`):

One MLB team id. Merged with Team IDs.

## `playerIds` (type: `array`):

Player stats mode: these MLB person ids (e.g. 660271 = Shohei Ohtani) with bio, season and career stats.

## `playerId` (type: `integer`):

One MLB person id. Merged with Player IDs.

## `leagueId` (type: `string`):

Teams, players, standings and player stats: one league or both.

## `statGroup` (type: `string`):

Statistics for player stats and leaders modes.

## `gameType` (type: `string`):

Which games (schedule, game details) or which part of the season (player stats, leaders).

## `seasonType` (type: `string`):

Shortcut for Game type. Used only when Game type is All.

## `includeTopPerformers` (type: `boolean`):

Schedule mode: add each game's top performers (batting / pitching lines), attendance, weather and duration.

## `playerPool` (type: `string`):

Which players the leaderboard lists. Qualified = enough plate appearances / innings for rate stats.

## `sortStat` (type: `string`):

Leaderboard order, e.g. homeRuns, battingAverage, onBasePlusSlugging, earnedRunAverage, strikeouts. Empty = OPS (hitting), ERA (pitching).

## `sortOrder` (type: `string`):

Order of the leaderboard.

## `leaderCategories` (type: `array`):

Leaders mode: e.g. homeRuns, battingAverage, runsBattedIn, stolenBases, earnedRunAverage, strikeouts, wins, saves.

## `leaderCategory` (type: `string`):

One leader category (homeRuns, battingAverage, rbi, wins, era, strikeouts). Merged with Leader categories.

## `rosterType` (type: `string`):

Which roster the players mode reads.

## `maxItems` (type: `integer`):

Stop the run after this many rows (0 = no total limit).

## `maxItemsPerSeason` (type: `integer`):

Players / player stats: rows per season (0 = all). Leaders: players per category (0 = 10).

## `maxConcurrency` (type: `integer`):

How many requests run at the same time (box scores, rosters).

## `webhookUrl` (type: `string`):

When the run ends, the rows are also POSTed as JSON to this URL (Zapier, Make, n8n or your own endpoint).

## `proxyConfiguration` (type: `object`):

Residential proxy is the default.

## Actor input object example

```json
{
  "mode": "schedule",
  "date": "2026-09-01",
  "leagueId": "both",
  "statGroup": "hitting",
  "gameType": "ALL",
  "seasonType": "any",
  "includeTopPerformers": true,
  "playerPool": "QUALIFIED",
  "sortOrder": "auto",
  "rosterType": "active",
  "maxItems": 200,
  "maxItemsPerSeason": 0,
  "maxConcurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One row per result, in the run's default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "schedule",
    "date": "2026-09-01",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/mlb-stats-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "schedule",
    "date": "2026-09-01",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/mlb-stats-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "schedule",
  "date": "2026-09-01",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call neuro-scraper/mlb-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/mlb-stats-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/XzATwglE5R0GTdaha/builds/Gbv8wg357KKw53Kgu/openapi.json
