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#
- Overview
- Dashboard
- Canonical endpoints
- Envelope and schemas
- Platform notes
- Architecture
- HTML scrape
- Request path
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#
- Site: codechef-stats.tashif.codes
- Dashboard: dashboard
- Playground: playground
- OpenAPI: docs
- Sample JSON: tourist/profile
- Repo: tashifkhan/codechef-stats-api
Run it locally#
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.