Docs / Stats & data

MLB Batting Stats API

MLB player stats keyed by player id, served straight from our stored stat rows. Each appearance is split into batting and pitching lines, so a hitter query returns hitting numbers without pitching noise.

Coverage

Live for MLB — the current 2026 season, refreshed daily: stored batting and pitching lines by player, keyed by player id. Batting stats are split from pitching by the presence of pitching-only fields (ERA / earned runs), so a batting view stays clean.

Endpoints

/v1/players

Find the hitter and their id.

curl "https://api.bigballsdata.com/v1/players?sport=baseball&name=judge" \
  -H "Authorization: Bearer $BBS_API_KEY"
/v1/players/{id}/stats

Stored batting (and pitching) lines for one player.

curl "https://api.bigballsdata.com/v1/players/{player_id}/stats?sport=baseball" \
  -H "Authorization: Bearer $BBS_API_KEY"
/v1/players/{id}/gamelog

Game-by-game log for one player.

curl "https://api.bigballsdata.com/v1/players/{player_id}/gamelog?sport=baseball" \
  -H "Authorization: Bearer $BBS_API_KEY"

Example response

Illustrative shape of the unified envelope. Values are examples; live fields come from the call above.

{
  "data": {
    "player_id": "…",
    "sport": "baseball",
    "batting": [ { "game_id": "…", "ab": 4, "h": 2, "hr": 1, "rbi": 3 } ],
    "pitching": []
  },
  "meta": { "source": "…", "request_id": "…" }
}

What you can build

Hitting leaderboard

Aggregate batting lines into a sortable season leaderboard.

Streak tracker

Walk a player game log to detect hitting streaks.

Fantasy baseball helper

Pull batting splits to score daily fantasy hitters.

FAQ

Are batting and pitching separated?
Yes. Each appearance is classified by the presence of pitching-only fields (ERA / earned runs), so a hitter returns only batting lines and a pitcher returns pitching lines.
How current is the data?
MLB stats cover the live 2026 season, refreshed daily and served from our stored rows (not a live upstream bridge). A game’s batting and pitching lines land within about a day of the final out.

Start pulling MLB Batting Stats

Free tier: 1,000 requests/day (2,000 with GitHub), no credit card.

Get an API key