Baseball Reference Stats Scraper avatar

Baseball Reference Stats Scraper

Pricing

from $16.00 / 1,000 player profile scrapeds

Go to Apify Store
Baseball Reference Stats Scraper

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

Muhammad Afzal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

18 days ago

Last modified

Categories

Features

Limited permissions

Share

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 groupExamples
PlayerplayerId, playerName, position, bats, throws
Row identitystatType, tableId, rowType, season, team, league, age
Battinggames, plateAppearances, atBats, hits, homeRuns, runsBattedIn, stolenBases, battingAverage, onBasePercentage, sluggingPercentage, onBasePlusSlugging, war
Pitchingwins, losses, earnedRunAverage, inningsPitched, strikeouts, war
Complete rowstats, keyed by Baseball Reference's stable data-stat attributes
ProvenancesourceUrl, 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 handles page access itself; no proxy setting is needed in run input.

Input

InputPurposeDefault
playerIdsBaseball Reference IDs such as troutmi01none (Console example troutmi01; used only when no player or URL is given)
startUrlsFull https://www.baseball-reference.com/players/... URLsnone
statTypesbatting, pitching, and/or fieldingall three
seasonsOptional four-digit season allowlistevery season
includeCareerTotalsInclude aggregate rows such as 14 Yrsfalse
maxPlayersUnique player-page cap5
maxRowsDataset-row cap500

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.867,
"war": 1.0,
"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, and lists blocked, not-found, and failed player URLs separately. Diagnostics never appear as fake player rows.

Pricing

This Actor uses pay-per-event pricing. These are the current Apify Store event prices:

EventPrice (USD)When it is charged
player-scrapedFREE: $0.02; BRONZE: $0.02; SILVER: $0.02; GOLD: $0.016; PLATINUM: $0.016; DIAMOND: $0.016Player profile scraped — One player page successfully parsed and delivered as season-stat rows.
apify-actor-start$0.005Actor Start — charged per started GB of allocated memory (one event at the default 256 MB).

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. Example on the FREE tier: one player is USD 0.02 + USD 0.005 = USD 0.025; a blocked run costs only the USD 0.005 start fee.

Reliability and limits

The Actor requests each unique player page once, two at a time and at most 15 page requests per minute, with bounded retries for temporary errors. A player page usually comes back within a few seconds and occasionally takes up to about 30 seconds, so a one-player run normally finishes within a minute and 25 players within a few minutes. If Baseball Reference refuses a page, the run ends as failed with outcome BLOCKED, returns zero fabricated rows, and applies no player-result charge. An unknown player ID is reported in notFoundUrls and is not charged. The Actor reads public player pages only; it does not log in or access Stathead or other subscriber content.

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.

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.

FAQ

Why does my run end as BLOCKED?

Baseball Reference refused the player page on every attempt. The Actor stops, writes the reason to OUTPUT, and charges no player events. Retry the run later.

What happens with a player ID that does not exist?

The page is reported in notFoundUrls in OUTPUT, no rows are written for it, and it is not charged. A run where no requested player exists ends with outcome EMPTY.

Do I need permission to use this data?

Yes. Sports Reference says tools built on scraped site data need its permission. Use the Actor only under your own permission or data license.

What do I pay for?

One player event per player page delivered as stat rows, plus the start fee. Blocked, empty and failed pages are not charged.

Does it return game logs or splits?

No. It reads the season tables on public player pages only.

Can I pass player URLs instead of IDs?

Yes. Use startUrls with https://www.baseball-reference.com/players/... URLs; the example player is then not added.

Last verified: 2026-10-31