Skip to main content

MBB — KenPom (kenpom.com, subscription) — Team

kenpom_team_stats​

GET /teamstats.php - team shooting and style splits; side='o' for offense, 'd' for defense. Port of hoopR kp_teamstats().

Endpoint URL: GET https://kenpom.com/teamstats.php

Valid URL: https://kenpom.com/teamstats.php?y=2025&od=o

API ParameterPythonPatternRequiredNullableDescription
yyearYSeason as a 4-digit ENDING year.
odsideYSide of the ball: 'o' (offense, hoopR's default) or 'd' (defense).

Returns​

return_parsed=True (default) — A dict of polars DataFrames, one per HTML table on the page, keyed by the table's HTML id (a KenPom page often carries several -- team.php alone holds the schedule, roster, depth chart and lineup tables) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

ratings_table

col_nametypedescription
teamcharacterTeam-side label or team identifier.
confcharactercharacter.
3_p_pctcharacter
3_p_pct_rkcharacter
2_p_pctcharacter
2_p_pct_rkcharacter
ft_pctcharacterFree throw percentage (0-1).
ft_pct_rkcharacterFt pct rk.
blk_pctcharacterBlocks percentage (0-1 decimal).
blk_pct_rkcharacterBlk pct rk.
stl_pctcharacterSteals percentage (0-1 decimal).
stl_pct_rkcharacterStl pct rk.
nst_pctcharacter
nst_pct_rkcharacter
2_p_distcharacter
2_p_dist_rkcharacter
a_pctcharacterA percentage (0-1 decimal).
a_pct_rkcharacterA pct rk.
3_pa_pctcharacter
3_pa_pct_rkcharacter
adj_oecharacterAdjusted offensive efficiency.
adj_oe_rkcharacterAdj oe rk.
ncaa_seedintegerNcaa seed.

return_parsed=False — the raw page HTML (str).

Raises​

ExceptionDescription
RuntimeErrorNo KenPom credentials could be resolved (pass email=/password=, or set KENPOM_EMAIL/KENPOM_PW), or kenpom.com rejected them.
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

kenpom_team_stats(year=2025, side='o')

kenpom_team​

GET /team.php - a team's full season page. Returns EVERY table on it, so one call covers hoopR's kp_team_schedule(), kp_team_players() and kp_team_lineups(), which each fetch this same page separately -- plus kp_team_depth_chart(), recovered under a "depth_chart" key from an embedded script tag rather than a table (KenPom dropped the static depth-chart table; see kp_team_depth_chart()'s R source).

Endpoint URL: GET https://kenpom.com/team.php

Valid URL: https://kenpom.com/team.php?team=Duke&y=2025

API ParameterPythonPatternRequiredNullableDescription
teamteamYKenPom team name, spelled as the site does (e.g. 'Duke', 'Michigan St.').
yyearYSeason as a 4-digit ENDING year. Lineup tables begin at 2011.

Returns​

return_parsed=True (default) — A dict of polars DataFrames, one per HTML table on the page, keyed by the table's HTML id (a KenPom page often carries several -- team.php alone holds the schedule, roster, depth chart and lineup tables) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

report_table

col_nametypedescription
categorycharacterCategory label.
offensecharacter
defensecharacter
d_i_avgdouble

schedule_table

col_nametypedescription
0character
1integer
2integer
3character
4character
5integer
6character
7character
8character
9character
10character

player_table

col_nametypedescription
jerseycharacterJersey number worn by the player.
column_0_rkcharacter
htcharacterListed height.
wtdoubleListed weight (lbs).
yrcharacterYr.
gdoubleGames played.
sdoubleS.
pct_mindouble
o_rtgdoubleO rtg.
pct_possdouble
pct_shotsdouble
e_fg_pctdoubleE field goals percentage (0-1 decimal).
ts_pctdoubleTrue shooting percentage (0-1).
or_pctdoubleOr percentage (0-1 decimal).
dr_pctdoubleDr percentage (0-1 decimal).
a_ratedoubleA rate.
to_ratedoubleTo rate.
blk_pctdoubleBlocks percentage (0-1 decimal).
stl_pctdoubleSteals percentage (0-1 decimal).
fc_40double
fd_40double
ft_ratedoubleFt rate.
ftm_acharacter
pctdoubleWin percentage.
2_pm_acharacter
pct_1double
3_pm_acharacter
pct_2double

depth_chart

col_nametypedescription
player_idintegerUnique player identifier.
pct_pgdouble
pct_sgdouble
pct_sfdouble
pct_pfdouble
pct_cdouble
namecharacterDisplay name.
pct_possdouble
ftaintegerFree throw attempts.
fg2_ainteger
fg3_aintegerThree-point field goal attempts.
heightcharacterPlayer height (string e.g. '6-2' or inches).
weightintegerPlayer weight in pounds.
yearcharacter4-digit year.

return_parsed=False — the raw page HTML (str).

Raises​

ExceptionDescription
RuntimeErrorNo KenPom credentials could be resolved (pass email=/password=, or set KENPOM_EMAIL/KENPOM_PW), or kenpom.com rejected them.
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

kenpom_team(team='Duke', year=2025)

kenpom_team_players_expanded​

GET /player-expanded.php - a team's expanded per-player table plus the minutes matrix. Covers hoopR's kp_team_player_stats() and kp_minutes_matrix() in one fetch.

Endpoint URL: GET https://kenpom.com/player-expanded.php

Valid URL: https://kenpom.com/player-expanded.php?team=Duke&y=2025

API ParameterPythonPatternRequiredNullableDescription
teamteamYKenPom team name, spelled as the site does.
yyearYSeason as a 4-digit ENDING year. Starts ('S') are available from 2014.

Returns​

return_parsed=True (default) — A dict of polars DataFrames, one per HTML table on the page, keyed by the table's HTML id (a KenPom page often carries several -- team.php alone holds the schedule, roster, depth chart and lineup tables) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

player_table

col_nametypedescription
jerseycharacterJersey number worn by the player.
column_0_rkcharacter
htcharacterListed height.
wtdoubleListed weight (lbs).
yrcharacterYr.
gdoubleGames played.
pct_mindouble
o_rtgcharacterO rtg.
pct_posscharacter
pct_shotscharacter
e_fg_pctcharacterE field goals percentage (0-1 decimal).
ts_pctcharacterTrue shooting percentage (0-1).
or_pctdoubleOr percentage (0-1 decimal).
dr_pctcharacterDr percentage (0-1 decimal).
a_ratecharacterA rate.
to_ratedoubleTo rate.
blk_pctcharacterBlocks percentage (0-1 decimal).
stl_pctcharacterSteals percentage (0-1 decimal).
fc_40double
fd_40character
ft_ratecharacterFt rate.
ftm_acharacter
pctcharacterWin percentage.
2_pm_acharacter
pct_1double
3_pm_acharacter
pct_2character

player_table_2

col_nametypedescription
jerseycharacterJersey number worn by the player.
column_0_rkcharacter
htcharacterListed height.
wtdoubleListed weight (lbs).
yrcharacterYr.
gdoubleGames played.
pct_mincharacter
o_rtgcharacterO rtg.
pct_posscharacter
pct_shotscharacter
e_fg_pctcharacterE field goals percentage (0-1 decimal).
ts_pctcharacterTrue shooting percentage (0-1).
or_pctdoubleOr percentage (0-1 decimal).
dr_pctcharacterDr percentage (0-1 decimal).
a_ratecharacterA rate.
to_ratedoubleTo rate.
blk_pctcharacterBlocks percentage (0-1 decimal).
stl_pctcharacterSteals percentage (0-1 decimal).
fc_40double
fd_40character
ft_ratecharacterFt rate.
ftm_acharacter
pctcharacterWin percentage.
2_pm_acharacter
pct_1character
3_pm_acharacter
pct_2character

minutes_table

col_nametypedescription
column_0character
column_0_rkinteger
column_0_rk_rkcharacter
column_0_rk_rk_rkcharacter
caleb_fosterinteger
darren_harrisdouble
isaiah_evansdouble
mason_gillisinteger
sion_jamesinteger
tyrese_proctorinteger
kon_knueppelinteger
cooper_flagginteger
maliq_browninteger
patrick_ngongbadouble
khaman_maluachinteger
starting_lineup_numberinteger

return_parsed=False — the raw page HTML (str).

Raises​

ExceptionDescription
RuntimeErrorNo KenPom credentials could be resolved (pass email=/password=, or set KENPOM_EMAIL/KENPOM_PW), or kenpom.com rejected them.
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

kenpom_team_players_expanded(team='Duke', year=2025)

kenpom_team_history​

GET /history.php?t= - a program's season-by-season history. Port of hoopR kp_team_history().

Endpoint URL: GET https://kenpom.com/history.php

Valid URL: https://kenpom.com/history.php?t=Duke

API ParameterPythonPatternRequiredNullableDescription
tteamYKenPom team name, spelled as the site does.

Returns​

return_parsed=True (default) — A dict of polars DataFrames, one per HTML table on the page, keyed by the table's HTML id (a KenPom page often carries several -- team.php alone holds the schedule, roster, depth chart and lineup tables) (one table per documented key below); pass return_as_pandas=True for a dict of pandas.DataFrames (same keys).

player_table

col_nametypedescription
column_0integer
pre_rkcharacter
coachcharacterCoach.
confcharactercharacter.
w_lcharacterW l.
adj_tdoubleAdj t.
adj_odoubleAdj o.
adj_ddoubleAdj d.
offense_e_fg_pctdouble
offense_to_pctdouble
offense_or_pctdouble
offense_ftrdouble
offense_2_p_pctdouble
offense_3_p_pctdouble
offense_ft_pctdouble
offense_3_pa_pctdouble
offense_a_pctdouble
offense_apldouble
defense_e_fg_pctdouble
defense_to_pctdouble
defense_or_pctdouble
defense_ftrdouble
defense_2_p_pctdouble
defense_3_p_pctdouble
defense_blk_pctdouble
defense_3_pa_pctdouble
defense_a_pctdouble
defense_apldouble
2_fp_pctdouble

return_parsed=False — the raw page HTML (str).

Raises​

ExceptionDescription
RuntimeErrorNo KenPom credentials could be resolved (pass email=/password=, or set KENPOM_EMAIL/KENPOM_PW), or kenpom.com rejected them.
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

kenpom_team_history(team='Duke')