Discover/baseball-reference.com API
live

baseball-reference.com APIbaseball-reference.com

Access MLB player stats, team rosters, box scores, league leaders, and NCAA D1 college baseball data from Baseball-Reference via a single REST API.

Endpoints
7
Updated
11d ago
Try it
Baseball-Reference player ID (e.g., 'ohtansh01', 'troutmi01', 'jeterde01')
api.parse.bot/scraper/21934c77-6ae3-4dcd-b3f8-d736f3a15615/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/21934c77-6ae3-4dcd-b3f8-d736f3a15615/get_player_stats?player_id=ohtansh01' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 7 totalclick to expand

Get comprehensive player statistics including batting, pitching, and fielding for careers and individual seasons. Returns season-by-season rows for each stat category the player has data for.

Input
ParamTypeDescription
player_idrequiredstringBaseball-Reference player ID (e.g., 'ohtansh01', 'troutmi01', 'jeterde01')
Response
{
  "type": "object",
  "fields": {
    "name": "string — player's display name",
    "position": "string — primary position (when available)",
    "player_id": "string — the requested player ID",
    "birth_date": "string — birth date in YYYY-MM-DD format (when available)",
    "bats_throws": "string — batting/throwing hand info (when available)",
    "batting_stats": "array of season batting stat rows",
    "fielding_stats": "array of season fielding stat rows",
    "pitching_stats": "array of season pitching stat rows"
  },
  "sample": {
    "data": {
      "name": "Shohei Ohtani",
      "position": "Designated Hitter and Pitcher",
      "player_id": "ohtansh01",
      "birth_date": "1994-07-05",
      "bats_throws": "Left • Throws: Right",
      "batting_stats": [
        {
          "age": "23",
          "b_ab": "367",
          "b_hr": "22",
          "b_game": "114",
          "year_id": "2018",
          "team_name_abbr": "LAA"
        }
      ],
      "fielding_stats": [
        {
          "age": "23",
          "f_pos": "1",
          "year_id": "2018",
          "team_name_abbr": "LAA"
        }
      ],
      "pitching_stats": [
        {
          "age": "23",
          "p_g": "10",
          "p_l": "2",
          "p_w": "4",
          "year_id": "2018",
          "team_name_abbr": "LAA"
        }
      ]
    },
    "status": "success"
  }
}

About the baseball-reference.com API

This API exposes 7 endpoints covering MLB and NCAA Division I baseball data from Baseball-Reference, including career and season-level player stats, team rosters, full game box scores with play-by-play, season schedules, league leaders, and college conference rosters. The get_player_stats endpoint returns batting, pitching, and fielding rows broken out by season, while get_box_score delivers per-player lines and play-by-play for any game identified by its game ID.

Player and Team Data

The get_player_stats endpoint accepts a Baseball-Reference player_id (e.g., ohtansh01, troutmi01) and returns the player's display name, position, birth date, bats/throws info, and three separate stat arrays: batting_stats, pitching_stats, and fielding_stats, each containing season-by-season rows. The get_team_stats endpoint takes a four-digit year and a three-letter team_id (e.g., LAD, NYY) and returns the full-season roster with appearance data, plus team_batting and team_pitching arrays covering every player who appeared for that club.

Schedules and Box Scores

get_team_schedule returns a full regular-season game list for a given team and year, with each row including date, opponent, score, and a boxscore link. For individual games, get_box_score accepts a structured game_id — formatted as the three-letter home team code followed by a date string and game number (e.g., LAN202403210) — and returns per-player batting and pitching lines keyed by team table ID, plus a play_by_play array covering every play in the game.

League Leaders and College Coverage

get_league_leaders accepts a year and an optional category of batting or pitching, returning up to 10 leaders per statistical category (e.g., Home Runs, Batting Average) with rank, player name, and team. For college data, get_college_conference_teams lists all Division I teams in a conference given a league_id hash (e.g., 82d1384a for the 2025 SEC), and get_college_team_stats returns roster entries, batting rows, and pitching rows for any team whose team_id hash was discovered from that conference listing.

