View source: R/bref_players_stats.R
| bref_players_stats | R Documentation |
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().
bref_players_stats(season = most_recent_nba_season(), table = "per_game")
season |
(integer required): Season, in 4-digit ending-year format
(e.g. |
table |
(character optional): Which stat table to return. One of
|
A hoopR_data tibble with one row per player (columns vary by
table; common identifying columns shown – column names are
Basketball-Reference data-stat keys):
| col_name | types | description |
| ranker | integer | Row rank. |
| player | character | Player name. |
| age | integer | Player age on Feb 1 of the season. |
| team_id | character | Team abbreviation (TOT for players on >1 team). |
| pos | character | Position. |
| g | integer | Games played. |
| gs | integer | Games started. |
| mp_per_g | numeric | Minutes (per_game table) / mp total (totals table). |
| pts_per_g | numeric | Points (scaled to the chosen table). |
| season | integer | Season (echoes the season argument). |
The advanced table adds per, ts_pct, usg_pct, ws, bpm, vorp,
etc.; totals/per_minute/per_poss return the same box categories scaled
accordingly.
Other Basketball-Reference Functions:
bref_awards(),
bref_draft(),
bref_injuries(),
bref_player_bios(),
bref_player_game_log(),
bref_standings(),
bref_team_roster(),
bref_teams_stats()
try(bref_players_stats(season = 2024, table = "per_game"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.