Basketball Reference Scraper avatar

Basketball Reference Scraper

Pricing

from $19.00 / 1,000 results

Go to Apify Store
Basketball Reference Scraper

Basketball Reference Scraper

Scrapes NBA player statistics from Basketball Reference for a given season and stat type. Returns per game, totals, or advanced stats as a flat dataset.

Pricing

from $19.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

0

Monthly active users

3 days ago

Last modified

Categories

Share

ParseForge

Basketball Reference Scraper

Scrape NBA player stats from Basketball Reference for any season, from per game to advanced metrics. Get points, rebounds, assists, shooting percentages, and advanced stats in a clean table. No API key or login. Export to CSV, JSON, Excel, or XML.

Basketball Reference is the go-to source for historical NBA statistics, but its data is locked in HTML tables that are tedious to copy by hand. This Actor reads the public player stats pages directly, so you can pull per game, totals, or advanced stats for any season since 1950. Each run returns a flat dataset ready for analysis, with no scraping code to maintain.

Who uses itWhat they scrape Basketball Reference for
Sports analystsCompare player performance across seasons to spot trends and outliers.
Fantasy basketball playersBuild custom rankings and projections from historical per game stats.
Data journalistsGather season stats for stories on player milestones or team performance.
ResearchersCollect advanced metrics for academic studies on basketball analytics.

What it does

This Actor collects NBA player statistics from Basketball Reference for a given season and stat type, and returns each player as a flat row with their stats.

  • 📊 Three stat types: per game, totals, and advanced stats, each with its own set of columns.
  • 📅 Any season since 1950: set the season year and get that year's stats, from the early NBA to today.
  • 🔢 Flexible volume: collect up to a million records per run, from a single star to the entire league.
  • 📤 Multiple export formats: download your data as CSV, JSON, Excel, or XML directly from the Apify platform.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with Basketball Reference data

📈 Track player performance over time.

A sports analyst runs the Actor for multiple seasons and merges the datasets to chart a player's scoring and efficiency trends.

🏆 Build fantasy basketball rankings.

A fantasy player scrapes per game stats for the latest season and uses the data to create custom rankings and draft cheat sheets.

📰 Support sports journalism.

A data journalist collects advanced stats for a story on the most underrated players, using metrics like win shares and player efficiency rating.

🎓 Conduct academic research.

A researcher scrapes totals for several decades to study the evolution of scoring and pace in the NBA.

Why choose this scraper

What you get
No API keyBasketball Reference has no official API, so this Actor scrapes the public pages directly.
Clean dataReturns a flat table with consistent column names, ready for analysis or export.
Historical depthCovers every NBA season from 1950 to the present, including defunct teams and players.
ScalableCollect up to a million records per run, enough for the entire league or multiple seasons.

How it compares

This Actor focuses on season-level player stats from Basketball Reference, while the competitor offers a broader basketball data API with box scores, standings, and schedules.

FeatureParseForgeBasketball API Scraper - Box Scores, Stats & Standings
Season player stats (per game, totals, advanced)YesNot listed
Box scores for individual gamesNot listedYes
League standingsNot listedYes
Season schedulesNot listedYes
Play-by-play dataNot listedYes

Configure the run

Drive the Actor with a season year and a stat type, and set a maximum number of records to collect. The Actor reads the corresponding Basketball Reference page and returns each player's stats as a row. The Input tab lists every parameter.

A first run with the defaults:

{
"season": 2024,
"maxItems": 20
}

A larger pull:

{
"season": 2024,
"maxItems": 200
}

Pricing

Pay-per-result: $0.021 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$2.10
1,000 results$21.00
10,000 results$210.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Basketball Reference Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to Basketball Reference through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/basketball-reference-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check that the season year is valid (between 1950 and 2030) and that the stat type is spelled correctly. Also, ensure that Basketball Reference is accessible from your location; some networks may block scraping.

Why are some stats missing or blank?

Some players may not have played enough games to have certain stats, or the stat may not be tracked for that season. This is normal and reflects the source data.

Why is the run slow?

The Actor makes a single request to Basketball Reference, so speed depends on the site's response time. If the site is slow, the run may take longer. You can reduce maxItems to limit processing, but the page is fetched in full regardless.

Why did the run fail with a timeout?

Basketball Reference may occasionally be slow or unresponsive. Try running the Actor again later, or check if the site is down. You can also increase the timeout in the Actor's settings if needed.

Can I get data for a specific team or player?

This Actor returns all players for the season. To filter by team or player, you can use the dataset filtering options in Apify or export the data and filter it in your own tools.

FAQ

QuestionAnswer
What data does this Actor return?It returns player statistics from Basketball Reference for the season and stat type you choose. Per game stats include points, rebounds, assists, steals, blocks, and shooting percentages. Totals include cumulative season stats, and advanced stats include metrics like player efficiency rating, true shooting percentage, and win shares.
Which seasons can I scrape?You can scrape any NBA season from 1950 to the current season. Set the season year in the input, and the Actor will fetch the corresponding page.
Do I need an API key or login?No. The Actor scrapes the public Basketball Reference pages directly, so no API key or authentication is required.
Can I get data for all players in a season?Yes. By default, the Actor collects all players listed on the page. You can limit the number of records with the maxItems input if you only need a sample.
What is the difference between per game, totals, and advanced stats?Per game stats are averages per game played. Totals are cumulative season totals. Advanced stats include metrics that adjust for pace and efficiency, such as player efficiency rating and win shares.
How do I export the data?After the run finishes, you can export the dataset as CSV, JSON, Excel, or XML from the Apify platform, or use the API to download it programmatically.
Is the data updated in real time?The Actor scrapes the current version of the Basketball Reference page at the time of the run. For the latest season, stats are updated after each game, so a run will reflect the most recent data available.
Can I scrape multiple seasons in one run?This Actor scrapes one season per run. To get multiple seasons, run it multiple times with different season inputs, or use Apify's scheduler to automate runs.
What if a player has missing stats?Some players may have missing values for certain stats, especially if they played few games. The Actor returns empty fields for those values, and you can handle them in your analysis.
Is this Actor affiliated with Basketball Reference?No, this is an independent scraper built by a third party. It is not affiliated with or endorsed by Sports Reference LLC.

Browse the full ParseForge collection for more scrapers.

🆘 Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Sports Reference LLC. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.