codechef.com APIcodechef.com ↗
Access CodeChef problem lists, contest schedules, user profiles, rating history, and submission data via a structured REST API with 6 endpoints.
curl -X GET 'https://api.parse.bot/scraper/6aa4e6fb-1d6a-4c05-aeaf-d2996e380e80/get_problems_list?page=0&limit=5&category=rated' \ -H 'X-API-Key: $PARSE_API_KEY'
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.
| 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: 'asc' or 'desc'. |
| 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": 6129,
"status": "success",
"message": "Successfully fetched problems"
},
"status": "success"
}
}About the codechef.com 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.
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.
- 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 | 250 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.