MLB Scraper avatar

MLB Scraper

Pricing

$3.20 / 1,000 results

Go to Apify Store
MLB Scraper

MLB Scraper

Collect public baseball teams, rosters, scores, standings, player statistics, game totals, and leaders as flat records.

Pricing

$3.20 / 1,000 results

Rating

0.0

(0)

Developer

MLG Data

MLG Data

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Categories

Share

Scrape MLB teams, rosters, schedules, scores, standings, statistics, game totals, and leaders from public data. Export MLB data as flat JSON, CSV, or spreadsheet rows for research, reporting, and applications that need an MLB data API alternative without maintaining seven separate collectors.

What data can you extract from MLB?

ModeOne row representsUseful fields
teamsOne club in one seasonTeam ID, name, abbreviation, league, division, venue, first year of play
playersOne player on a club rosterPlayer ID, jersey, position, roster status, birth details, height, weight, batting and throwing side, debut date
scheduleOne gameStart time, official date, status, clubs, scores, winner, venue, series and doubleheader details
standingsOne club's season recordWins, losses, winning percentage, ranks, games back, runs scored and allowed, streak, clinch details
playerStatsOne player season statistic splitPlayer and team IDs, season, group, games played, hitting, pitching, or fielding measures
gameDetailsOne club in one gameBatting totals, pitching totals, fielding totals, opponent and game identifiers
leadersOne ranked player in one categoryStatistic category, rank, value, player, club, league

Output field reference

The table covers every field that may be emitted. Fields appear only in relevant modes. Season stat columns are taken from the selected group, so a hitting row and a pitching row have different measures. A missing field means that the source did not provide that measure for the row; a null value means the field belongs to the row but is unavailable at that point, such as a score before first pitch.

FieldDescriptionExample
abbreviationAbbreviation—
activeActive—
ageAge—
airOutsAir outs—
assistsAssists—
atBatsAt bats—
atBatsPerHomeRunAt bats per home run—
avgAvg—
awayLossesAway losses—
awayScoreAway score4
awayTeamAway teamChicago Cubs
awayTeamIdAway team id—
awayWinsAway wins—
babipBabip—
balksBalks—
baseOnBallsBase on balls—
batsBatting side code—
battersFacedBatters faced—
birthCityBirth city—
birthCountryBirth country—
birthDateBirth date—
birthStateProvinceBirth state province—
blownSavesBlown saves—
catcherERAEarned run average while catching—
catchersInterferenceCatchers interference—
categoryLeaderboard statistic categoryhomeRuns
caughtStealingCaught stealing—
caughtStealingPercentageCaught stealing percentage—
chancesChances—
clinchedClinched—
completeGamesComplete games—
dayNightDay night—
divisionDivision—
divisionIdDivision id—
divisionRankDivision rank—
doubleHeaderDoubleheader code—
doublePlaysDouble plays—
doublesDoubles—
earnedRunsEarned runs—
eliminationNumberElimination number as displayed—
eraEra—
errorsErrors—
fieldingFielding—
firstYearOfPlayFirst year of play—
gameDateScheduled game start in UTC—
gameNumberGame number—
gamePkOfficial game identifier776318
gameTypeGame type—
gamesGames—
gamesBackGames behind leader as displayed—
gamesFinishedGames finished—
gamesPitchedGames pitched—
gamesPlayedGames played—
gamesStartedGames started—
groundIntoDoublePlayGround into double play—
groundOutsGround outs—
groundOutsToAiroutsGround outs to airouts—
heightHeight—
hitBatsmenHit batsmen—
hitByPitchHit by pitch—
hitsHits—
hitsPer9InnHits per9inn—
holdsHolds—
homeLossesHome losses—
homeRunsHome runs55
homeRunsPer9Home runs per9—
homeScoreHome score0
homeTeamHome teamPittsburgh Pirates
homeTeamIdHome team id—
homeWinsHome wins—
inheritedRunnersInherited runners—
inheritedRunnersScoredInherited runners scored—
inningsInnings—
inningsPitchedInnings pitched—
intentionalWalksIntentional walks—
jerseyNumberJersey number—
leagueLeague—
leagueIdLeague id—
leagueRankLeague rank—
leftOnBaseLeft on base—
locationNameLocation name—
lossesLosses68
magicNumberDivision clinch magic number as displayed—
mlbDebutDateFirst major league game date—
numberOfPitchesNumber of pitches—
obpObp—
officialDateLocal official game date2025-09-15
opponentOpponent—
opponentIdOpponent id—
opsOps—
outsOuts—
passedBallPassed balls—
pickoffsPickoffs—
pitchesPerInningPitches per inning—
pitchingBaseOnBallsPitching base on balls—
pitchingHitsPitching hits—
pitchingInningsInnings pitched by the club in this game—
pitchingRunsPitching runs—
pitchingStrikeOutsPitching strike outs—
plateAppearancesPlate appearances—
playerPlayer full name—
playerIdPlayer id660271
positionPosition—
positionAbbreviationPosition abbreviation—
putOutsPut outs—
rangeFactorPer9InnRange factor per9inn—
rangeFactorPerGameRange factor per game—
rankRank including ties1
rbiRbi—
recordTypeType of output recordgame
rosterStatusRoster status—
runDifferentialRun differential—
runsRuns—
runsAllowedRuns allowed—
runsScoredRuns scored—
runsScoredPer9Runs scored per9—
sacBuntsSac bunts—
sacFliesSac flies—
saveOpportunitiesSave opportunities—
savesSaves—
seasonSeason year2025
seriesDescriptionSeries description—
seriesGameNumberSeries game number—
shutoutsShutouts—
slgSlg—
statGroupHitting, pitching, or fielding grouphitting
statusStatusFinal
stolenBasePercentageStolen base percentage—
stolenBasesStolen bases—
streakStreak—
strikeOutsStrike outs—
strikePercentageStrike percentage—
strikeoutWalkRatioStrikeout walk ratio—
strikeoutsPer9InnStrikeouts per9inn—
strikesStrikes—
teamClub name—
teamIdTeam id112
teamNameTeam name—
teamSideHome or away side—
throwingErrorsThrowing errors—
throwsThrowing hand code—
totalBasesTotal bases—
triplePlaysTriple plays—
triplesTriples—
urlPublic site page for this record—
valueLeaderboard value as displayed by the source60
venueIdVenue id—
venueNameVenue name—
walksPer9InnWalks per9inn—
weightWeight—
whipWhip—
wildCardGamesBackWild card games back—
wildPitchesWild pitches—
winPercentageWin percentage—
winningPercentageSeason win percentage as displayed—
winningTeamWinner once final—
winsWins94

