Skip to contents

Get Division-I statistical trends

Get officials rankings

Get referee game log

Get Home Court Advantage Estimates

Get Home Court Arenas

Get Game Attributes

Get FanMatch by date

Usage

kp_trends()

kp_officials(year = most_recent_mbb_season())

kp_referee(referee, year)

kp_hca()

kp_arenas(year = most_recent_mbb_season())

kp_game_attrs(year = most_recent_mbb_season(), attr = "Excitement")

kp_fanmatch(date)

Arguments

year

Year of data to pull

referee

Referee ID

attr

Game Attribute, valid values include:
'Excitement', 'Tension','Dominance','MinWp','FanMatch',
'Upsets','Busts','Comeback','Window'

date

Date of games to pull (YYYY-MM-DD)

Value

A data frame with the following columns:

col_nametypesdescription
seasonnumericSeason identifier (4-digit year or 'YYYY-YY' string).
efficiencynumericEfficiency.
temponumericTempo.
e_fg_pctnumericE field goals percentage (0-1 decimal).
to_pctnumericTo percentage (0-1 decimal).
or_pctnumericOr percentage (0-1 decimal).
ft_ratenumericFt rate.
fg_2_pctnumericField goals 2 percentage (0-1 decimal).
fg_3_pctnumericField goals 3 percentage (0-1 decimal).
fg_3a_pctnumericField goals 3a percentage (0-1 decimal).
ft_pctnumericFree throw percentage (0-1).
a_pctnumericA percentage (0-1 decimal).
blk_pctnumericBlocks percentage (0-1 decimal).
stl_pctnumericSteals percentage (0-1 decimal).
non_stl_pctnumericNon steals percentage (0-1 decimal).
avg_hgtnumericAvg hgt.
continuitynumericContinuity.
home_win_pctnumericHome win percentage (0-1 decimal).
ppgnumericPoints per game.

A data frame with the following columns:

col_nametypesdescription
rkintegerRk.
official_namecharacterOfficial name.
ref_ratingnumericRef rating.
gmsnumericGms.
last_gamecharacterLast game date or score string.
last_game_1characterLast game 1.
yearnumeric4-digit year.

A data frame with the following columns:

col_nametypesdescription
game_numberintegerGame number.
datecharacterDate in YYYY-MM-DD format.
time_etcharacterTime et.
gamecharacterGame.
locationcharacterLocation.
venuecharacterVenue name.
conferencecharacterConference.
thrill_scorenumericThrill score.
referee_namecharacterReferee name.
ref_ranknumericLeague/season rank for ref.
yearnumeric4-digit year.

A data frame with the following columns:

col_nametypesdescription
teamcharacterTeam-side label or team identifier.
confcharactercharacter.
hcanumericHca.
hca_rknumericHca rk.
pfnumericPersonal fouls.
pf_rknumericPf rk.
ptsnumericPoints scored.
pts_rknumericPts rk.
nstnumericNst.
nst_rknumericNst rk.
blknumericBlocks.
blk_rknumericBlk rk.
elevnumericElev.
elev_rknumericElev rk.

A data frame with the following columns:

col_nametypesdescription
rknumericRk.
teamcharacterTeam-side label or team identifier.
confcharactercharacter.
arenacharacterArena.
alternatecharacterAlternate.
yearnumeric4-digit year.

Returns a tibble with game attributes

col_nametypesdescription
rkintegerRk.
datacharacterData.
gamecharacterGame.
locationcharacterLocation.
confcharactercharacter.
excitementnumericExcitement.
yearnumeric4-digit year.

A data frame with the following columns:

col_nametypesdescription
predictioncharacterPrediction.
time_etcharacterTime et.
locationcharacterLocation.
thrill_scorenumericThrill score.
comebacknumericComeback.
excitementnumericExcitement.
road_rknumericRoad rk.
road_teamcharacterRoad team.
home_rknumericHome team's rk.
home_teamcharacterHome team's team.
win_rknumericWin rk.
win_teamcharacterWin team.
win_scorenumericWin score.
loss_rknumericLoss rk.
loss_teamcharacterLoss team.
loss_scorenumericLoss score.
possnumericPoss.
mvpcharacterMvp.
eventcharacterEvent.
datecharacterDate in YYYY-MM-DD format.

Examples

# \donttest{
try(kp_trends())
#>  2026-08-27 17:48:16.779293: Invalid arguments or no trends data available!
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_officials(year = 2021))
#>  2026-08-27 17:48:16.823012: Invalid arguments or no officials data for 2021 available!
#>  Args: year = 2021
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_referee(referee = 714363, year = 2021))
#>  2026-08-27 17:48:16.867684: Invalid arguments or no referee data for 714363 in 2021 available!
#>  Args: referee = 714363, year = 2021
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_hca())
#>  2026-08-27 17:48:17.277566: Invalid arguments or no home court advantage data available!
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_arenas(year = 2021))
#>  2026-08-27 17:48:17.318299: Invalid arguments or no arenas data available!
#>  Args: year = 2021
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_game_attrs(year = 2021, attr = "Excitement"))
#>  2026-08-27 17:48:17.362843: Invalid arguments or no game attributes data for Excitement available!
#>  Args: year = 2021, attr = "Excitement"
#>  Error: HTTP 403 Forbidden.
#> NULL
# }
# \donttest{
try(kp_fanmatch(date = "2022-02-22"))
#>  2026-08-27 17:48:17.414343: Invalid arguments or no Fan Match data for 2022-02-22 available!
#>  Args: date = "2022-02-22"
#>  Error: HTTP 403 Forbidden.
#> NULL
# }