MLB Stats Scraper avatar

MLB Stats Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
MLB Stats Scraper

MLB Stats Scraper

Scrape the official MLB Stats API, comprehensive baseball data including teams, players, schedules, standings, and detailed statistics. Official MLB data source, no authentication required.

Pricing

from $3.00 / 1,000 results

Rating

5.0

(7)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

7

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Share

Access comprehensive baseball data from the official MLB Stats API — teams, players, schedules, standings, and detailed statistics. No authentication required. Official MLB data source updated in real-time during the season.

Features

  • Teams — list all 30 MLB teams with league, division, venue, and location info
  • Players — get full rosters for any team, or all active players in the league
  • Schedule — fetch game schedules by date, date range, or team
  • Standings — current division standings with win/loss records, GB, and streak info
  • Player Stats — hitting, pitching, or fielding statistics for any player by season
  • Game Details — detailed linescore, run/hit/error totals, and inning-by-inning data for any game

Input Parameters

ParameterTypeDescription
modeSelectteams, players, schedule, standings, playerStats, gameDetails
seasonIntegerMLB season year (default: current year)
teamIdIntegerMLB team ID (e.g. 147 = Yankees, 111 = Red Sox)
playerIdIntegerMLB player ID (e.g. 660271 = Juan Soto)
gamePkIntegerGame primary key (required for mode=gameDetails)
dateTextGame date as YYYY-MM-DD (mode=schedule)
fromDateTextStart date for schedule range
toDateTextEnd date for schedule range
leagueIdSelectAL, NL, or both (mode=standings)
statGroupSelecthitting, pitching, or fielding (mode=playerStats)
gameTypeSelectR (Regular), S (Spring), P (Playoffs), W (World Series), etc.
maxItemsIntegerMaximum records to return (1–10,000, default 100)

Output Fields

Teams mode

FieldDescription
teamIdMLB team identifier
nameFull team name
abbreviation2–3 letter abbreviation (e.g. NYY)
teamNameShort team name (e.g. Yankees)
locationNameCity/location name
leagueNameAmerican League or National League
divisionNameDivision name (e.g. AL East)
venueNameHome stadium name
activeWhether the team is active
mlbUrlOfficial MLB team page URL

Players mode

FieldDescription
playerIdMLB player identifier
fullNamePlayer's full name
primaryNumberJersey number
birthDateDate of birth
birthCityCity of birth
birthCountryCountry of birth
heightPlayer height
weightPlayer weight (lbs)
primaryPositionPrimary fielding position
currentTeamCurrent team name
batSideBatting side (Left/Right/Switch)
pitchHandThrowing hand
mlbUrlOfficial MLB player page URL

Schedule mode

FieldDescription
gamePkGame primary key
gameDateFull game date/time (ISO 8601)
homeTeamHome team name
awayTeamAway team name
homeScoreHome team runs scored
awayScoreAway team runs scored
statusGame status (Final, In Progress, Postponed, etc.)
venueStadium name

Standings mode

FieldDescription
teamNameTeam name
divisionNameDivision name
winsTotal wins
lossesTotal losses
pctWinning percentage
divisionRankRank within division
gamesBackGames behind division leader
streakCodeCurrent streak (e.g. W5, L2)

Player Stats mode

FieldDescription
playerIdMLB player identifier
seasonSeason year
gamesPlayedGames played
homeRunsHome runs
rbiRuns batted in
avgBatting average
obpOn-base percentage
slgSlugging percentage
opsOn-base plus slugging
eraEarned run average (pitchers)
whipWalks plus hits per inning pitched
winsPitcher wins

Example Use Cases

Get all 30 MLB teams for 2024:

{
"mode": "teams",
"season": 2024,
"maxItems": 30
}

Get New York Yankees roster:

{
"mode": "players",
"teamId": 147,
"season": 2024
}

Get July 4th 2024 schedule:

{
"mode": "schedule",
"date": "2024-07-04",
"gameType": "R"
}

Get 2024 AL East standings:

{
"mode": "standings",
"season": 2024,
"leagueId": "AL"
}

Get Juan Soto 2024 hitting stats:

{
"mode": "playerStats",
"playerId": 660271,
"season": 2024,
"statGroup": "hitting"
}

Common Team IDs

TeamIDTeamID
New York Yankees147New York Mets121
Boston Red Sox111Los Angeles Dodgers119
Chicago Cubs112San Francisco Giants137
Houston Astros117Atlanta Braves144
Los Angeles Angels108Philadelphia Phillies143

Data Source

All data is sourced from the official MLB Stats API — the same data feed used by MLB.com, the Statcast system, and major sports analytics platforms. The API is completely free and requires no authentication.

FAQs

Q: How current is the data? A: Schedule, scores, and standings update in real-time during games. Player stats may have slight delays.

Q: What seasons are available? A: Historical data goes back to 1876. Not all stats are available for very old seasons.

Q: How do I find a player's ID? A: Use mode=players to list all players. Player IDs are also visible in MLB.com profile URLs (e.g. mlb.com/player/660271).

Q: What game types are available? A: Regular Season (R), Spring Training (S), Playoffs (P), World Series (W), League Championship (L), and All-Star (A).

Q: Is there a cost to use this scraper? A: No. The official MLB Stats API is free and public. This scraper uses only standard Apify datacenter proxies (included in the free tier).

Q: Can I get historical standings? A: Yes — provide the season parameter (e.g. season: 2020) for any past season.