VOOZH about

URL: https://apify.com/crawlerbros/mlb-baseball-stats-scraper

โ‡ฑ MLB Baseball Stats Scraper ยท Apify


Pricing

from $3.00 / 1,000 results

Go to Apify Store

MLB Baseball Stats Scraper

Scrape the official MLB Stats API - comprehensive baseball data including teams, player batting/pitching stats, schedules, and standings. Official MLB data source, no authentication required.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

๐Ÿ‘ Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

0

Bookmarked

15

Total users

2

Monthly active users

23 days ago

Last modified

Share

Access comprehensive baseball data from the official MLB Stats API โ€” player batting and pitching statistics, team standings, game schedules, and team info. No authentication required. Official MLB data updated in real-time during the season.

What You Can Scrape

ModeData
getPlayerStatsSeason batting or pitching statistics for all players
getStandingsDivision standings for AL and NL
getScheduleGame schedule and results for a date range
getTeamsList all 30 MLB teams with league and division info

Input Parameters

ParameterTypeDefaultDescription
modeselectgetPlayerStatsWhat data to retrieve
statGroupselecthittingType of stats: hitting, pitching, or fielding
seasoninteger2024MLB season year (2019โ€“2024)
teamIdintegerโ€”Filter by MLB team ID (e.g. 147 = Yankees). Optional.
startDatetextโ€”Start date YYYY-MM-DD for getSchedule mode
endDatetextโ€”End date YYYY-MM-DD for getSchedule mode
maxItemsinteger50Maximum records to return (1โ€“500)

Output Fields

Player Stats (getPlayerStats)

FieldDescription
playerIdMLB player identifier
playerNamePlayer full name
teamIdTeam identifier
teamNameTeam name
positionPrimary field position
seasonSeason year
gamesPlayedGames played
atBatsAt bats
hitsHits
doublesDoubles
triplesTriples
homeRunsHome runs
rbiRuns batted in
battingAverageBatting average (e.g. ".304")
onBasePercentageOn-base percentage
sluggingPctSlugging percentage
opsOn-base plus slugging
eraEarned run average (pitchers)
winsPitcher wins
lossesPitcher losses
strikeoutsStrikeouts
mlbUrlOfficial MLB player page URL
scrapedAtTimestamp of scraping

Standings (getStandings)

FieldDescription
teamNameTeam name
divisionNameDivision name (e.g. AL East)
leagueNameAmerican League or National League
winsTotal wins
lossesTotal losses
pctWinning percentage
gamesBackGames behind division leader
divisionRankRank within division
streakCodeCurrent streak (e.g. W5, L2)
runsScoredTotal runs scored
runsAllowedTotal runs allowed
runDifferentialRun differential

Schedule (getSchedule)

FieldDescription
gamePkGame primary key
gameDateGame date/time (ISO 8601)
officialDateOfficial game date (YYYY-MM-DD)
homeTeamHome team name
awayTeamAway team name
homeScoreHome team runs scored
awayScoreAway team runs scored
statusGame status (Final, In Progress, etc.)
venueStadium name
mlbUrlOfficial MLB gameday page URL

Teams (getTeams)

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

Example Configurations

Get top 2024 batting stats (default, works for daily test):

{
"mode":"getPlayerStats",
"statGroup":"hitting",
"season":2024,
"maxItems":30
}

Get 2024 pitching leaders:

{
"mode":"getPlayerStats",
"statGroup":"pitching",
"season":2024,
"maxItems":50
}

Get Yankees 2024 batting stats:

{
"mode":"getPlayerStats",
"statGroup":"hitting",
"season":2024,
"teamId":147,
"maxItems":50
}

Get 2024 final standings:

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

Get opening week 2024 schedule:

{
"mode":"getSchedule",
"season":2024,
"startDate":"2024-03-20",
"endDate":"2024-03-27",
"maxItems":50
}

Get all 30 MLB teams:

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

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
Chicago White Sox145Seattle Mariners136
Toronto Blue Jays141Washington Nationals120

Use Cases

  • Fantasy baseball โ€” pull hitting and pitching stats for player evaluation
  • Sports analytics โ€” aggregate season stats for modeling and predictions
  • Sports dashboards โ€” build standings and stats leaderboards
  • Historical research โ€” analyze player and team performance across seasons (2019โ€“2024)
  • Data pipelines โ€” feed official MLB data into BI tools or databases

Data Source

All data comes from the official MLB Stats API โ€” the same API used by MLB.com and major sports analytics platforms. The API is completely free and requires no authentication.

FAQs

Q: How current is the data? A: Standings and schedules update in real-time during the season. Player stats may have slight delays (typically updated daily).

Q: What seasons are available? A: This scraper supports 2019โ€“2024. The MLB Stats API has historical data going back to 1876, but stat coverage varies for older seasons.

Q: How do I filter by team? A: Set teamId to the MLB team ID. For example, teamId: 147 returns only New York Yankees stats. Leave blank for all teams.

Q: What does statGroup control? A: It switches between hitting (batting stats), pitching (ERA, WHIP, wins), and fielding (errors, putouts, assists).

Q: Is there a cost to use this scraper? A: No. The MLB Stats API is free and public. This scraper requires no proxy or API credentials and runs on the Apify free plan.

Q: Can I get playoff stats? A: The getPlayerStats mode uses regular season (R) data. For playoff-specific stats, adjust the game type via the API parameters if needed in a custom setup.

You might also like

MLB Stats Scraper

crawlerbros/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.

77

5.0

MLB Stats Scraper

crawlergang/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.

2

5.0

MLB Stats Scraper

parseforge/mlb-stats-scraper

Scrape Major League Baseball data from the official MLB Stats API - schedules, teams, rosters, player stats, and live game feeds. No API key required.

MLB Stats API

gentle_cloud/mlb-stats-api

Extract baseball data from MLB official free API. Get teams, standings, game schedules/scores, and detailed player statistics for any season.

75

MLB Stats API - Baseball Data

alizarin_refrigerator-owner/mlb-stats-api

Comprehensive MLB baseball statistics including player stats, game logs, standings & historical data. Perfect for fantasy sports, betting & analytics.

MLB Player & Game Stats Scraper

scrapers_lat/mlb-stats-scraper

Extract MLB teams, rosters, player season stats, schedules, scores and standings from the public MLB Stats API.

Baseball Reference Scraper | MLB Stats and History

parseforge/baseball-reference-scraper

Extract MLB player, team, and game data from Baseball Reference including box scores, season stats, advanced metrics, standings, and historical records dating back over a century. Built for sabermetrics, fantasy baseball, betting models, and deep sports research.

MLB Search Results Scraper ๐ŸŽฏโšพ

easyapi/mlb-search-results-scraper

A powerful scraper for MLB.com video search results. Extract comprehensive video metadata including titles, descriptions, and statistics. Perfect for sports analysts, content creators, and baseball enthusiasts looking to gather MLB video content programmatically. ๐ŸŽฏโšพ