How to scrape MLB

  1. Choose a dataset with mode. Start with teams if you need club IDs, players if you need player IDs, or schedule if you need game IDs.
  2. Select one or more seasons. For schedules and game details, optionally add a date, start date, end date, game type, or selected game IDs. A date range is the clearest way to keep a large schedule run focused.
  3. Add filters only when needed. Club IDs narrow clubs, rosters, games, standings, and leaders. Player IDs restrict player stats. A leaderboard category names the statistic to rank.
  4. Set maxItems to the largest number of rows you want returned. Run the scraper and export the dataset as JSON, CSV, or a spreadsheet file.

Input

NameTypeDefaultDescription
modestringteamsSelects one of the seven datasets.
seasonsstring arraycurrent yearOne or more season years; rows keep their season label.
seasonintegerunsetSingle season shortcut, merged with seasons.
teamIdsstring arrayall clubsRestricts clubs or matching games to these official IDs.
teamIdintegerunsetSingle club ID shortcut, merged with teamIds.
playerIdsstring arrayroster playersIn player stats mode, fetches these people directly.
playerIdintegerunsetSingle player ID shortcut, merged with playerIds.
gamePksstring arraygames from scheduleIn game details mode, fetches these games directly.
gamePkintegerunsetSingle game ID shortcut, merged with gamePks.
datestringunsetOne local official date for schedule or game details.
fromDatestringunsetBeginning of a schedule or game-details date range.
toDatestringunsetEnd of a schedule or game-details date range.
leagueIdstringbothStandings for both leagues, AL, or NL.
statGroupstringhittingHitting, pitching, or fielding in player stats and leaders.
gameTypestringRRegular season or another supported game classification.
leaderCategoriesstring arrayhomeRunsCategories to rank in leaders mode.
maxItemsinteger1000Hard cap on emitted dataset rows.

A date overrides a date range. When a date, date range, or explicit game ID is supplied in a game mode, the request is evaluated once rather than repeated for every season in seasons. All dates use YYYY-MM-DD. The gameDate value is an ISO timestamp in UTC, while officialDate is the date assigned to the game by the league; those can differ across time zones.

This example collects final scores and game details for a small, reproducible window:

{
"mode": "schedule",
"seasons": ["2025"],
"fromDate": "2025-09-15",
"toDate": "2025-09-17",
"gameType": "R",
"maxItems": 50
}

Output example

This is a real game row from the 2025-09-15 to 2025-09-17 validation run, which returned 40 rows:

