Skip to main content

MBB — KenPom (kenpom.com, subscription) — Other: referee–game_attributes

kenpom_referee​

GET /referee.php - one referee's game log and splits for a season. Port of hoopR kp_referee().

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

Valid URL: https://kenpom.com/referee.php?r=714294&y=2025

API ParameterPythonPatternRequiredNullableDescription
rrefereeYKenPom referee id - the r= value on an officials-table link.
yyearYSeason as a 4-digit ENDING year.

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
column_0integer
datecharacterDate in YYYY-MM-DD format.
time_etcharacterTime et.
gamecharacterGame.
locationcharacterLocation.
venuecharacterVenue name.
venue_rkcharacter
thrill_scoredoubleThrill score.

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_referee(referee=714294, year=2025)

kenpom_game_attributes​

GET /game_attrs.php - season game leaderboards by attribute (thrill score, comebacks, upsets, ...). Port of hoopR kp_game_attrs().

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

Valid URL: https://kenpom.com/game_attrs.php?y=2025&s=ThrillScore

API ParameterPythonPatternRequiredNullableDescription
yyearYSeason as a 4-digit ENDING year.
sattributeYAttribute slug, e.g. ThrillScore, Comeback, FanMatch, Upsets, Busts, MinutesPlayed, PossessionLength, LeadChanges.

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
column_0integer
datecharacterDate in YYYY-MM-DD format.
gamecharacterGame.
game_rkcharacter
locationcharacterLocation.
location_rkcharacter
valuedoubleNumeric or string value field.

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_game_attributes(year=2025, attribute='ThrillScore')