ParseForge Scrapers

Basketball Reference Scraper

parseforge/basketball-reference-scraper

SportsNews & mediaOther

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.

Run this scraper See the API call
Total users
4
Monthly active
0
Total runs
105
Bookmarked
0
Rating
Not rated yet
Last modified
12 days ago

Overview

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 it What they scrape Basketball Reference for
Sports analysts Compare player performance across seasons to spot trends and outliers.
Fantasy basketball players Build custom rankings and projections from historical per game stats.
Data journalists Gather season stats for stories on player milestones or team performance.
Researchers Collect 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 key Basketball Reference has no official API, so this Actor scrapes the public pages directly.
Clean data Returns a flat table with consistent column names, ready for analysis or export.
Historical depth Covers every NBA season from 1950 to the present, including defunct teams and players.
Scalable Collect 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.

Feature ParseForge Basketball API Scraper - Box Scores, Stats & Standings
Season player stats (per game, totals, advanced) Yes Not listed
Box scores for individual games Not listed Yes
League standings Not listed Yes
Season schedules Not listed Yes
Play-by-play data Not listed Yes

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 collected Approximate 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

Question Answer
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.

Related actors

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.

Input

FieldTypeWhat it doesDefault
season required integer Season year (e.g. 2024 for 2023-24 season) 2024
statType required string (3 options) Type of statistics to scrape per_game
maxItems integer Maximum number of records to collect per run. 20

Pricing

from $19.00 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.019 to $0.021

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~basketball-reference-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "season": 2024,
    "statType": "per_game",
    "maxItems": 3
  }'

Examples

Input that runs as-is.

input.json
{
  "season": 2024,
  "statType": "per_game",
  "maxItems": 3
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run Basketball Reference Scraper on Apify All scrapers