MLB Stats Scraper — Games & Boxscores
Pricing
$8.00 / 1,000 record scrapeds
MLB Stats Scraper — Games & Boxscores
Extract MLB game schedules, final scores, inning-by-inning linescores, and player batting/pitching statistics for any team and season from the official MLB Stats API. Get team names, venues, and season stats as clean JSON. Failed runs are not billed.
Pricing
$8.00 / 1,000 record scrapeds
Rating
0.0
(0)
Developer
Antony Zaikin
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
9 days ago
Last modified
Categories
Share
MLB Stats Apify Actor
Fetches MLB team statistics from the official MLB Advanced Media API (statsapi.mlb.com).
Features
- Resolves team by name, abbreviation, or numeric ID
- Retrieves schedule for a given season
- Filters for finished games (Final status)
- Optionally includes boxscore (player season statistics)
- Optionally includes linescore (inning-by-inning scoring)
- Handles API inconsistencies (406 errors) with retry logic
- Pay-per-event charging (
record-scraped)
Input
| Field | Type | Description | Default |
|---|---|---|---|
team | string | Team name, abbreviation, or numeric ID (case-insensitive) | NYY |
season | integer | MLB season year (e.g., 2026) | 2026 |
maxGames | integer | Number of most recent finished games to process (1-30) | 5 |
includeBoxscore | boolean | Fetch player statistics from boxscore endpoint | true |
includeLinescore | boolean | Fetch inning-by-inning scoring from linescore endpoint | true |
Output
Each record represents a game with the following structure:
{"kind": "game","gamePk": 824235,"date": "2026-08-24","status": "Final","homeTeam": "Detroit Tigers","awayTeam": "Tampa Bay Rays","homeScore": 0,"awayScore": 2,"venue": "Comerica Park","innings": [{"num": 1,"home": { "runs": 0, "hits": 0, "errors": 1 },"away": { "runs": 2, "hits": 3, "errors": 0 }}],"homePlayers": [{"personId": 667452,"fullName": "Corey Julks","position": "LF","batting": { "gamesPlayed": 3, "avg": ".333", ... },"pitching": { "gamesPlayed": 0, "era": "-.--", ... }}],"awayPlayers": [ ... ]}
If no finished games are found, a single schedule_empty record is pushed.
Notes
- Uses only the public MLB API (
statsapi.mlb.com) - no HTML parsing or headless browser - Handles known API quirks (406 errors) by retrying with trailing slash in URL
- Implements exponential backoff for network errors and 5xx/429 responses
- Continues processing even if individual game data fails to fetch
- Charges
record-scrapedevent for each successfully pushed record
Example
Default input (New York Yankees, 2026 season, 5 most recent games):
{}