Skip to contents

Get a team's season roster from Basketball-Reference.

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

Usage

bref_team_roster(team, season = most_recent_nba_season())

Arguments

team

(character required): Basketball-Reference team abbreviation (e.g. BOS, LAL, GSW). Historical franchises use their era code (e.g. NJN, SEA).

season

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

Value

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

Examples

if (FALSE) { # interactive() && !nzchar(Sys.getenv("CI"))
# \donttest{
  try(bref_team_roster(team = "BOS", season = 2024))
# }
}