# MLB Stats API Scraper: Box Scores, Game Logs & Standings (`themineworks/mlb-stats-api-scraper`) Actor

MLB and minor league baseball data from the official MLB Stats API: games and scores with line scores, player box scores, player game logs, season stats, standings and rosters. Triple-A to Rookie too. No API key, no login. Pay per record.

- **URL**: https://apify.com/themineworks/mlb-stats-api-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Sports, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 mlb records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 API Scraper: Box Scores, Game Logs & Standings

[![426 MLB box score rows in 7 seconds: a recorded run returned every player line of 27 Sep 2026, from 14 games, in 7 seconds](https://api.apify.com/v2/key-value-stores/cUXz95yxflDho41nn/records/mlb-stats-api-scraper-hero.png)](https://console.apify.com/actors/5J4Pt2aoI59k8koxD/input?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

From **The Mine Works**, makers of [Threads Scraper](https://apify.com/themineworks/threads-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral) and [B2B Leads Finder](https://apify.com/themineworks/b2b-leads-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), with over 290,000 runs across 310+ public actors.

Last verified 29 Oct 2026: a live test run on Apify returned 10 games in 3 seconds.

Pull baseball data from MLB's official Stats API (statsapi.mlb.com), the JSON API that MLB's own sites read, as flat rows you can open in Excel or load into a database: games with line scores, box scores with one row per player per game, player game logs, season stats, standings and rosters. MLB and the minor leagues both work. No API key, no login, no browser.

### Why choose this actor?

- **A full day of box scores in 7 seconds.** On 1 Oct 2026 a run for 27 Sep returned 426 player lines from 14 games in 7 seconds, from 17 requests, every one answered on the first attempt. The day's 15th game was cancelled; it was skipped and cost nothing.
- **Six data types and six levels, going back decades.** MLB plus Triple-A, Double-A, High-A, Single-A and Rookie. In our 1 Oct 2026 checks, game scores for 1950, standings for 1927 and full box score lines for 1955 all came back.
- **From $2.50 per 1,000 rows, plus a flat $0.005 per run.** Dates without games, games not yet started, postponed or cancelled games in box score runs, names that match nothing, duplicates, rows past `maxResults` and the information row are never charged.

[![Run it on Apify](https://api.apify.com/v2/key-value-stores/cUXz95yxflDho41nn/records/button-run.png)](https://console.apify.com/actors/5J4Pt2aoI59k8koxD/input?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Part of The Mine Works More tools family:** [Tennis Match & Player Data Scraper](https://apify.com/themineworks/tennis-match-data?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral), [Google Hotels Prices Scraper](https://apify.com/themineworks/google-hotels-prices-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral).

Guide and FAQs: [MLB Stats API Scraper on themineworks.com](https://themineworks.com/actors/mlb-stats-api-scraper/).

### Try it in one minute

Paste this into the JSON tab of the input page and press Start. It returns the 15 games of the last day of the 2026 regular season, with line scores, pitchers and weather, in a few seconds.

```json
{
  "dataType": "games",
  "startDate": "2026-09-27",
  "maxResults": 30
}
```

Pick one `dataType` per run. Games and box scores take dates (`startDate` and `endDate`, or nothing for yesterday in US Eastern time); game logs, season stats, standings and rosters take a `season`. Narrow any of them with `teams` (a name such as `New York Yankees`, a nickname such as `Yankees`, an abbreviation such as `NYY`, or the MLB team id `147`) and `players` (a full name such as `Aaron Judge` or the MLB player id `592450`).

Apify's free plan includes $5 of credit every month, which covers about 1,240 rows at this actor's price.

#### Copy to your AI assistant

```
themineworks/mlb-stats-api-scraper on Apify. It pulls MLB and minor league data from MLB's official Stats API as flat rows: games, box scores (one row per player per game), player game logs, player season stats, standings or rosters. Call ApifyClient("TOKEN").actor("themineworks/mlb-stats-api-scraper").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items. Required: nothing (defaults to yesterday's games). Optional: dataType ("games" default, "boxScores", "playerGameLogs", "playerSeasonStats", "standings", "rosters"), startDate and endDate ("YYYY-MM-DD", up to 366 days; empty means yesterday in US Eastern time), season (year; empty means the current season), level ("mlb" default, "aaa", "aa", "high_a", "single_a", "rookie"), teams (names, nicknames, abbreviations or MLB ids), players (full names or MLB ids; game logs need players or teams), statGroups (hitting, pitching, fielding; default hitting and pitching), gameTypes (R, F, D, L, W, S, E, A; default regular season and postseason), rosterType ("active" default, "40Man", "fullSeason", "depthChart"), standingsType ("regularSeason" default, "wildCard", "springTraining"), maxResults (default 1000, up to 200000). Rows with a _type field are information rows, not data. Full spec: GET https://api.apify.com/v2/acts/themineworks~mlb-stats-api-scraper/builds/default (Bearer TOKEN), which returns inputSchema and readme. Token: https://console.apify.com/account/integrations?fpr=ymnoit&utm_source=apify-readme&utm_medium=referral
```

### Key features

- **Six data types, one per run**:

| `dataType` | One row is | Picked by |
|---|---|---|
| `games` | a game: score, line score by inning, hits, errors, left on base, probable, winning and losing pitchers, venue, weather, series | dates |
| `boxScores` | a player's line in one game: batting, pitching and fielding counts, batting order, position, season to date AVG, OPS, ERA and WHIP | dates |
| `playerGameLogs` | a player's line in one game, for every game of a season | season, players or teams |
| `playerSeasonStats` | a player's season line: hitting, pitching or fielding | season |
| `standings` | a team: wins, losses, games back, streak, run differential, home, away, last ten, one run, day, night and expected records | season |
| `rosters` | a player on a team roster: position, bats, throws, birth date and place, height, weight, MLB debut | season |

- **MLB and five minor league levels**: Triple-A, Double-A, High-A, Single-A and Rookie.
- **Wide rows**: a box score row carries 64 to 118 fields, every batting, pitching and fielding count the API gives for that player, with the team, opponent and final score on the same row.
- **Big pulls in one run**: date ranges up to 366 days, up to 200,000 rows per run, up to 200 teams or players per filter.
- **Forgiving name matching**: names are matched without accents or capitals, so `Jose Caballero` finds José Caballero. A name two players share returns both. A name that matches nothing is listed in the run summary and costs nothing.
- **Clean numbers**: rate stats such as AVG, OBP, ERA and WHIP come back as numbers, placeholders such as `.---` are left out rather than sent as text, and innings pitched stays text (`5.1` means five and one third innings).

### How to use it

#### Basic: yesterday's box scores, every morning

```json
{
  "dataType": "boxScores"
}
```

With `startDate` left empty the actor reads yesterday in US Eastern time, the latest day whose games are all finished. Save it as a task and schedule it daily, for example at 11:00 UTC with `0 11 * * *`, and each run brings the previous day's box scores without edits.

#### One team's games over a date range

```json
{
  "dataType": "games",
  "teams": ["NYY"],
  "startDate": "2026-09-01",
  "endDate": "2026-09-27"
}
```

#### A pitcher's game by game line for a season

```json
{
  "dataType": "playerGameLogs",
  "season": 2026,
  "players": ["Paul Skenes"],
  "statGroups": ["pitching"]
}
```

#### Every hitter's season line for a fantasy or betting model

```json
{
  "dataType": "playerSeasonStats",
  "season": 2026,
  "statGroups": ["hitting"],
  "maxResults": 2000
}
```

Rows come in the API's order, which is not sorted by playing time; the first rows can be pitchers with one plate appearance. Filter on `plate_appearances` after the run, and set `maxResults` high enough to get everyone.

#### The game logs of a whole roster

```json
{
  "dataType": "playerGameLogs",
  "season": 2026,
  "teams": ["Dodgers"],
  "maxResults": 10000
}
```

With `teams` and no `players`, the team's active roster is used.

#### A week of Triple-A scores

```json
{
  "dataType": "games",
  "level": "aaa",
  "startDate": "2026-09-14",
  "endDate": "2026-09-20"
}
```

#### Final standings and the postseason

```json
{
  "dataType": "standings",
  "season": 2026
}
```

One row per team, 30 for MLB. For playoff results, use `games` with `gameTypes` set to `F`, `D`, `L` and `W`: there is no postseason standings type.

#### Historical seasons

```json
{
  "dataType": "games",
  "startDate": "1950-07-04"
}
```

On 1 Oct 2026 this returned the July 4, 1950 games with final scores. Older box scores sometimes list the players without their stats; those games return no box score rows and cost nothing.

### Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `dataType` | string | `games` | `games`, `boxScores`, `playerGameLogs`, `playerSeasonStats`, `standings` or `rosters`. One per run. |
| `startDate` | string, `YYYY-MM-DD` | yesterday (US Eastern) | First day, for games and box scores. |
| `endDate` | string, `YYYY-MM-DD` | the start date | Last day. Up to 366 days per run; a longer range is cut to 366 days with a warning. |
| `season` | integer, 1876 to 2100 | current season | Year, for game logs, season stats, standings and rosters. In January and February the default is last year. |
| `level` | string | `mlb` | `mlb`, `aaa` (Triple-A), `aa` (Double-A), `high_a`, `single_a` or `rookie`. |
| `teams` | array of strings | all | Keep only these teams: a name (`New York Yankees`), nickname (`Yankees`), abbreviation (`NYY`) or MLB team id (`147`). For game logs, the active roster of each team is used when no players are given. |
| `players` | array of strings | all | Full name (`Aaron Judge`) or MLB player id (`592450`). Required for game logs unless `teams` is set; a filter for box scores and season stats. |
| `statGroups` | array | `hitting`, `pitching` | For game logs and season stats: `hitting`, `pitching`, `fielding`. |
| `gameTypes` | array | regular season and postseason | `R` regular season, `F` Wild Card, `D` Division Series, `L` League Championship Series, `W` World Series, `S` spring training, `E` exhibition, `A` All-Star Game. Season stats use the regular season when it is selected. |
| `rosterType` | string | `active` | For rosters: `active`, `40Man`, `fullSeason` (everyone on the roster this season) or `depthChart`. |
| `standingsType` | string | `regularSeason` | For standings: `regularSeason`, `wildCard` or `springTraining`. |
| `maxResults` | integer, 1 to 200,000 | `1000` | Stop after this many rows. A day of box scores is about 430 rows, a season of standings 30. |

The input form in Apify Console starts with `games` and `2026-09-27` filled in. Runs started through the API or an AI assistant get only what you send, plus the defaults above, so an empty input returns yesterday's games.

### What data do you get?

One row per record. Every row has `record_type` (`game`, `player_game`, `player_game_log`, `player_season`, `standing` or `roster_player`), `level`, `season`, `source_url` (the API address it came from) and `scraped_at`. Fields the API has no value for are left out of that row rather than sent as `null`.

**Games**: `game_pk`, `official_date`, `game_date`, `game_type`, `status`, `day_night`, `double_header`, `scheduled_innings`, `innings_played`, `venue_name`, both teams (`away_team_name`, `home_team_name`, abbreviations and ids), `away_score`, `home_score`, `winner`, hits, errors and left on base for each side, `linescore` by inning, team records, probable pitchers, `winning_pitcher`, `losing_pitcher`, weather (`weather_condition`, `weather_temp_f`, `weather_wind`), the series (`series_description`, `series_game_number`, `games_in_series`, `series_status`) and `game_url`.

**Box scores**: the game and both teams (`team_name`, `opponent_name`, `team_score`, `opponent_score`, `team_won`, `is_home`), the player (`player_id`, `player_name`, `jersey_number`, `position`, `all_positions`, `batting_order`, `is_starter`, `is_substitute`, `batted`, `pitched`), every batting count as `batting_...`, every pitching count as `pitching_...`, fielding counts as `fielding_...`, `batting_summary` or `pitching_summary` and `pitching_note` as MLB writes them, and season to date `season_batting_avg`, `season_batting_ops`, `season_home_runs`, `season_era` and `season_whip`. In our 27 Sep run, 301 of the 426 rows batted and 126 pitched.

**Player game logs**: `date`, `game_pk`, `game_number`, `day_night`, the player and team, `opponent_name`, `is_home`, `is_win`, `positions`, `summary` and every count for the stat group, such as `plate_appearances`, `hits`, `home_runs`, `rbi`, `avg` and `ops`.

**Player season stats**: the player and team, `league`, `position`, `age`, `num_teams` and the season line for the stat group, such as `games_played`, `plate_appearances`, `home_runs`, `avg`, `obp`, `slg`, `ops` and `babip`.

**Standings**: `league`, `division`, the team, `wins`, `losses`, `winning_percentage`, `games_back`, `wild_card_games_back`, ranks, `runs_scored`, `runs_allowed`, `run_differential`, `streak`, clinch flags, and split records: `home_record`, `away_record`, `last_ten`, `extra_innings_record`, `one_run_record`, `day_record`, `night_record`, `vs_left_record`, `vs_right_record` and `expected_record`.

**Rosters**: `roster_type`, the team, `player_id`, `player_name`, `jersey_number`, `position`, `position_name`, `status`, `bats`, `throws`, `birth_date`, `age`, `birth_city`, `birth_country`, `height`, `weight_lb`, `mlb_debut_date` and `player_url`.

**Information rows**: every run that delivers rows ends with one `_type: "info"` row, and a run that delivers none adds one that says why. They are never charged. Filter on `_type` to keep only data.

#### Stable fields for automations

The first 5 fields below were present in every row of every data type we sampled on 1 Oct 2026; the other 10 in all 456 box score rows (27 Sep 2026 and 4 Jul 1955). Their names will not change, so a Sheet, Zap, Make scenario or n8n flow can map to them safely.

| Field | On | What it is |
|---|---|---|
| `record_type` | every row | `game`, `player_game`, `player_game_log`, `player_season`, `standing` or `roster_player` |
| `level` | every row | `MLB`, `Triple-A` and so on |
| `season` | every row | Season year |
| `source_url` | every row | The MLB Stats API address the row came from |
| `scraped_at` | every row | When the row was collected, ISO 8601 in UTC |
| `game_pk` | box scores | MLB game id. With `player_id`, the unique key of a box score row. |
| `official_date` | box scores | Game date as MLB lists it |
| `game_type` | box scores | `R`, `F`, `D`, `L`, `W` and so on |
| `team_name` | box scores | The player's team |
| `opponent_name` | box scores | The other team |
| `team_score` | box scores | Runs scored by the player's team |
| `opponent_score` | box scores | Runs scored by the other team |
| `player_id` | box scores | MLB player id |
| `player_name` | box scores | Player's full name |
| `position` | box scores | Main position in that game, such as `SS` or `P` |

#### Output examples

Real rows from our 1 Oct 2026 runs, trimmed where marked.

**A `games` row: a Wild Card game that went to 10 innings** (Apify run on the current build, line score trimmed to 3 of 10 innings)

```json
{
  "record_type": "game",
  "game_pk": 849841,
  "official_date": "2026-09-30",
  "game_date": "2026-09-30T18:00:00Z",
  "season": 2026,
  "game_type": "F",
  "level": "MLB",
  "status": "Final",
  "day_night": "day",
  "scheduled_innings": 9,
  "innings_played": 10,
  "venue_name": "Truist Park",
  "away_team_name": "Philadelphia Phillies",
  "away_team_abbreviation": "PHI",
  "home_team_name": "Atlanta Braves",
  "home_team_abbreviation": "ATL",
  "away_score": 4,
  "home_score": 3,
  "winner": "away",
  "away_hits": 12,
  "home_hits": 9,
  "away_errors": 0,
  "home_errors": 0,
  "linescore": [
    { "inning": 1, "away_runs": 1, "home_runs": 1 },
    { "inning": 8, "away_runs": 2, "home_runs": 0 },
    { "inning": 10, "away_runs": 1, "home_runs": 0 }
  ],
  "away_probable_pitcher": "Cristopher Sánchez",
  "home_probable_pitcher": "Tyler Mahle",
  "winning_pitcher": "Andrew Painter",
  "losing_pitcher": "Didier Fuentes",
  "weather_condition": "Partly Cloudy",
  "weather_temp_f": 83,
  "weather_wind": "4 mph, L To R",
  "series_description": "NL Wild Card Series",
  "series_game_number": 2,
  "series_status": "Series tied 1-1",
  "game_url": "https://www.mlb.com/gameday/849841"
}
```

**A `boxScores` row for a hitter** (27 Sep 2026; the full row has 75 fields)

```json
{
  "record_type": "player_game",
  "game_pk": 822679,
  "official_date": "2026-09-27",
  "venue_name": "Nationals Park",
  "team_abbreviation": "NYM",
  "opponent_abbreviation": "WSH",
  "is_home": false,
  "team_score": 4,
  "opponent_score": 6,
  "team_won": false,
  "player_id": 596019,
  "player_name": "Francisco Lindor",
  "position": "SS",
  "batting_order": 1,
  "is_starter": true,
  "batting_summary": "2-4 | HR, BB, RBI",
  "batting_plate_appearances": 5,
  "batting_at_bats": 4,
  "batting_hits": 2,
  "batting_home_runs": 1,
  "batting_rbi": 1,
  "batting_base_on_balls": 1,
  "fielding_assists": 3,
  "season_batting_avg": 0.225,
  "season_batting_ops": 0.732,
  "season_home_runs": 21
}
```

**The same game for the losing pitcher** (the full row has 86 fields)

```json
{
  "record_type": "player_game",
  "game_pk": 822679,
  "player_name": "Sean Manaea",
  "position": "P",
  "pitched": true,
  "pitching_note": "(L, 6-8)",
  "pitching_summary": "6.0 IP, 5 ER, 3 K, BB",
  "pitching_innings_pitched": "6.0",
  "pitching_hits": 7,
  "pitching_earned_runs": 5,
  "pitching_strike_outs": 3,
  "pitching_home_runs": 2,
  "pitching_number_of_pitches": 100,
  "pitching_strikes": 63,
  "season_era": 4.78,
  "season_whip": 1.3
}
```

**A `playerGameLogs` row** (trimmed)

```json
{
  "record_type": "player_game_log",
  "season": 2026,
  "stat_group": "hitting",
  "date": "2026-03-27",
  "game_pk": 823243,
  "player_id": 592450,
  "player_name": "Aaron Judge",
  "team_name": "New York Yankees",
  "opponent_name": "San Francisco Giants",
  "is_home": false,
  "is_win": true,
  "positions": ["RF"],
  "summary": "1-4 | HR, 2 K, 2 RBI",
  "plate_appearances": 4,
  "at_bats": 4,
  "hits": 1,
  "home_runs": 1,
  "rbi": 2,
  "strike_outs": 2
}
```

**A `playerSeasonStats` row** (trimmed)

```json
{
  "record_type": "player_season",
  "season": 2026,
  "stat_group": "hitting",
  "player_id": 670541,
  "player_name": "Yordan Alvarez",
  "team_name": "Houston Astros",
  "league": "AL",
  "position": "DH",
  "games_played": 158,
  "plate_appearances": 692,
  "hits": 179,
  "home_runs": 42,
  "rbi": 106,
  "avg": 0.316,
  "obp": 0.432,
  "slg": 0.601,
  "ops": 1.033,
  "babip": 0.334
}
```

**A `standings` row** (trimmed)

```json
{
  "record_type": "standing",
  "season": 2026,
  "league": "American League",
  "division": "American League East",
  "team_name": "Tampa Bay Rays",
  "wins": 98,
  "losses": 64,
  "winning_percentage": 0.605,
  "division_rank": 1,
  "run_differential": 86,
  "streak": "L1",
  "clinch_indicator": "z",
  "home_record": "55-26",
  "away_record": "43-38",
  "last_ten": "5-5",
  "one_run_record": "25-14",
  "expected_record": "90-72"
}
```

**A `rosters` row** (trimmed)

```json
{
  "record_type": "roster_player",
  "team_name": "New York Yankees",
  "player_id": 645305,
  "player_name": "Ali Sánchez",
  "jersey_number": "39",
  "position": "C",
  "bats": "R",
  "throws": "R",
  "birth_date": "1997-01-20",
  "birth_country": "Venezuela",
  "height": "6' 0\"",
  "weight_lb": 200,
  "mlb_debut_date": "2020-08-10"
}
```

**The information row at the end of a run** (box score run for 27 Sep 2026, never charged)

```json
{
  "_type": "info",
  "delivered": 426,
  "message": "426 records delivered. This row is informational: it is never billed.",
  "schedule_tip": "Want this refreshed automatically? Apify Console -> this Actor -> Schedules -> Add schedule -> pick how often (e.g. daily) -> Save. It reruns with the same input on autopilot, no code required.",
  "review_tip": "Found this useful? A quick Store review helps other buyers find it: https://apify.com/themineworks/mlb-stats-api-scraper?fpr=ymnoit&utm_source=apify-readme&utm_medium=referral#reviews",
  "scraped_at": "2026-10-01T13:47:24.161Z"
}
```

### Pricing

Pay per event: you are charged for each row saved to your dataset, plus a flat fee once per run. The row price drops as your Apify plan goes up.

| Event | Free plan | Bronze (Starter) | Silver (Scale) | Gold and above (Business) |
|---|---|---|---|---|
| `record-scraped`, per row | $0.004 | $0.0035 | $0.003 | $0.0025 |
| Per 1,000 rows | $4.00 | $3.50 | $3.00 | $2.50 |
| `run-start`, per run | $0.005 | $0.005 | $0.005 | $0.005 |

- **Start fee: a flat $0.005 per run**, charged once when the run starts, whatever memory you choose. It is our own `run-start` event, not Apify's per GB start charge, so a bigger memory setting does not raise it.
- **Never charged**: dates without games, games not yet started, postponed or cancelled games in box score runs, team or player names that match nothing, the same row found twice, rows past `maxResults`, refused calls and the information rows.
- **Included at no extra cost**: the datacenter proxies. You pay nothing for platform compute on top of these prices.
- **Spending cap**: if you set a maximum cost per run in Apify, the actor stops adding rows once that budget is used, so you never receive rows past your cap.
- **No price change is scheduled.** These prices have applied since 1 Oct 2026. The Pricing tab always shows the rate for your own plan; if this table and the Pricing tab ever disagree, the Pricing tab is right.

Worked examples on the Free plan: a day of box scores (426 rows on 27 Sep 2026) costs $1.704 plus $0.005, so $1.709; a season of MLB standings (30 rows) costs $0.125. On Gold, the same day of box scores costs $1.07.

### FAQ

**What is the MLB Stats API?**
It is the public JSON API at statsapi.mlb.com that MLB's own Gameday and stats pages read. This actor calls it and turns its nested answers into flat rows.

**Do I need an MLB API key or account?**
No. The Stats API is public and needs no key. You only need an Apify account.

**Is the data official? Does it include Statcast?**
It is the same data MLB's Gameday and stats pages show, read from MLB's own API. Statcast pitch tracking (pitch speed, spin, exit velocity) is not included.

**When is yesterday's data complete?**
With `startDate` empty the actor reads yesterday in US Eastern time, where MLB keeps its calendar, so a late West Coast game is on the right day. Box scores are read only for games that have started or finished.

**How far back does it go?**
In our 1 Oct 2026 checks, game scores for 4 Jul 1950, full box score lines for 4 Jul 1955 and the 16 team standings of 1927 all came back. Some older games list the players without their stats; those games return no box score rows and cost nothing.

**What about the minor leagues?**
Set `level` to `aaa`, `aa`, `high_a`, `single_a` or `rookie`. Coverage follows what MLB publishes: scores, box scores, standings and rosters are there, and some older seasons have fewer fields.

**What happens if a team or player name matches nothing?**
It is listed under `unmatched` in the run summary (the key-value record `OUTPUT`), a warning is logged, and it costs nothing. Use the full name (`Aaron Judge`) or the MLB id (`592450`). If a run delivers nothing at all, it ends with an information row saying why; no row is charged, but the flat $0.005 start fee still applies.

**Do I need a proxy? What if a request fails?**
No setting is needed. The actor goes through Apify datacenter proxies on its own, and that cost is included. Each request is tried up to 4 times, and nothing is charged for refused calls. In our 1 Oct 2026 box score run all 17 requests were answered on the first attempt.

**Can I run it on a schedule?**
Yes. Save your input as a task, then add a schedule in Apify Console under Schedules. With `startDate` left empty, a daily morning schedule of `boxScores` or `games` gives you each day's results without editing anything. Each scheduled run is billed like a manual one; the schedule itself costs nothing.

**Which formats can I export?**
JSON, CSV, Excel, XML, RSS or HTML from the run's Storage tab, or through the Apify API. Box score rows are already flat, one column per stat. Lists such as `linescore` are split into numbered columns in CSV and Excel.

**Can I use it from Claude, ChatGPT or another AI assistant?**
Yes. Connect Apify's MCP server at `https://mcp.apify.com/?tools=themineworks/mlb-stats-api-scraper`, for example in Claude Code with `claude mcp add --transport http apify "https://mcp.apify.com/?tools=themineworks/mlb-stats-api-scraper"`, or paste the block in "Copy to your AI assistant" above. Then ask, for example, for every pitcher with 8 or more strikeouts yesterday.

**Can I use MLB data commercially? Is it legal?**
You are responsible for following MLB's terms of use for this data. Every API answer carries MLB Advanced Media's copyright notice, which points to terms that permit only individual, non commercial, non bulk use without MLB's prior written permission. Check that your use fits, or license the data from MLB. This is general information, not legal advice.

### Integrations

- **Google Sheets**: send each run's rows to a sheet with Apify's Google Sheets integration.
- **Make, Zapier and n8n**: start a run and read the rows with the official Apify modules and nodes, for example to post last night's scores to a team chat.
- **Webhooks**: have Apify call your URL when a run finishes, then fetch the dataset.
- **API**: start runs and read results over HTTP, or with the Python and JavaScript clients.
- **MCP clients**: Claude, ChatGPT, Cursor and other MCP clients can call the actor through `https://mcp.apify.com`.

### More from The Mine Works

**More tools**

- [Tennis Match & Player Data Scraper](https://apify.com/themineworks/tennis-match-data?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google Hotels Prices Scraper](https://apify.com/themineworks/google-hotels-prices-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Social media and video**

- [Threads Scraper](https://apify.com/themineworks/threads-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Reddit Scraper](https://apify.com/themineworks/reddit-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Threads Search Scraper](https://apify.com/themineworks/threads-search-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Leads and business directories**

- [B2B Leads Finder](https://apify.com/themineworks/b2b-leads-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Skip Trace Lookup](https://apify.com/themineworks/skip-trace-lookup?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google Maps Email Scraper](https://apify.com/themineworks/maps-leads?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [JustDial Scraper](https://apify.com/themineworks/justdial-business?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Marketing, SEO and reviews**

- [Facebook Ad Library Scraper](https://apify.com/themineworks/meta-ad-library-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Similarweb Scraper](https://apify.com/themineworks/similarweb-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google Ads Transparency Scraper](https://apify.com/themineworks/google-ads-transparency?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Google News Scraper](https://apify.com/themineworks/google-news?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**LinkedIn**

- [LinkedIn Company Scraper](https://apify.com/themineworks/linkedin-company-details?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Post Scraper](https://apify.com/themineworks/linkedin-post-search?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Employees Scraper](https://apify.com/themineworks/linkedin-employees?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [LinkedIn Profile Scraper](https://apify.com/themineworks/linkedin-profile-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Real estate**

- [Zillow Rentals Scraper](https://apify.com/themineworks/zillow-rental-listings?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Zillow Sold Comps Scraper](https://apify.com/themineworks/zillow-recently-sold?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Housing.com Scraper](https://apify.com/themineworks/housing-com-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [India Real Estate MCP](https://apify.com/themineworks/india-real-estate-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Science, health and government data**

- [CourtListener Scraper](https://apify.com/themineworks/courtlistener-court-records?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [data.gov.in Scraper](https://apify.com/themineworks/india-data-gov-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Socrata Open Data Scraper](https://apify.com/themineworks/socrata-open-data?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Academic Research MCP](https://apify.com/themineworks/academic-research-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Jobs and hiring**

- [Foundit Monster India Jobs](https://apify.com/themineworks/foundit-jobs-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Hirist Jobs Scraper](https://apify.com/themineworks/hirist-jobs-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [India Jobs MCP](https://apify.com/themineworks/india-jobs-mcp?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Naukri Jobs Scraper](https://apify.com/themineworks/naukri-jobs?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**E-commerce and marketplaces**

- [Ozon.ru Scraper](https://apify.com/themineworks/ozon-product-search?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [⭐ Amazon Reviews Scraper](https://apify.com/themineworks/amazon-reviews?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Amazon Product Scraper](https://apify.com/themineworks/amazon-products?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Carsales.com.au Scraper](https://apify.com/themineworks/carsales-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Company and business data**

- [Company Domain Finder](https://apify.com/themineworks/company-domain-finder?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GST Taxpayer Lookup](https://apify.com/themineworks/gst-taxpayer-lookup?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [World Bank Trade Scraper](https://apify.com/themineworks/global-trade-data?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Company KYB Resolver](https://apify.com/themineworks/company-identity-resolver?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Food and local services**

- [NoBroker Scraper](https://apify.com/themineworks/nobroker-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Swiggy Restaurant Scraper](https://apify.com/themineworks/swiggy-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [Zomato Scraper](https://apify.com/themineworks/zomato-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

**Developer and AI tools**

- [Website to Markdown Crawler](https://apify.com/themineworks/rag-crawler?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Skill Finder](https://apify.com/themineworks/github-skill-discovery?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Repo Scraper](https://apify.com/themineworks/github-repo-intelligence?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)
- [GitHub Trending Scraper](https://apify.com/themineworks/github-trending-scraper?fpr=ymnoit\&utm_source=apify-readme\&utm_medium=referral)

### Support

Found a bug or need a field we do not return? Open an issue in the Issues tab. Want another league or data source? Email dmineworks@gmail.com.

This actor is an independent tool and is not affiliated with, endorsed by or sponsored by Major League Baseball or MLB Advanced Media. MLB and team names are trademarks of their owners.

*MLB Stats API Scraper turns MLB's official Stats API into flat rows of games, box scores, game logs, season stats, standings and rosters, for MLB and the minor leagues, from $2.50 per 1,000 rows.*

# Actor input Schema

## `dataType` (type: `string`):

One data type per run. Games and box scores use the dates below; the other types use the season.

## `startDate` (type: `string`):

First day, YYYY-MM-DD, for games and box scores. Leave empty for yesterday (US Eastern time), the latest day whose games are all finished.

## `endDate` (type: `string`):

Last day, YYYY-MM-DD. Leave empty for the start date only. Up to 366 days per run.

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

Year, for game logs, season stats, standings and rosters. Leave empty for the current season (last year in January and February).

## `level` (type: `string`):

Major League Baseball or a minor league level.

## `teams` (type: `array`):

Keep only these teams: a name (New York Yankees), nickname (Yankees), abbreviation (NYY) or MLB team id (147). For game logs, the active roster of each team is used when no players are given.

## `players` (type: `array`):

Full name (Aaron Judge) or MLB player id (592450). Required for game logs unless teams are set; a filter for box scores and season stats.

## `statGroups` (type: `array`):

For game logs and season stats. Leave empty for hitting and pitching.

## `gameTypes` (type: `array`):

Leave empty for the regular season and postseason. Season stats use the regular season when it is selected.

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

For rosters.

## `standingsType` (type: `string`):

For standings.

## `maxResults` (type: `integer`):

Stop after this many rows. A day of box scores is about 430 rows, a season of standings 30.

## Actor input object example

```json
{
  "dataType": "games",
  "startDate": "2026-09-27",
  "level": "mlb",
  "rosterType": "active",
  "standingsType": "regularSeason",
  "maxResults": 1000
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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 = {
    "dataType": "games",
    "startDate": "2026-09-27"
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/mlb-stats-api-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 = {
    "dataType": "games",
    "startDate": "2026-09-27",
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/mlb-stats-api-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 '{
  "dataType": "games",
  "startDate": "2026-09-27"
}' |
apify call themineworks/mlb-stats-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,themineworks/mlb-stats-api-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/5J4Pt2aoI59k8koxD/builds/7RcRwty7B4hjWChrr/openapi.json
