VOOZH about

URL: https://apify.com/lulzasaur/baseball-reference-scraper

โ‡ฑ Baseball Reference Scraper - Player Stats ยท Apify


๐Ÿ‘ Baseball Reference Scraper - Player Stats avatar

Baseball Reference Scraper - Player Stats

Pricing

from $10.00 / 1,000 results

Go to Apify Store

Baseball Reference Scraper - Player Stats

Scrape Baseball-Reference.com for player stats, career data, and team rosters. Extract batting, pitching, and biographical info using structured data-stat attributes and microdata.

Pricing

from $10.00 / 1,000 results

Rating

0.0

(0)

Developer

๐Ÿ‘ lulz bot

lulz bot

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

0

Monthly active users

22 days ago

Last modified

Categories

Share

Baseball Reference Scraper

Scrape MLB player statistics, career data, and team rosters from Baseball-Reference.com. Extract batting stats, pitching stats, biographical information, and full team rosters using Baseball-Reference's structured data-stat attributes and schema.org microdata.

Features

  • Player Search - Search for players by name and get links to their profile pages
  • Player Stats - Extract full career batting and pitching stats for any player
  • Team Roster - Get complete team rosters with player stats for any season
  • Structured Data - Leverages data-stat attributes and JSON-LD schema.org markup for reliable extraction
  • Biographical Info - Player name, position, bats/throws, height, weight, birth date, birth place, debut date
  • Career Totals - Includes career total rows alongside season-by-season breakdowns
  • Two-Way Players - Handles players with both batting and pitching stats (e.g., Shohei Ohtani)

Modes

Player Search (playerSearch)

Search for players by name. Returns matching player names and profile URLs.

Input:

  • query - Player name to search (e.g., "Mike Trout", "Rodriguez")
  • limit - Maximum number of results (default: 50)

Output:

{
"type":"searchResult",
"playerName":"Mike Trout",
"url":"https://www.baseball-reference.com/players/t/troutmi01.shtml",
"directMatch":true,
"query":"Mike Trout"
}

Player Stats (playerStats)

Get full career statistics for a specific player. Returns batting and/or pitching stats by season plus career totals.

Input:

  • playerUrl - Full Baseball-Reference player URL
  • season - Optional year to filter to a specific season
  • limit - Maximum number of season rows to return

Output:

{
"type":"playerStats",
"playerName":"Mike Trout",
"position":"Centerfielder",
"bats":"Right",
"throws":"Right",
"height":"6-1",
"weight":"235 lbs",
"birthDate":"1991-08-07",
"team":"Los Angeles Angels",
"battingSeasons":[
{
"season":"2012",
"team":"LAA",
"gamesPlayed":139,
"atBats":559,
"hits":182,
"homeRuns":30,
"rbi":83,
"battingAverage":".326",
"ops":".963"
}
],
"battingCareerTotals":{
"gamesPlayed":1240,
"homeRuns":378,
"battingAverage":".299"
}
}

Team Roster (teamRoster)

Get the full roster and stats for a team in a given season.

Input:

  • teamUrl - Full Baseball-Reference team page URL (e.g., https://www.baseball-reference.com/teams/LAA/2024.shtml)
  • limit - Maximum number of players to return

Output:

{
"type":"rosterPlayer",
"playerName":"Mike Trout",
"position":"CF",
"team":"Los Angeles Angels",
"season":"2024",
"gamesPlayed":29,
"homeRuns":10,
"battingAverage":".220",
"url":"https://www.baseball-reference.com/players/t/troutmi01.shtml"
}

Common Team URL Codes

TeamCodeExample URL
New York YankeesNYY/teams/NYY/2024.shtml
Los Angeles DodgersLAD/teams/LAD/2024.shtml
Los Angeles AngelsLAA/teams/LAA/2024.shtml
Boston Red SoxBOS/teams/BOS/2024.shtml
Chicago CubsCHC/teams/CHC/2024.shtml
Houston AstrosHOU/teams/HOU/2024.shtml
Atlanta BravesATL/teams/ATL/2024.shtml
San Francisco GiantsSFG/teams/SFG/2024.shtml

Batting Stats Extracted

Games (G), Plate Appearances (PA), At Bats (AB), Runs (R), Hits (H), Doubles (2B), Triples (3B), Home Runs (HR), RBI, Stolen Bases (SB), Caught Stealing (CS), Walks (BB), Strikeouts (SO), Batting Average (AVG), On-Base Percentage (OBP), Slugging Percentage (SLG), OPS, OPS+, Total Bases (TB), GDP, HBP, Sacrifice Hits, Sacrifice Flies, Intentional Walks

Pitching Stats Extracted

Wins (W), Losses (L), Win-Loss %, ERA, Games (G), Games Started (GS), Complete Games (CG), Shutouts (SHO), Saves (SV), Innings Pitched (IP), Hits Allowed, Earned Runs, Home Runs Allowed, Walks, Strikeouts, WHIP, ERA+, H/9, HR/9, BB/9, SO/9, SO/W

Proxy Configuration

Baseball-Reference may rate-limit aggressive scraping. Residential proxies are recommended for large-scale runs. The default configuration uses Apify residential proxies.

Technical Notes

  • Uses got-scraping + cheerio for fast HTML parsing (no browser needed)
  • Extracts data from data-stat attributes on table cells for reliable field mapping
  • Parses JSON-LD schema.org/Person data for biographical information
  • Handles HTML comments (Baseball-Reference hides some tables inside comments)
  • Respects rate limits with built-in delays and retry logic
  • Pay-per-event charging: billed per result returned

You might also like

MLB Baseball Stats Scraper

crawlerbros/mlb-baseball-stats-scraper

Scrape the official MLB Stats API - comprehensive baseball data including teams, player batting/pitching stats, schedules, and standings. Official MLB data source, no authentication required.

15

5.0

Baseball Reference Scraper | MLB Stats and History

parseforge/baseball-reference-scraper

Extract MLB player, team, and game data from Baseball Reference including box scores, season stats, advanced metrics, standings, and historical records dating back over a century. Built for sabermetrics, fantasy baseball, betting models, and deep sports research.

MLB Stats Scraper

parseforge/mlb-stats-scraper

Scrape Major League Baseball data from the official MLB Stats API - schedules, teams, rosters, player stats, and live game feeds. No API key required.

MLB Stats API - Baseball Data

alizarin_refrigerator-owner/mlb-stats-api

Comprehensive MLB baseball statistics including player stats, game logs, standings & historical data. Perfect for fantasy sports, betting & analytics.

ESPN Rosters & Player Stats

crawlerbros/espn-rosters-player-stats

Scrape team rosters and player career statistics from ESPN across 16 leagues and 5 sports. No account or proxy required.

11

5.0

MLB Player & Game Stats Scraper

scrapers_lat/mlb-stats-scraper

Extract MLB teams, rosters, player season stats, schedules, scores and standings from the public MLB Stats API.

NHL Stats Scraper

crawlerbros/gazelle-scraper

Scrape NHL team rosters, player profiles, and game results using TheSportsDB free API.

Bundesliga Stats Scraper

parseforge/bundesliga-stats-scraper

Pull Bundesliga player stats with rank, player, team, position, goals, assists, minutes, appearances, yellow cards, red cards, stat category, stat value, and season. Filter by stat category and season. Great for football analytics, fantasy tools, and scouting workflows.