CodeChef APIcodechef.com ↗
Access CodeChef problem lists, contest schedules, user profiles, rating history, and submission data via a structured REST API with 6 endpoints.
What is the CodeChef API?
The CodeChef API provides 6 endpoints covering competitive programming data from codechef.com, including problem metadata, contest schedules, and user profiles. The get_problems_list endpoint returns filterable problem records with difficulty ratings and submission counts, while get_user_info exposes full rating history across contest types. Together the endpoints cover the core public data a developer needs to build contest trackers, leaderboard tools, or problem recommendation systems.
curl -X GET 'https://api.parse.bot/scraper/6aa4e6fb-1d6a-4c05-aeaf-d2996e380e80/get_problems_list?page=0&limit=5&sort_by=difficulty_rating&category=rated&end_rating=10000&sort_order=asc&start_rating=-1' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace codechef-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: CodeChef SDK — discover problems, explore contests, track users."""
from parse_apis.codechef_api import CodeChef, Sort, Direction, ResourceNotFound
client = CodeChef()
# List beginner problems sorted by difficulty ascending
for problem in client.problemsummaries.list(sort_by=Sort.DIFFICULTY_RATING, sort_order=Direction.ASC, start_rating=0, end_rating=1000, limit=5):
print(problem.name, problem.code, problem.successful_submissions)
# Drill into one problem's full details via the summary's navigation op
summary = client.problemsummaries.list(category="rated", limit=1).first()
if summary:
detail = summary.details()
print(detail.problem_name, detail.difficulty_rating, detail.languages_supported)
# Fetch a specific problem by code with typed error handling
try:
prob = client.problems.get(problem_code="PALIN")
print(prob.problem_name, prob.problem_author)
except ResourceNotFound as exc:
print(f"Problem not found: {exc}")
# Check a user's recent submissions
user = client.user(username="admin")
for sub in user.submissions(limit=3):
print(sub.problem, sub.result, sub.language)
# Get user's rating profile
profile = user.profile()
print(profile.current_user, profile.user_initial_ratings)
# Browse contests
contests = client.contestlists.get()
print(len(contests.future_contests), "upcoming contests")
print("exercised: problemsummaries.list / problems.get / summary.details / user.submissions / user.profile / contestlists.get")
Fetches a paginated list of problems from CodeChef with filtering by category, difficulty rating range, and search keyword. Returns problem metadata including submission counts and difficulty ratings. Pagination is zero-indexed. Results are sorted by the specified field and order.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (0-indexed). |
| limit | integer | Number of problems to return per page. |
| search | string | Search keyword to filter problems by name or code. |
| sort_by | string | Field to sort by. |
| category | string | Problem category filter. |
| end_rating | integer | Maximum difficulty rating (inclusive). |
| sort_order | string | Sort order. |
| start_rating | integer | Minimum difficulty rating (inclusive). Use -1 for no lower bound. |
{
"type": "object",
"fields": {
"data": "array of problem objects with id, code, name, difficulty_rating, total_submissions, successful_submissions",
"count": "integer total number of matching problems",
"status": "string indicating success",
"message": "string describing the result"
},
"sample": {
"data": {
"data": [
{
"id": "38913",
"code": "BTWSXOR",
"name": "Bitwise XOR",
"difficulty_rating": "-1",
"total_submissions": "967",
"successful_submissions": "112"
}
],
"count": 6185,
"status": "success",
"message": "Successfully fetched problems"
},
"status": "success"
}
}About the CodeChef API
Problems and Contests
The get_problems_list endpoint accepts start_rating and end_rating integer bounds to filter by difficulty, a search keyword, a category string, and standard page/limit pagination (0-indexed). Each problem object in the response carries id, code, name, difficulty_rating, total_submissions, and successful_submissions. For deeper inspection, get_problem_details takes a problem_code and an optional contest_code (use PRACTICE for standalone problems) and returns the full HTML body of the problem statement, languages_supported as a comma-separated string, difficulty_rating, and any linked editorial metadata.
Contests
get_contest_list requires no inputs and returns three categorized arrays: present_contests (live), future_contests (upcoming), and past_contests (recently finished). Each past-contest entry includes distinct_users participation counts and start/end timestamps. For division-structured contests like CodeChef Starters, get_contest_details accepts a contest_code and returns a child_contests object mapping division codes to their respective details, alongside a problems array (populated while the contest is active).
User Data
get_user_info returns date_versus_rating, an object keyed by contest type (all, all_old, dsa_monday) containing timestamped rating arrays, plus user_initial_ratings per contest type. get_user_recent_submissions accepts a username and an optional page string, returning an array of submission objects with time, problem, problem_url, result, and language fields, along with max_page for pagination.
The CodeChef API is a managed, monitored endpoint for codechef.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when codechef.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official codechef.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a difficulty-filtered problem recommender using
start_rating/end_ratingparams andsuccessful_submissionsacceptance rates. - Track a user's competitive rating progression over time by charting the
date_versus_ratinghistory fromget_user_info. - Aggregate participation stats for past contests using
distinct_userscounts returned byget_contest_list. - Monitor live and upcoming contests for automated Discord or Slack notifications with
present_contestsandfuture_contestsdata. - Display per-division contest structures for multi-div events by parsing
child_contestsfromget_contest_details. - Audit a user's recent language usage and solve rate by iterating
resultandlanguagefields inget_user_recent_submissions. - Index problem statements and constraints for search tooling using the HTML
bodyandlanguages_supportedfromget_problem_details.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does CodeChef have an official developer API?+
What does `get_contest_details` return for a multi-division contest versus a single-division one?+
child_contests field is a non-empty object mapping each division code to its own contest metadata. For single-division contests, child_contests is typically empty or absent. The problems array is populated while the contest is active but may be empty once a contest ends and problems are moved to the practice set.Does `get_user_recent_submissions` return all submissions or only a recent window?+
max_page field tells you the total number of pages available, and the page parameter (0-indexed string) lets you step through them. There is no date-range filter; you traverse pages sequentially to reach older submissions.Does the API return editorial content or solution code for problems?+
get_problem_details returns the problem statement HTML, difficulty rating, and supported languages, but editorial text and accepted solution code are not included in the response. You can fork this API on Parse and revise it to add an endpoint targeting editorial or solution data.Are user ranking or global leaderboard standings available?+
get_user_info and per-contest participant counts via get_contest_list, but ranked leaderboard tables are not exposed as a standalone endpoint. You can fork this API on Parse and revise it to add a leaderboard or standings endpoint.