canonical: https://jentic.com/apis/codeforces.com/codeforces

# Codeforces API

Jentic publishes the only available OpenAPI specification for Codeforces API, keeping it validated and agent-ready. Codeforces is a competitive programming platform that hosts regular online contests, archives over 7,000 problems, and tracks Elo-style ratings for hundreds of thousands of competitors. The public API exposes 16 read endpoints over codeforces.com/api covering contests, problemsets, standings, user profiles, ratings, submissions, and blog entries. Authorised endpoints use an HMAC-signed scheme combining an apiKey, apiSig, and timestamp, and rate limits cap requests at roughly one call per two seconds.

## For AI agents

Read Codeforces contest standings, problemsets, user ratings, and submission history for competitive programming analytics or coaching tools.

## Scope

Does not handle solution submission, account creation, or private messages - use for reading Codeforces contest, problemset, and user data only.

## Capabilities

- List active and historical contests via GET /contest.list with optional gym filter
- Pull final standings for a contest via GET /contest.standings, including penalty and successful hack data
- Retrieve a user's full rating history with GET /user.rating to chart progress over time
- Fetch a user's submission history through GET /user.status, including verdict and time consumed per problem
- Enumerate the entire Codeforces problemset filtered by tag or difficulty via GET /problemset.problems
- Read rating change deltas after a contest with GET /contest.ratingChanges
- Resolve handle metadata for one or many users in a single call via GET /user.info

## Use cases

### Coaching Dashboard for Competitive Programmers

Build a coaching dashboard that pulls a student's rating curve, recent submissions, and tag-based problem coverage. The agent calls GET /user.rating, GET /user.status, and GET /problemset.problems to reconcile what the student has solved against what their rating band typically demands. Replaces hand-curated spreadsheets with data sourced directly from Codeforces.

Example prompt: For handle 'tourist' fetch GET /user.rating and GET /user.status, then call GET /problemset.problems with tags=dp,graphs and report which top-rated problems remain unsolved

### Live Contest Monitoring Bot

Run a Discord or Slack bot that follows a Codeforces round in near real time. It polls GET /contest.standings every minute and posts standings updates, rank changes, and successful hacks to a channel. Friends and team members get a shared, low-effort scoreboard for the duration of the round.

Example prompt: Every 60 seconds during contest 1900 call GET /contest.standings with handles=alice;bob;carol and post rank changes to the team Slack channel

### Problem Recommendation Engine

Recommend the next problem a user should attempt based on their rating, tag history, and unsolved set. The agent reads GET /user.info for the rating band, GET /user.status to remove already-solved problems, and GET /problemset.problems to pick a candidate of the right difficulty and tag. Personalises practice without requiring a third-party tracker.

Example prompt: For handle 'alice' fetch user rating, list solved problems, then return three unsolved problems rated within +/- 100 of the user's current rating tagged with 'graphs'

### Rating Change Analysis After a Round

Analyse rating changes for a team or community immediately after a contest concludes. The agent calls GET /contest.ratingChanges for the contest id and groups by handle to produce a leaderboard of who gained or lost the most rating. Useful for company-internal contest league tables.

Example prompt: Call GET /contest.ratingChanges?contestId=1900, filter to a list of company handles, sort by delta descending, and email the resulting table

### Agent-Driven Codeforces Lookups via Jentic

A user asks an agent 'how is my Codeforces rating tracking this year?' and the Jentic-connected agent pulls rating history, recent submissions, and unsolved problems without holding the raw API key. Jentic stores the apiKey/apiSecret pair in its vault and signs requests with HMAC on the agent's behalf, returning parsed JSON to the agent.

Example prompt: Search Jentic for 'get Codeforces user rating history', load the GET /user.rating schema, execute it for handle 'alice', and summarise rating change for the last 12 months

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/contest.list` | List contests |
| GET | `/contest.standings` | Get contest standings |
| GET | `/contest.ratingChanges` | Get rating changes after a contest |
| GET | `/problemset.problems` | Enumerate problems by tag |
| GET | `/user.info` | Resolve one or many user handles |
| GET | `/user.rating` | Get a user's rating history |
| GET | `/user.status` | Get a user's submissions |
| GET | `/user.ratedList` | List rated users on the platform |

## Key resources

- **Contests** — List contests and read hacks, standings, status, and rating changes per contest
- **Problemset** — Enumerate problems by tag and read recent submissions across the entire site
- **User** — Resolve user info, friends, blog entries, rating history, and submission history
- **Blog** — View blog entries and their comments
- **Recent Actions** — Stream recent platform-wide actions

## Why Jentic

- **Setup:** Wiring Codeforces by hand means putting the apiKey in the query, targeting codeforces.com/api, and computing the HMAC-SHA512 apiSig with the shared secret and a timestamp on every authorized request. Through Jentic you install once, import the Codeforces API from the API Directory, store the apiKey and secret once, and your agent calls it while Jentic builds the signature.
- **Permission scoping:** Codeforces addresses methods by name with parameters in the query (contest.standings, user.info, user.rating) rather than a resource id in the URL path, so scope the agent by operations: limit it to the operations it needs, such as reading contest standings or a user's rating. The read-only method names you allow are the only ones that run.
- **Credential handling:** Your Codeforces apiKey and secret are stored once, encrypted, by your own Jentic One instance, and Jentic computes the HMAC-SHA512 apiSig at execution time. The secret never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get Codeforces user rating' or 'list recent contests', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs or guessing at the signing parameters.

## Related APIs

- **HackerRank API** — Competing competitive programming and technical hiring platform with its own contests and problem archive
- **HackerEarth API** — Hackathon and coding challenge platform with its own contest and submission API
- **GitHub API** — Pair with Codeforces to publish solved problems or contest summaries to a public GitHub profile or gist

## FAQ

### Why is there no official OpenAPI spec for Codeforces API?

Codeforces does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Codeforces API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Codeforces API use?

The Codeforces API uses an HMAC-signed scheme. You generate an apiKey and secret in your Codeforces settings, then send apiKey, time, and an apiSig (a SHA-512 hash of a canonical query string with a random prefix) as query parameters. Anonymous calls work for public methods. Through Jentic the secret is stored in the vault and the signature is generated on the agent's behalf.

### Can I get a user's rating history with the Codeforces API?

Yes. Call GET /user.rating with the handle parameter. The response contains every contest the user participated in along with old rating, new rating, and the contest id, which is enough to plot a full rating curve.

### What are the rate limits for the Codeforces API?

Codeforces enforces approximately one request every two seconds per IP. Heavier usage triggers HTTP 429 or temporary blocks. For bulk operations such as enumerating the entire problemset, throttle accordingly and cache the response - the problemset only updates when new contests are added.

### How do I list contest standings through Jentic?

Search Jentic for 'get Codeforces contest standings', load the GET /contest.standings schema, and execute it with the contestId and handles parameters. Jentic injects the apiKey and signs the request with the secret stored in the vault.

### Does the Codeforces API support submitting solutions?

No. The public API is read-only. Submissions still happen through the Codeforces website or the unofficial codeforces-cli; this spec covers contests, problemsets, users, and submission history only.

### Can I limit what my agent is allowed to do with the Codeforces API?

Yes. Because you run Jentic One yourself, your own rules decide which Codeforces operations and credentials the agent may use. The Codeforces API addresses methods by name in the query rather than by a resource id in the path, so you scope the agent operation by operation, allowing only what it needs such as GET /contest.standings, GET /user.rating, or GET /user.info. The read-only method names you permit are the only ones the agent can call, and everything else stays out of reach.