{
"recordType": "game",
"season": 2025,
"gamePk": 776318,
"gameDate": "2025-09-15T22:40:00Z",
"officialDate": "2025-09-15",
"gameType": "R",
"status": "Final",
"awayTeamId": 112,
"awayTeam": "Chicago Cubs",
"awayScore": 4,
"awayWins": 86,
"awayLosses": 64,
"homeTeamId": 134,
"homeTeam": "Pittsburgh Pirates",
"homeScore": 0,
"homeWins": 65,
"homeLosses": 86,
"winningTeam": "Chicago Cubs",
"venueId": 31,
"venueName": "PNC Park",
"dayNight": "night",
"doubleHeader": "N",
"gameNumber": 1,
"seriesGameNumber": 1,
"seriesDescription": "Regular Season",
"url": "https://www.mlb.com/gameday/776318"
}

Use cases

  • Sports reporting: Refresh yesterday's scores, build a game recap queue, or compare division races without manually transcribing tables.
  • Fantasy baseball analysis: Join player season lines to roster records and leader categories. Limit by club or specific player IDs when monitoring a shortlist.
  • Historical research: Collect the same statistic across several seasons, then compare seasons using the explicit season column rather than inferring a year from file names.
  • Schedule applications: Populate game lists with UTC start times and official dates, then update scores and statuses during a season.

How much does it cost to scrape MLB?

Price: $3.20 per 1,000 returned rows ($0.0032 each). A 30-club teams run is about $0.096. A 1,000-row roster or schedule export is $3.20. A 2,430-game regular-season schedule would be about $7.78 if all rows are returned. These examples count emitted records, not source requests; a two-row game-details result costs two result events. Your maxItems setting prevents a larger dataset than intended.

Tips for best results

Choose the smallest useful scope first. A three-day schedule window is easy to inspect, while a full season can include thousands of games. For daily score refreshes, pass a single date; for backfills, pass fromDate and toDate. The scraper splits ranges into calendar-month requests, which keeps source responses manageable. It stops once maxItems or the run's result budget is reached.

For leaderboards, choose a category appropriate to the selected statGroup. A hitting category such as homeRuns belongs with hitting; a pitching category such as saves belongs with pitching. A request for a category the source does not return may yield zero rows. If you need more than the first page, raise maxItems; the scraper uses offsets and removes overlaps caused by tied ranks.

Limits

The scraper reads public data. It cannot fill facts that have not been published: scores before or during a game, missing historical splits, unavailable roster biographies, or empty stat categories. Season coverage varies by mode and statistic. Very early seasons may have fewer fields than recent ones. Current season data can change as games progress and corrections are made.

Game details fetch a box score per game and run slower than schedules. The default 1,000-row cap can truncate league-wide rosters or season schedules.

Use with automated workflows

Example instruction: “Collect the 2025 regular-season schedule for September 15 through 17, return game IDs, official dates, clubs, final scores, and winners, then sort by official date.”

Example instruction: “Collect 2025 hitting season lines for one selected club, keep player ID, player name, games played, hits, home runs, and on-base percentage, and flag rows where a measure is missing.”

FAQ

Is the data public? The scraper uses public endpoints and does not require an account. Follow the site's terms and applicable law when storing or redistributing data. Avoid using player biographical details for unrelated personal profiling.

Do I need to supply a proxy or credentials? No input credential is needed. The scraper uses its standard network path and does not require a user-provided proxy setting.

How fast is a run? Teams and standings need few source requests. Rosters and player stats require club requests; game details require one box-score request per game. Run time also depends on the row count and source responsiveness.

Can I schedule recurring collections? Yes. Reuse a saved input with a changing date or season, and monitor the resulting dataset and run status. Stable IDs make it possible to update earlier records in your own store.

Can I export to a spreadsheet? Yes. The rows are flat and can be downloaded as CSV or a spreadsheet-compatible file. A separate export per mode is easiest to analyze because each mode has different columns.

Why is a score or statistic empty? A scheduled game has no final score. Some statistics do not apply to every player or season. Check the row's status, statGroup, position, and season before interpreting an empty value.

What happens with tied leaderboard ranks? The source can return more rows than a requested page size when several players share a rank. The scraper deduplicates by player within a category while continuing through offsets until the result cap is met.

Integrations

The run input and dataset can be accessed programmatically, sent to a webhook after completion, used in scheduled jobs, or exported as CSV for spreadsheet analysis. For ongoing pipelines, store gamePk, playerId, or teamId with season so the next run can update matching records instead of relying on team or player names.

Support

Open an issue on the Issues tab; we reply within 24 hours and add fields on request. Include the mode, input, season, and a sample identifier so a missing value can be checked against the public source.