+Baseball Reference API
Baseball-Reference stats tables, from career batting and pitching to play-by-play, as clean JSON.
Baseball-Reference has no public API. The API.SH Baseball Reference API reads its pages and returns every table as named columns and rows: a player's standard, value and advanced batting and pitching, postseason and fielding stats, batting, pitching or fielding game logs, team seasons with rosters and coaches, standings, the full season schedule with results, league-wide player stats, batting and pitching leaders, box scores with play-by-play, scores for any date, amateur draft rounds and award winners. A page route reads any other page of the site the same way.
- 14 endpoints
- from $1 / 1,000 calls
- 1,000 free credits / month
- failed calls free
GET https://api.api.sh/baseball-reference/v1/ search
What you can build with the Baseball Reference API
Player analysis
Get a player's bio and every career table, then the game log for a season, for projections, prop research or fantasy tools.
Season-wide stat pulls
Download standard, value or advanced batting and pitching for every player in a season, with team totals, in one call.
Game logs and box scores
List the games of a date or the whole season schedule, then read each box score with batting and pitching lines, top plays and the play-by-play.
Standings and team seasons
Track division standings and pull a team's season with batting, pitching, fielding and value stats for its players.
Baseball Reference data you get
Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.
Baseball Reference API endpoints and prices
Baseball Reference endpoints cost 1 to 2 credits per call: credits are $1 per 1,000 on a monthly plan, $2 pay-as-you-go. Pricing
| Baseball Reference search /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference any page /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference player page: bio and every stats table /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference award winners /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference box score /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference amateur draft round /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference season leaders /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference league player stats /baseball-reference/ | $2 · $4 PAYG 2 credits |
| Baseball Reference player game log for a season /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference season schedule and results /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference scores for a date /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference league season team stats /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference standings /baseball-reference/ | $1 · $2 PAYG 1 credit |
| Baseball Reference team season: roster and stats /baseball-reference/ | $1 · $2 PAYG 1 credit |
Call the Baseball Reference API
Baseball Reference search: GET https://api.api.sh/baseball-reference/
curl "https://api.api.sh/baseball-reference/v1/search?q=judge" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/baseball-reference/v1/search",
params={"q": "judge"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/baseball-reference/v1/search");
url.searchParams.set("q", "judge");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); # Google Sheets (API.SH add-on)
=APISH("/baseball-reference/v1/search", "q", "judge")
# Zapier, Make, n8n (verified node): pick the API.SH app,
# choose "Baseball Reference" and "Baseball Reference search".
# AI agents (Claude, ChatGPT, Cursor): add the
# API.SH MCP server https://api.sh/mcp - Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
- Create an API keyOne key works for all 921 platforms.
- Send the requestJSON back in one call. Add
output=csvoroutput=ndjsonfor files.
Why API.SH for Baseball Reference data
- Public data only: no Baseball Reference login, cookies or account needed
- One key and one response shape for Baseball Reference and 920 other platforms
- Built and maintained by API.SH, not third-party publishers
- Pay per call; errors on our side cost nothing
- No rate limits: run as many calls in parallel as you need
- Live status for every endpoint
API.SH vs the official Baseball Reference API
Baseball-Reference does not have a public API; the official MLB Stats API is a separate source run by the league. API.SH turns Baseball-Reference pages, including their historical and advanced tables, into JSON with one key.
Skip writing and fixing your own pybaseball-style scraper or paying for an Apify actor: one key returns every table with stable column keys.
Baseball Reference API questions
What Baseball Reference data can I get?+
Search (/baseball-reference/v1/search), player pages (/baseball-reference/v1/player), game logs (/baseball-reference/v1/player/gamelog), team seasons (/baseball-reference/v1/team), season team stats and standings (/baseball-reference/v1/season, /baseball-reference/v1/standings), the season schedule (/baseball-reference/v1/schedule), league player stats (/baseball-reference/v1/player-stats), leaders (/baseball-reference/v1/leaders), box scores (/baseball-reference/v1/boxscore), scores by date (/baseball-reference/v1/scores), the amateur draft (/baseball-reference/v1/draft), awards (/baseball-reference/v1/awards) and any other page (/baseball-reference/v1/page).
How much does the Baseball Reference API cost?+
Most Baseball Reference endpoints cost 1 credit per call; /baseball-reference/v1/player-stats costs 2 credits. On a monthly plan 1,000 credits cost $1 (Starter is $50/month for 50,000 credits). Pay-as-you-go is $2 per 1,000 credits, with top-ups from $15 that never expire.
Is there a free trial?+
Yes. Every account gets 1,000 free credits every month. That is 1,000 calls to /baseball-reference/v1/awards at 1 credit each.
Is there an official Baseball Reference API?+
No. Baseball-Reference publishes its data as web pages only. MLB runs its own stats API for league data; API.SH reads Baseball-Reference's public pages and returns their tables as JSON.
Do I need an account or login?+
No. Every endpoint reads public pages; no account, subscription or login is used.
Can I use it from Python or R?+
Yes. Any HTTP client works. Tables come back as column keys plus rows, ready for a pandas or R data frame.
Is there a free Baseball Reference API?+
Every API.SH account gets free monthly credits, enough to try every route. After that you pay per call, with no subscription.
How do I get started?+
1. Sign up at api.sh. 2. Copy your API key. 3. Call /baseball-reference/v1/player with a player id like ohtansh01. Request examples and every parameter are in the docs at https://api.sh/docs. You can also use the JS or Python SDK, Google Sheets, Zapier, Make, n8n or the MCP server at https://api.sh/mcp.
Does the Baseball Reference API have a rate limit?+
No. API.SH puts no rate limit on your key: send as many Baseball Reference calls in parallel as you need and pay only for the calls that run. If Baseball Reference itself slows down, the call returns 503 with a retry-after header and is not charged.