CodeChef stats API

Public CodeChef handle to rating, stars, contest history, and heatmap. Scraped into the shared envelope.

overview

FastAPI scraper for public CodeChef handles. Live at codechef-stats.tashif.codes. Source is tashifkhan/codechef-stats-api.

CodeTrace puts CodeChef in the competitive ring with Codeforces.

Path param is handle, not username. Canonical routes still look like /{handle}/profile. The old /profile/{handle} paths remain as deprecated aliases.

Docs map#

What it returns#

Stars / rating / division, contest history, heatmap of submissions, and an SVG card. Data comes from public CodeChef profile pages, then gets mapped into the shared envelope.

Live access#

Run it locally#

bash
cd CodeChef
uv sync
uv run python -m uvicorn main:app --reload --port 8005

python main.py does nothing. There is no __main__. Always uvicorn.

Optional knobs: CODECHEF_REQUEST_TIMEOUT, CODECHEF_RATE_LIMIT_REQUESTS, CODECHEF_CACHE_TTL_SECONDS.