Get team season statistics from Basketball-Reference.
Scrapes a team stat table from the league season page. No API key is required.
Basketball-Reference rate-limits aggressive scraping (~20 requests/minute) –
space repeated calls with Sys.sleep().
Usage
bref_teams_stats(season = most_recent_nba_season(), table = "per_game")Arguments
- season
(integer required): Season, in 4-digit ending-year format (e.g.
2024). Defaults tomost_recent_nba_season().- table
(character optional): Which team table to return. One of
per_game(default, team per-game),totals,per_poss(per 100 poss),advanced, oropponent(opponent per-game).
Value
A hoopR_data tibble with one row per team.
Its columns are listed in return_columns
(subset(return_columns, fn == "bref_teams_stats")) and in the searchable
return columns article.
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_team_roster()
Examples
if (FALSE) { # interactive() && !nzchar(Sys.getenv("CI"))
# \donttest{
try(bref_teams_stats(season = 2024, table = "per_game"))
# }
}
