Baseball Reference Stats Scraper
Pricing
from $16.00 / 1,000 player profile scrapeds
Baseball Reference Stats Scraper
Extract authorized Baseball Reference player batting, pitching, fielding, WAR, team, season, and career-total statistics for sports research and analytics.
Pricing
from $16.00 / 1,000 player profile scrapeds
Rating
0.0
(0)
Developer
Muhammad Afzal
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
Free-plan limit: Apify free-plan runs can return at most 5 dataset records per run from this Actor, even if you request more.
Extract authorized Baseball Reference player batting, pitching, and fielding statistics into analysis-ready JSON, CSV, Excel, or API records. Each dataset item represents one player-season table row and includes both normalized headline fields and every source data-stat value.
Authorization required: Sports Reference states that tools based on scraped site data require permission. Use this Actor only under your written permission or data license and follow the request limits attached to that authorization.
What it extracts
| Field group | Examples |
|---|---|
| Player | playerId, playerName, position, bats, throws |
| Row identity | statType, tableId, rowType, season, team, league, age |
| Batting | games, plateAppearances, atBats, hits, homeRuns, runsBattedIn, stolenBases, battingAverage, onBasePercentage, sluggingPercentage, onBasePlusSlugging, war |
| Pitching | wins, losses, earnedRunAverage, inningsPitched, strikeouts, war |
| Complete row | stats, keyed by Baseball Reference's stable data-stat attributes |
| Provenance | sourceUrl, scrapedAt |
Use it for authorized sports research, historical player analysis, fantasy-baseball pipelines, and spreadsheet exports. It accepts public Baseball Reference player pages only. It does not scrape Stathead, search results, team pages, league registers, game logs, splits, projections, or authenticated content.
The Actor uses the owner's DataImpulse proxy through the DATAIMPULSE_PROXY_URL secret. No proxy setting is required in run input.
Input
| Input | Purpose | Default |
|---|---|---|
playerIds | Baseball Reference IDs such as troutmi01 | ['troutmi01'] |
startUrls | Full https://www.baseball-reference.com/players/... URLs | none |
statTypes | batting, pitching, and/or fielding | all three |
seasons | Optional four-digit season allowlist | every season |
includeCareerTotals | Include aggregate rows such as 14 Yrs | false |
maxPlayers | Unique player-page cap | 5 |
maxRows | Dataset-row cap | 500 |
Example:
{"playerIds": ["troutmi01", "ohtansh01"],"statTypes": ["batting", "pitching"],"seasons": [2023, 2024],"includeCareerTotals": false,"maxPlayers": 2,"maxRows": 100}
API call:
curl -X POST "https://api.apify.com/v2/acts/muhammadafzal~baseball-reference-stats-scraper/runs?token=YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{"playerIds":["troutmi01"],"statTypes":["batting"],"maxPlayers":1}'
Output
{"playerId": "troutmi01","playerName": "Mike Trout","statType": "batting","tableId": "players_standard_batting","rowType": "season","season": 2024,"age": 32,"team": "LAA","league": "AL","games": 29,"plateAppearances": 126,"atBats": 109,"hits": 24,"homeRuns": 10,"runsBattedIn": 14,"stolenBases": 6,"battingAverage": 0.22,"onBasePercentage": 0.325,"sluggingPercentage": 0.541,"onBasePlusSlugging": 0.866,"war": 0.9,"stats": {"year_ID": 2024,"team_name_abbr": "LAA","HR": 10,"batting_avg": 0.22},"sourceUrl": "https://www.baseball-reference.com/players/t/troutmi01.shtml","scrapedAt": "2026-08-29T12:00:00.000Z"}
The OUTPUT key-value-store record distinguishes SUCCEEDED, SUCCEEDED_WITH_WARNINGS, EMPTY, BLOCKED, INVALID_INPUT, and FAILED. Diagnostics never appear as fake player rows.
Pricing
This Actor uses pay-per-event pricing. These are the current Apify Store event prices:
| Event | Price (USD) | When it is charged |
|---|---|---|
player-scraped | FREE: $0.02; BRONZE: $0.02; SILVER: $0.02; GOLD: $0.016; PLATINUM: $0.016; DIAMOND: $0.016 | Player profile scraped — One player page successfully parsed and delivered as season-stat rows. |
apify-actor-start | $0.005 | Actor Start — Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). — Charged once per run. |
Apify platform usage for this Actor run is included alongside the event prices above; no separate per-run platform-usage fee is passed to users.
This covers Apify platform usage for this Actor run. Other Apify products or usage outside this Actor run may still follow your account plan.
Reliability and limits
The scraper uses one consistent browser session, no more than eight page requests per minute, bounded retries, canonical URL deduplication, and a US residential proxy by default. Plain HTTP currently receives a managed access challenge. If a permitted browser session is still challenged, the Actor reports BLOCKED, returns zero fabricated rows, and applies no player-result charge. It does not solve CAPTCHAs or bypass authenticated access controls.
Tables legitimately absent from a player page are warnings, not fabricated empty records. Use statTypes to request only tables relevant to the player. maxRows can stop a run after a partial but valid dataset.
Legal and compliance
You are responsible for ensuring that your Sports Reference permission or license covers automated collection, storage, and downstream use. Do not use the output to violate privacy, intellectual-property, database, contract, or applicable sports-betting laws. The Actor is not affiliated with Sports Reference LLC or Major League Baseball and does not include third-party branding.
For support, include the Apify run ID, selected player IDs, expected table, and redacted OUTPUT record. Never post authentication tokens or proxy URLs.
Use cases
- Schedule repeatable collection and export results to downstream workflows.
- Run a one-off research job and export the structured result as JSON, CSV, Excel, XML, or RSS from Apify.
- Schedule the same input to monitor changes over time and send completed datasets to a webhook or integration.
- Feed schema-shaped records into a database, spreadsheet, BI tool, or AI workflow with the source URL retained for verification.