Learn R Programming

hoopR (version 3.1.0)

bref_team_roster: Basketball-Reference Team Roster

Description

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())

Value

A hoopR_data tibble with one row per player on the roster:

col_nametypesdescription
numbercharacterJersey number.
playercharacterPlayer name.
poscharacterPosition.
heightcharacterHeight.
weightintegerWeight (lbs).
birth_datecharacterBirth date.
years_experiencecharacterYears of NBA experience (R for rookies).
collegecharacterCollege.
teamcharacterTeam abbreviation (echoes the team argument).
seasonintegerSeason (echoes the season argument).

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().

See Also

Other Basketball-Reference Functions: bref_awards(), bref_draft(), bref_injuries(), bref_player_bios(), bref_player_game_log(), bref_players_stats(), bref_standings(), bref_teams_stats()

Examples

Run this code
# \donttest{
  try(bref_team_roster(team = "BOS", season = 2024))
# }

Run the code above in your browser using DataLab