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).

ParameterDescriptionExample
contestIdThe Codeforces contest id.1061
indexThe problem letter, with a digit for split problems (A, B1, D2). Case-insensitive.A
X-ClientOptional 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
clientThe 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"
}
StatusMeaning
200The hints.
400The contest id or index is not a plausible Codeforces problem id (invalid_problem).
404No 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.
429Too many requests (rate_limited). Wait Retry-After seconds.
500Something unexpected went wrong on our side (internal). Please report it if it persists.
503The 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"
}
StatusMeaning
200The 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