cses.fi APIcses.fi ↗
Access CSES problem lists, full problem statements, category filters, courses, and contests via a structured JSON API with 5 endpoints.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/1b9e55e4-6851-41ea-ba8a-1383ad8800c0/get_problem_set_list' \ -H 'X-API-Key: $PARSE_API_KEY'
Returns all problems in the CSES Problem Set grouped by category, including names, task IDs, acceptance stats, optimal technique summaries, and URLs.
No input parameters required.
{
"type": "object",
"fields": {
"categories": "array of category objects, each containing category name and problems array"
},
"sample": {
"data": {
"categories": [
{
"category": "Introductory Problems",
"problems": [
{
"url": "https://cses.fi/problemset/task/1068",
"name": "Weird Algorithm",
"stats": "163712 / 171218",
"task_id": "1068",
"technique": "Simulation (Collatz conjecture)"
}
]
}
]
},
"status": "success"
}
}About the cses.fi API
The CSES API gives programmatic access to the cses.fi competitive programming platform across 5 endpoints, returning problem lists grouped by category, full problem statements with time and memory limits, and catalogs of courses and contests. The get_problem_detail endpoint alone returns 10 structured fields per problem, including description text, input/output format, constraints, and example cases.
Problem Set Browsing
The get_problem_set_list endpoint returns every problem on the CSES Problem Set organized into category objects. Each category contains an array of problems with their names, numeric task_id values, acceptance statistics, suggested technique labels, and direct URLs. This gives a full structural snapshot of the problem set in one call — no parameters required.
To drill down to a specific topic, get_problems_by_category accepts a category string (e.g. 'Dynamic Programming', 'Graph Algorithms', 'Sorting and Searching') and returns matching problems with the same per-problem fields: name, task_id, stats, technique, and url.
Problem Detail
get_problem_detail takes a single required parameter — task_id — and returns the complete problem statement. Response fields include title, description, input_format, output_format, constraints, time_limit (e.g. '1.00 s'), memory_limit (e.g. '512 MB'), a technique hint, and an examples array with input / output pairs. This is enough to render a full problem view or feed it into automated analysis.
Courses and Contests
get_courses_list and get_contests_list each return flat arrays of objects with name, description, and url. These cover the educational courses hosted on CSES alongside any active or past contests, making it straightforward to enumerate the full learning and competition offering alongside the problem data.
- Build a personal study tracker that maps CSES problems by category using
get_problems_by_categoryand tracks which technique labels appear most often. - Render full problem statements in a custom offline reader using the
description,input_format,output_format, andexamplesfields fromget_problem_detail. - Generate flashcard decks for competitive programming techniques by extracting the
techniquefield across all problems returned byget_problem_set_list. - Create a difficulty or acceptance-rate leaderboard by aggregating the stats field from problems across all categories.
- Enumerate CSES courses and contests for a competitive programming resource directory using
get_courses_listandget_contests_list. - Automate problem recommendation by filtering categories and cross-referencing technique hints against a user's solved-problem history.
- Index the full CSES problem corpus into a search engine using title, description, and constraints from bulk
get_problem_detailcalls.
| 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 cses.fi have an official developer API?+
What does `get_problem_detail` return beyond the problem text?+
get_problem_detail returns 10 fields: title, task_id, description, input_format, output_format, constraints, time_limit, memory_limit, technique, and an examples array. Each object in examples contains an input string and an output string matching the sample cases shown on the problem page.Does the API return user submission history or solution code?+
Are editorial or solution hints included in the problem detail response?+
get_problem_detail response includes a technique field with a short label for the suggested approach, but full editorial text and solution explanations are not part of the response. You can fork this API on Parse and revise it to add an editorial endpoint if that content is accessible on cses.fi.How specific are the category names accepted by `get_problems_by_category`?+
category parameter must match a category name as it appears in the CSES Problem Set — for example, 'Introductory Problems', 'Sorting and Searching', or 'Dynamic Programming'. You can retrieve the full list of valid category names by calling get_problem_set_list first and extracting the category name field from each returned category object.