Basketball Reference Scraper - NBA Player Stats avatar

Basketball Reference Scraper - NBA Player Stats

Pricing

from $5.00 / 1,000 results

Go to Apify Store
Basketball Reference Scraper - NBA Player Stats

Basketball Reference Scraper - NBA Player Stats

Scrape Basketball-Reference.com for NBA/ABA player stats. Index mode gets 5,400+ players with bio data. Detailed mode adds full career per-game stats, advanced stats, and playoff stats.

Pricing

from $5.00 / 1,000 results

Rating

0.0

(0)

Developer

lulz bot

lulz bot

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

3 days ago

Last modified

Categories

Share

Basketball Reference Scraper

Scrape NBA and ABA player statistics from Basketball-Reference.com. Extract player bios, per-game stats, advanced metrics, and playoff data for all 5,400+ players in the database.

Features

  • Index Mode - Quickly scrape all 5,400+ players with name, position, height, weight, birth date, college, and years active
  • Detailed Mode - Fetch full career stats for each player including per-game averages, advanced metrics, and playoff stats
  • Letter Filter - Scrape just one letter (a-z) to limit scope
  • Hall of Fame Flag - Automatically identifies Hall of Fame inductees
  • Structured Data - Uses data-stat attributes and JSON-LD schema.org markup for reliable extraction
  • Rate-Limit Safe - Built-in 3-second delays between requests to respect Cloudflare limits

Scrape Modes

Index Mode (index)

Scrapes the player index pages (/players/a/ through /players/z/) for basic biographical data. Fast — only 25 HTTP requests for all letters.

Output:

{
"name": "LeBron James",
"position": "F",
"height": "6-9",
"weight": "250",
"birthDate": "December 30, 1984",
"college": "",
"yearFrom": 2004,
"yearTo": 2025,
"yearsActive": "2004-2025",
"hallOfFame": false,
"url": "https://www.basketball-reference.com/players/j/jamesle01.html"
}

Detailed Mode (detailed)

After scraping the index, follows each player URL to extract full career stats. Includes per-game averages, advanced metrics, and playoff data. Much slower — one request per player with 3-second delays.

Output:

{
"name": "LeBron James",
"position": "F",
"height": "6-9",
"weight": "250 lbs",
"birthDate": "December 30, 1984",
"college": "St. Vincent-St. Mary (OH)",
"yearsActive": "2004-2025",
"hallOfFame": false,
"fullName": "LeBron Raymone James",
"birthPlace": "Akron, Ohio",
"shoots": "Right",
"draft": "Cleveland Cavaliers, 1st round (1st pick, 1st overall), 2003 NBA Draft",
"careerGames": 1492,
"careerPPG": 27.1,
"careerRPG": 7.5,
"careerAPG": 7.4,
"careerSPG": 1.5,
"careerBPG": 0.8,
"careerFGPct": 0.505,
"careerFG3Pct": 0.346,
"careerFTPct": 0.735,
"careerPER": 27.1,
"careerWS": 247.3,
"careerBPM": 8.9,
"careerVORP": 145.6,
"perGameStats": [
{
"season": "2003-04",
"age": 19,
"team": "CLE",
"league": "NBA",
"games": 79,
"minutesPerGame": 39.5,
"ptsPerGame": 20.9,
"rebPerGame": 5.5,
"astPerGame": 5.9,
"fgPct": 0.417,
"fg3Pct": 0.29
}
],
"advancedStats": [
{
"season": "2003-04",
"per": 18.3,
"ws": 5.1,
"bpm": 3.0,
"vorp": 4.5
}
],
"playoffPerGameStats": [
{
"season": "2005-06",
"team": "CLE",
"games": 13,
"ptsPerGame": 30.8,
"rebPerGame": 8.1,
"astPerGame": 5.8
}
],
"url": "https://www.basketball-reference.com/players/j/jamesle01.html"
}

Input Parameters

ParameterTypeDefaultDescription
scrapeTypeselectindexindex for bios only, detailed for full career stats
lettertext(empty)Single letter a-z to filter by last name initial
maxResultsinteger500Maximum number of players to return (1-10,000)
proxyConfigurationobjectResidentialProxy settings for avoiding rate limits

Per-Game Stats Extracted

Games (G), Games Started (GS), Minutes (MPG), Field Goals (FG, FGA, FG%), 3-Pointers (3P, 3PA, 3P%), 2-Pointers (2P, 2PA, 2P%), Effective FG%, Free Throws (FT, FTA, FT%), Offensive Rebounds (ORB), Defensive Rebounds (DRB), Total Rebounds (TRB), Assists (AST), Steals (STL), Blocks (BLK), Turnovers (TOV), Personal Fouls (PF), Points (PTS)

Advanced Stats Extracted

Player Efficiency Rating (PER), True Shooting % (TS%), 3-Point Attempt Rate, Free Throw Rate, Offensive/Defensive/Total Rebound %, Assist %, Steal %, Block %, Turnover %, Usage %, Offensive/Defensive Win Shares (OWS, DWS, WS), Win Shares per 48 (WS/48), Offensive/Defensive Box Plus-Minus (OBPM, DBPM, BPM), Value Over Replacement Player (VORP)

Example Use Cases

  • Fantasy Basketball - Get per-game averages for all active players
  • Historical Analysis - Compare career stats across eras
  • Draft Research - Analyze player development year-over-year
  • Hall of Fame Prediction - Use advanced metrics to project HOF candidates
  • College Pipeline - Find which colleges produce the most NBA players

Proxy Configuration

Basketball-Reference uses Cloudflare and may rate-limit at ~20 requests per minute. The scraper has built-in 3-second delays between requests. Residential proxies are recommended for detailed mode runs with many players.

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 (Basketball-Reference hides some stat tables inside comments)
  • Rate-limited to ~20 req/min with 3-second delays between requests
  • Pay-per-event charging: billed per result returned