Common use cases
  • Build a fantasy baseball dashboard that pulls season batting and pitching splits for any player using get_player_stats.
  • Track a team's win/loss record and run differential across an entire season with get_team_schedule.
  • Reconstruct full game narratives by combining get_box_score batting lines and play-by-play entries.
  • Display MLB home run and strikeout leaders for a given year using get_league_leaders with the pitching or batting category.
  • Compare team ERA and batting average across a season roster via get_team_stats pitching and batting arrays.
  • Scout NCAA Division I prospects by pulling college team rosters and stats for any SEC or other conference team.
  • Populate a historical stats database by iterating known player IDs through get_player_stats for multi-decade career records.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does Baseball-Reference have an official developer API?+
Baseball-Reference does not currently offer a public developer API. Their data is accessible through the website at baseball-reference.com but there is no documented REST or GraphQL API for programmatic access.
What does `get_box_score` return beyond the basic score, and how do I identify a game?+
The endpoint returns a batting object and a pitching object, each keyed by team table ID with arrays of individual player lines, plus a full play_by_play array. Game IDs follow the pattern of the three-letter home team code plus date plus game number — for example, LAN202403210 for a Dodgers home game. Team schedules from get_team_schedule include boxscore links that contain the game ID.
How do I find the correct college team ID to use with `get_college_team_stats`?+
College team IDs are opaque hash strings (e.g., 0294f3dc for LSU). The intended workflow is to call get_college_conference_teams first with a known league_id — the 2025 SEC uses 82d1384a — and extract the id field from the returned teams array. League IDs for conferences outside the confirmed SEC example may require discovery.
Does the API cover minor league, international, or historical pre-MLB data?+
Not currently. The API covers MLB seasons and NCAA Division I college baseball through the endpoints above. You can fork this API on Parse and revise it to add endpoints targeting Baseball-Reference's minor league or historical coverage pages.
Are live or in-progress game scores available through this API?+
The data reflects what Baseball-Reference publishes, which is updated after games complete rather than in real time. In-progress scores and live pitch-by-pitch data are not exposed. You can fork this API on Parse and revise it to point at a source that provides live game feeds.
Page content last updated . Spec covers 7 endpoints from baseball-reference.com.
Related APIs in SportsSee all →
ncaa.com API
Access live college sports scores, game schedules, detailed boxscores, play-by-play breakdowns, and team statistics across NCAA sports. Search for specific contests and retrieve comprehensive game information for any NCAA sport, division, or team.
bet365.bet.br API
Access live betting odds, featured sports events, and real-time scores directly from bet365 Brazil's platform across multiple sports including Formula 1 and in-play markets. Get current match results, browse available betting categories, and view homepage promotions all through structured data endpoints.
nfl.com API
Access real-time NFL data including game schedules, scores, player statistics, team rosters, standings, injury reports, fantasy rankings, and the latest news — all from nfl.com.
maxpreps.com API
Access high school sports data from MaxPreps. Search for schools, retrieve team rosters and schedules, look up athlete profiles, and browse national or state rankings across all sports.
axs.com API
Search for events, performers, and venues across AXS.com to find tickets, pricing, and availability information in your area or by category. Browse featured events, explore venues by city, and access detailed event information all in one place.
pdga.com API
Access player profiles, ratings history, tournament events, live scoring, world rankings, and the course directory from the Professional Disc Golf Association.
bwfbadminton.com API
Track badminton tournaments worldwide by browsing the BWF calendar, viewing tournament draw brackets, and retrieving detailed match results with player stats and scores. Stay updated on competitions and analyze matchups with comprehensive tournament data from the Badminton World Federation.
formula1.com API
Get comprehensive Formula 1 data including race results, qualifying sessions, practice sessions, pit stops, and driver/team standings from 1950 to present. Track live race schedules, fastest laps, starting grids, and historical world champions to stay updated on all F1 season information.