Sports Reference Stats Scraper - NBA & NHL avatar

Sports Reference Stats Scraper - NBA & NHL

Pricing

from $21.00 / 1,000 player season records

Go to Apify Store
Sports Reference Stats Scraper - NBA & NHL

Sports Reference Stats Scraper - NBA & NHL

Scrape NBA player and team stats from Basketball-Reference and NHL stats from Hockey-Reference: per-season stats, advanced metrics, rosters and salaries. Export to CSV, JSON, Excel, or XML.

Pricing

from $21.00 / 1,000 player season records

Rating

0.0

(0)

Developer

PunkRecordsData

PunkRecordsData

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

PunkRecordsData

๐Ÿ€ Sports Reference Stats Scraper - NBA & NHL

๐Ÿš€ Get real NBA and NHL stats in seconds. Scrape per-season stats, advanced metrics, team rosters and salaries from Basketball-Reference and Hockey-Reference. Export to CSV, JSON, Excel, or XML.

The Sports Reference Stats Scraper extracts player and team statistics from Basketball-Reference.com and Hockey-Reference.com, the two most cited historical stats sources in sports analytics. Point it at any player or team page and get every season of real stats back, structured and ready to use.

Each player page returns every season of real per-game stats, advanced metrics (PER, win shares, BPM for NBA; possession and rate stats for NHL), and salary history where published. Team pages add the full roster, one row per player.

๐ŸŽฏ Target Audience๐Ÿ’ก Primary Use Cases
Sports analysts & bettorsBuild models on real historical per-season stats
Fantasy sports playersCompare advanced metrics across seasons
Sports media & bloggersPull verified stats without manual copy-paste
Data scientistsTrain models on structured NBA/NHL history

๐Ÿ“‹ What the Sports Reference Stats Scraper does

๐Ÿ’ก Why it matters: most public stats scrapers cover one stat table and call it done. This one reads per-season stats, advanced metrics, roster and salary data from the same page, across two different sports with two different stat schemas, without missing the tables that most scrapers of these sites silently drop.

Point it at a player page (e.g. /players/j/jamesle01.html) or a team-season page (e.g. /teams/BOS/2024.html), and it extracts every season row from the site's own stats tables, tagged by sport and page type.

๐Ÿ“Š Output

Each record contains (fields vary by sport and table, since NBA and NHL track different stats):

FieldDescription
sportbasketball or hockey
pageTypeplayer or team
namePlayer or team name
urlSource page URL
year_idSeason, e.g. 2003-04
(sport-specific stat fields)Every column the source table publishes for that season
scrapedAtISO timestamp of scrape

Example output (real player, real stats, 2026-09-19):

{
"sport": "basketball",
"pageType": "player",
"name": "LeBron James",
"url": "https://www.basketball-reference.com/players/j/jamesle01.html",
"year_id": "2003-04",
"age": "19",
"team_name_abbr": "CLE",
"pos": "SG",
"games": "79",
"pts_per_g": "20.9",
"ast_per_g": "5.9",
"trb_per_g": "5.5",
"awards": "MVP-9,ROY-1",
"scrapedAt": "2026-09-19T19:54:28.377Z"
}

โœจ Why choose this Actor

  • Two sports, one actor, NBA (Basketball-Reference) and NHL (Hockey-Reference), each with its own real stat schema, not a generic template forced onto both.
  • 4 real billable events, per-season stats, advanced metrics, roster and salaries, each optional. Most competitors on this niche charge one flat price for one generic row.
  • Reads the tables competitors miss, several stat tables on these sites (salaries included) are wrapped in HTML comments and only render after JavaScript runs; a scraper that doesn't account for this silently returns nothing for them.
  • Works on both player and team pages from a single input list.

๐Ÿš€ How to use

  1. Create a free Apify account at console.apify.com/sign-up, you get $5 credit monthly.
  2. Open the Sports Reference Stats Scraper in Apify Console.
  3. Add start URLs, paste player or team pages:
    • https://www.basketball-reference.com/players/j/jamesle01.html
    • https://www.hockey-reference.com/players/o/ovechal01.html
    • https://www.basketball-reference.com/teams/BOS/2024.html
  4. Set max items, how many season rows to scrape (free tier caps at 10).
  5. Toggle the extras you need, Advanced stats, Team roster, Salaries, each is billed only when enabled.
  6. Click Start, results appear in the Output tab within minutes.
  7. Download as JSON, CSV, Excel, or XML.

๐Ÿ’ผ Business use cases

Historical model building

Pull every season of a player's career in one call to train prediction or valuation models.

Advanced metrics comparison

Compare PER, win shares and BPM (NBA) or possession/rate stats (NHL) across players and seasons.

Roster and payroll research

Scrape a team-season page for the full roster, then layer salary history on top for cap and value analysis.

Content and media

Pull verified season-by-season stats for articles, graphics or fantasy sports write-ups without manual lookup.

๐Ÿ”Œ Automating Sports Reference Stats Scraper

  • Make.com / Zapier, Schedule scrapes after each season and push results to Google Sheets
  • Slack, Get notified when new season data is available
  • Airbyte, Feed stats into your data warehouse
  • GitHub Actions, Automate scrapes on a cron schedule

๐ŸŒŸ Beyond business use cases

  • Personal fantasy research, build your own player comparison sheets
  • Academic research, study performance trends across NBA/NHL history
  • Non-profit / educational, build teaching datasets from verified public stats

๐Ÿค– Ask an AI assistant about this scraper

Ask questions about how to use this scraper, what data it extracts, or how to integrate it with your workflow. The AI assistant has full context about the actor's capabilities.

โ“ Frequently Asked Questions

Which sites does this cover?

Basketball-Reference.com (NBA) and Hockey-Reference.com (NHL) only. The other three Sports Reference family sites (Baseball-Reference, Pro-Football-Reference, FBref) are behind a Cloudflare challenge and not covered by this actor.

Why do basketball and hockey records have different fields?

Each sport tracks different stats natively (field goal percentage vs. faceoff percentage, for example). This actor reads each site's own real columns rather than forcing both sports into one artificial schema.

How does pricing work?

The base player-season-record event bills per season row scraped. Enable Advanced stats, Team roster, and/or Salaries for additional data at extra per-event cost. Free users get 10 rows per run.

This actor scrapes publicly available statistics. Respect the target site's terms of service and use the data responsibly.

Can I scrape a whole team's season in one call?

Yes, paste the team-season URL (e.g. /teams/BOS/2024.html) and enable Team roster for the full player list.

What happens if I hit the free tier limit?

The actor caps output at 10 items for free users. Upgrade to a paid plan for up to 1,000,000 items.

Why are some salary/advanced rows missing on older seasons?

The source site itself doesn't publish every data point for every historical season (salaries in particular are often missing pre-1990s). The actor returns exactly what the source publishes.

Can I schedule recurring scrapes?

Yes, use Apify's Scheduler to run the actor daily, weekly, or on any cron schedule.

๐Ÿ”Œ Integrate with any app

The actor outputs JSON datasets that work with virtually any tool: Google Sheets, Airtable, Notion, databases (PostgreSQL, MongoDB), data pipelines (Airbyte, Fivetran), and more. Use the Apify API to pull data programmatically.

๐Ÿ’ก Pro Tip: browse the complete PunkRecordsData collection.

๐Ÿ†˜ Need Help? contact.punkrecordsdata@gmail.com

โš ๏ธ Disclaimer: independent tool, not affiliated with Sports Reference LLC; only publicly available data.