LeekCF Hinter API
Version 1.0.0 · base URL https://leekcf-hinter-api.leekcf.workers.dev · OpenAPI document
Progressive hints (2 to 5 per problem, gentlest first) for Codeforces problems. Free, read-only, no API key. Hints are served only after a contest has ended, plus a 2-hour margin for system tests, so they never spoil a running round. Problem statements and editorials are not served here: use the problem link on codeforces.com. The hints are written by an AI model from the statement and, when one exists, the official editorial. They can be wrong, so check them against the editorial. Each client address may make about 60 requests per minute (HTTP 429 with Retry-After beyond that). Answers are cacheable; please cache them on your side.
GET /v1/problems/{contestId}/{index}/hints
Get the hints of one problem
Returns every hint level of the problem, gentlest first. Reveal them one at a time in your interface so the reader is not spoiled by accident. A problem Codeforces lists in two divisions resolves to the same hints (see duplicateOf).
| Parameter | Description | Example |
|---|---|---|
contestId | The Codeforces contest id. | 1061 |
index | The problem letter, with a digit for split problems (A, B1, D2). Case-insensitive. | A |
X-Client | Optional but appreciated: the name of your app, e.g. "my-extension/1.0". It is used only for anonymous usage statistics per app (no addresses are stored). Wins over the client query parameter when both are sent. | my-extension/1.0 |
client | The same as the X-Client header, for browser apps: a plain GET with a query parameter needs no preflight request. Example: ?client=my-extension/1.0. The answer is the same with or without it. | my-extension/1.0 |
Try it:
curl https://leekcf-hinter-api.leekcf.workers.dev/v1/problems/1061/A/hints
Response 200:
{
"problem": {
"id": "1061_A",
"contestId": 1061,
"index": "A",
"name": "Coins",
"rating": 800,
"tags": [
"greedy",
"implementation",
"math"
]
},
"duplicateOf": null,
"hints": [
{
"level": 1,
"content": "To minimize the total number of coins needed to reach a target sum $S$, each coin should contribute as much as possible to the sum. What is the largest coin value available, and how much of $S$ can be covered using only that largest value?"
},
{
"level": 2,
"content": "To achieve the minimum number of coins, take as many coins of the maximum value $n$ as possible. The number of full coins of value $n$ you can use is $\\lfloor S / n \\rfloor$. If $S$ is not evenly divisible by $n$, the remainder $S \\bmod n$ is strictly less than $n$, so it can be covered using exactly one additional coin of value $S \\bmod n$. Thus, the minimum number of coins required is $\\lceil S / n \\rceil$, which can be computed in $O(1)$ time using integer arithmetic as $(S + n - 1) / n$."
}
],
"groundedInTutorial": true,
"generatedAt": "2026-10-19T16:22:59.130126+00:00"
}
| Status | Meaning |
|---|---|
200 | The hints. |
400 | The contest id or index is not a plausible Codeforces problem id (invalid_problem). |
404 | No hints are available for this problem (not_found). The same answer is given whether the problem is unknown, not processed yet, or its contest is not over, so try again later. |
429 | Too many requests (rate_limited). Wait Retry-After seconds. |
500 | Something unexpected went wrong on our side (internal). Please report it if it persists. |
503 | The service is temporarily unavailable (unavailable). Try again shortly. |
GET /v1/health
Liveness check
Try it:
curl https://leekcf-hinter-api.leekcf.workers.dev/v1/health
Response 200:
{
"status": "ok"
}
| Status | Meaning |
|---|---|
200 | The service is up. |
Errors
Errors are JSON: {"error": {"code": "...", "message": "..."}}. Codes: invalid_problem, not_found, rate_limited, unavailable, method_not_allowed, internal.
Being a good client
- Name your app: send
X-Client: my-app/1.0, or in a browser add?client=my-app/1.0to the URL (no preflight request). It only feeds anonymous usage statistics, so we can see which apps use the API; no addresses are stored. - Stay under the rate limit (HTTP 429 carries a
Retry-Afterheader) and cache answers; hints rarely change. - Show hints one at a time so readers are not spoiled by accident.
- Link back to the problem on codeforces.com; this API does not serve statements or editorials.