Skip to contents

Get player season statistics from Basketball-Reference.

Scrapes the league-wide player stat table for a season. No API key is required. Choose the stat table with table. Data is available back to the 1947 (BAA) season for most tables.

Basketball-Reference rate-limits aggressive scraping (~20 requests/minute) – space repeated calls with Sys.sleep().

Usage

bref_players_stats(season = most_recent_nba_season(), table = "per_game")

Arguments

season

(integer required): Season, in 4-digit ending-year format (e.g. 2024 for the 2023-24 season). Defaults to most_recent_nba_season().

table

(character optional): Which stat table to return. One of per_game (default), totals, advanced, per_minute (per 36 minutes), or per_poss (per 100 possessions).

Value

A hoopR_data tibble with one row per player. Its columns are listed in return_columns (subset(return_columns, fn == "bref_players_stats")) and in the searchable return columns article.

Examples

if (FALSE) { # interactive() && !nzchar(Sys.getenv("CI"))
# \donttest{
  try(bref_players_stats(season = 2024, table = "per_game"))
# }
}