Skip to main content

api-kenpom

An unofficial Python wrapper for kenpom.com's API.

Installation

Requires Python 3.12+. Install with uv:

uv add api-kenpom

Or with pip:

pip install api-kenpom

Usage

[!NOTE] Some endpoints only work for 2010 or later.

from kenpom import KenpomClient

client = KenpomClient(bearer_token="YOUR_API_KEY_HERE")

# Retrieve team ratings for the 2024-25 season
ratings = client.get_ratings(year=2025)

# Retrieve ratings for a single team (by team ID)
team = client.get_ratings(team_id=73)

# Retrieve ratings filtered by conference
acc = client.get_ratings(year=2025, conf="ACC")

API Reference

KenpomClient(bearer_token)

All methods return the decoded JSON response body (a list or dict).

Method Endpoint Description
get_ratings(year, team_id, conf) ratings Team efficiency ratings, SOS, tempo, and possession length. At least one of year or team_id is required.
get_ratings_archive_by_date(date, team_id, conf) archive Historical ratings as of a specific date (YYYY-MM-DD).
get_preseason_ratings_archive(year, team_id, conf) archive Preseason ratings for a given year.
get_four_factors(year, team_id, conf, conf_only) four-factors Four factors statistics for offense and defense.
get_point_distribution(year, team_id, conf, conf_only) pointdist Percentage of points from FTs, 2s, and 3s.
get_height(year, team_id, conf) height Team height, experience, bench, and continuity.
get_misc_stats(year, team_id, conf, conf_only) misc-stats Miscellaneous advanced stats (shooting %, block %, steal rate, etc.).
get_fanmatch(date) fanmatch Game predictions for a given date (YYYY-MM-DD).
get_conference_ratings(year, conf) conf-ratings Conference efficiency ratings.
get_teams(year, conf) teams Team list with conference, coach, and arena info.
get_conferences(year) conferences Conference list with short and long names.

Authentication

A KenPom API subscription is required. If subscribed, your bearer token is available at https://kenpom.com/api-documentation.php. You can find API documentation at https://kenpom.com/api-documentation.php.

Development

# Install pre-commit hooks
pre-commit install

# Install all dependencies (including dev)
uv sync --extra dev

# Run tests
uv run pytest

# Run formatting
uv run ruff format

# Run linting
uv run ruff check

Metadata

Release files for api-kenpom 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for api-kenpom 0.1.0
File Size Uploaded Provenance Actions
api_kenpom-0.1.0.tar.gz 26.9 kB Without provenance Details for api_kenpom-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for api-kenpom 0.1.0
File Interpreter ABI Platform Actions
api_kenpom-0.1.0-py3-none-any.whl Python 3 none any Details for api_kenpom-0.1.0-py3-none-any.whl

Total release size: 34.8 kB

Release files / api_kenpom-0.1.0.tar.gz

Download URL api_kenpom-0.1.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
915439680b7927085035373d8bb6139afef1894d5123e87f05940519bddd3844
BLAKE2b-256 checksum
How to use checksums
6e5d6086cf181ff93309b9594e63bfdad334e26458502843d59ca2d8dea8186a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / api_kenpom-0.1.0-py3-none-any.whl

Download URL api_kenpom-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4dcb632f9f7aa150e40806b7afbef1bf99c85d8795b2f26653a84fb399c1dc3
BLAKE2b-256 checksum
How to use checksums
61613fb82dc7f5dfb42c2c719f2b8df0c76af31e23aeea9dc8e3ccd713b0c120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for api-kenpom 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page