Skip to contents

Get NBA draft teams from the CollegeBasketballData API.

Get NBA draft positions from the CollegeBasketballData API.

Get NBA draft picks from the CollegeBasketballData API.

Usage

cbbd_draft_teams()

cbbd_draft_positions()

cbbd_draft_picks(
  year = NULL,
  draft_team = NULL,
  source_team = NULL,
  position = NULL
)

Arguments

year

(integer optional): Draft year (e.g. 2024).

draft_team

(character optional): NBA team filter.

source_team

(character optional): College team filter.

position

(character optional): Position filter.

Value

A hoopR_data tibble with one row per NBA team:

col_nametypesdescription
idintegerNBA team id.
source_idcharacterSource (ESPN) team id.
locationcharacterTeam location (city).
namecharacterTeam name.
display_namecharacterFull team display name.
abbreviationcharacterTeam abbreviation.

A hoopR_data tibble with one row per draft position:

col_nametypesdescription
namecharacterPosition name.
abbreviationcharacterPosition abbreviation.

A hoopR_data tibble with one row per draft pick:

col_nametypesdescription
athlete_idintegerAthlete id.
source_team_idintegerCollege team id.
source_team_locationcharacterCollege team location.
source_team_namecharacterCollege team name.
source_team_league_affiliationcharacterCollege team league affiliation.
source_team_college_idnumericCollege id.
draft_team_idnumericNBA team id.
draft_teamcharacterNBA team name.
yearintegerDraft year.
overallintegerOverall pick number.
roundintegerDraft round.
pickintegerPick number within the round.
namecharacterPlayer name.
overall_rankintegerPre-draft overall rank.
position_rankintegerPre-draft position rank.
heightnumericPlayer height.
weightintegerPlayer weight (lbs).

Examples

# \donttest{
  try(cbbd_draft_teams())
#>  2026-08-27 17:46:32.845061: Invalid arguments or no draft teams available!
#>  Error: api.collegebasketballdata.com requires an API key.        See ?register_cbbd for details.
#> data frame with 0 columns and 0 rows
# }
# \donttest{
  try(cbbd_draft_positions())
#>  2026-08-27 17:46:32.863037: Invalid arguments or no draft positions available!
#>  Error: api.collegebasketballdata.com requires an API key.        See ?register_cbbd for details.
#> data frame with 0 columns and 0 rows
# }
# \donttest{
  try(cbbd_draft_picks(year = 2024))
#>  2026-08-27 17:46:32.872229: Invalid arguments or no draft picks available!
#>  Args: year = 2024, draft_team = NULL, source_team = NULL, position = NULL
#>  Error: api.collegebasketballdata.com requires an API key.        See ?register_cbbd for details.
#> data frame with 0 columns and 0 rows
# }