MLB Stats API Scraper: Box Scores, Game Logs & Standings avatar

MLB Stats API Scraper: Box Scores, Game Logs & Standings

Pricing

from $2.50 / 1,000 mlb records

Go to Apify Store
MLB Stats API Scraper: Box Scores, Game Logs & Standings

MLB Stats API Scraper: Box Scores, Game Logs & Standings

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.

Pricing

from $2.50 / 1,000 mlb records

Rating

0.0

(0)

Developer

The Mine Works

The Mine Works

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Categories

Features

Limited permissions

Share

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

From The Mine Works, makers of Threads Scraper and B2B Leads Finder, 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

Part of The Mine Works More tools family: Tennis Match & Player Data Scraper, Google Hotels Prices Scraper.

Guide and FAQs: MLB Stats API Scraper on themineworks.com.

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.

{
"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:
dataTypeOne row isPicked by
gamesa game: score, line score by inning, hits, errors, left on base, probable, winning and losing pitchers, venue, weather, seriesdates
boxScoresa player's line in one game: batting, pitching and fielding counts, batting order, position, season to date AVG, OPS, ERA and WHIPdates
playerGameLogsa player's line in one game, for every game of a seasonseason, players or teams
playerSeasonStatsa player's season line: hitting, pitching or fieldingseason
standingsa team: wins, losses, games back, streak, run differential, home, away, last ten, one run, day, night and expected recordsseason
rostersa player on a team roster: position, bats, throws, birth date and place, height, weight, MLB debutseason
  • 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

{
"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

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

A pitcher's game by game line for a season

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

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

{
"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

{
"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

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

Final standings and the postseason

{
"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

{
"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

ParameterTypeDefaultWhat it does
dataTypestringgamesgames, boxScores, playerGameLogs, playerSeasonStats, standings or rosters. One per run.
startDatestring, YYYY-MM-DDyesterday (US Eastern)First day, for games and box scores.
endDatestring, YYYY-MM-DDthe start dateLast day. Up to 366 days per run; a longer range is cut to 366 days with a warning.
seasoninteger, 1876 to 2100current seasonYear, for game logs, season stats, standings and rosters. In January and February the default is last year.
levelstringmlbmlb, aaa (Triple-A), aa (Double-A), high_a, single_a or rookie.
teamsarray of stringsallKeep 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.
playersarray of stringsallFull name (Aaron Judge) or MLB player id (592450). Required for game logs unless teams is set; a filter for box scores and season stats.
statGroupsarrayhitting, pitchingFor game logs and season stats: hitting, pitching, fielding.
gameTypesarrayregular season and postseasonR 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.
rosterTypestringactiveFor rosters: active, 40Man, fullSeason (everyone on the roster this season) or depthChart.
standingsTypestringregularSeasonFor standings: regularSeason, wildCard or springTraining.
maxResultsinteger, 1 to 200,0001000Stop 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.

FieldOnWhat it is
record_typeevery rowgame, player_game, player_game_log, player_season, standing or roster_player
levelevery rowMLB, Triple-A and so on
seasonevery rowSeason year
source_urlevery rowThe MLB Stats API address the row came from
scraped_atevery rowWhen the row was collected, ISO 8601 in UTC
game_pkbox scoresMLB game id. With player_id, the unique key of a box score row.
official_datebox scoresGame date as MLB lists it
game_typebox scoresR, F, D, L, W and so on
team_namebox scoresThe player's team
opponent_namebox scoresThe other team
team_scorebox scoresRuns scored by the player's team
opponent_scorebox scoresRuns scored by the other team
player_idbox scoresMLB player id
player_namebox scoresPlayer's full name
positionbox scoresMain 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)

{
"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)

{
"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)

{
"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)

{
"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)

{
"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)

{
"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)

{
"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)

{
"_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.

EventFree planBronze (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

Social media and video

Leads and business directories

Marketing, SEO and reviews

LinkedIn

Real estate

Science, health and government data

Jobs and hiring

E-commerce and marketplaces

Company and business data

Food and local services

Developer and AI tools

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.