# Codeforces

> Follow competitive programming on Codeforces. Look up users, their rating history, submissions and blog posts; list upcoming and past contests and their submissions; find archive problems by tag and difficulty; and read the latest submissions, blog activity, posts and comments. Start a workflow when a contest is announced, a user submits a solution or a rating changes. No account or API key required.

App · 14 actions. Web page: https://docs.lodol.com/docs/integrations/codeforces

## Actions

### Find problems

Find problems in the Codeforces archive by tags, difficulty rating and title, newest, easiest, hardest or most solved first, with how many people solved each.

**Inputs**

- Tags (`tags`, list): Only problems with every one of these tags. One or more of: `*special` (Special problem), `2-sat`, `binary search`, `bitmasks`, `brute force`, `chinese remainder theorem`, `combinatorics`, `communication`, `constructive algorithms`, `data structures`, and 28 more.
- Lowest rating (`min_rating`, number): Only problems rated at least this, from 800. Setting a rating leaves out problems not rated yet. From 800 to 3500.
- Highest rating (`max_rating`, number): Only problems rated at most this, up to 3500. From 800 to 3500.
- Title contains (`name_contains`, text): Only problems whose title contains this text.
- Order (`sort`, text): Newest first by default. One of: `newest` (Newest first), `easiest` (Easiest first), `hardest` (Hardest first), `most_solved` (Most solved first). Default: `newest`.
- How many (`limit`, number): How many problems to return, up to 1000. From 1 to 1000. Default: `20`.

**Outputs**

- `count` (number): How many problems this answer holds
- `matched_count` (number): How many matched before the limit
- `problems` (list): The problems found
- `tags` (list): The tags asked for

**Example output**

```json
{
  "count": 1,
  "matched_count": 293,
  "problems": [
    {
      "contest_id": 2259,
      "id": "2259H",
      "index": "H",
      "name": "Treasure Map Destruction (Counting Version)",
      "points": 0,
      "rating": 2200,
      "solved_count": 1025,
      "tags": [
        "dfs and similar",
        "dp",
        "dsu",
        "graphs",
        "math"
      ],
      "url": "https://codeforces.com/problemset/problem/2259/H"
    }
  ],
  "tags": [
    "dp",
    "graphs"
  ]
}
```

### Get a blog entry

Get a blog post, such as an announcement or an editorial: its title, author, rating, tags and full text, as plain text and as HTML.

**Inputs**

- Blog entry (`blog_entry`, text, required): The blog entry's ID, the number in its address (79 in codeforces.com/blog/entry/79), or the address itself.

**Outputs**

- `author` (text): The author's handle
- `content_html` (text): The post as Codeforces shows it, in HTML
- `content_text` (text): The post, as plain text
- `created_at` (text): When it was posted, ISO 8601 in UTC
- `id` (number): The blog entry's ID
- `locale` (text): The language it is shown in, such as en
- `modified_at` (text): When it was last edited, ISO 8601 in UTC
- `rating` (number): Its rating from votes
- `tags` (list): Its tags
- `title` (text): Its title, as plain text
- `url` (text): The blog entry's page on codeforces.com

**Example output**

```json
{
  "author": "MikeMirzayanov",
  "content_html": "<div class=\"ttypography\"><p>This post is no longer relevant; it has become outdated.</p></div>",
  "content_text": "This post is no longer relevant; it has become outdated.",
  "created_at": "2010-02-17T09:32:18Z",
  "id": 79,
  "locale": "en",
  "modified_at": "2023-10-06T09:04:27Z",
  "rating": 0,
  "tags": [
    "codeforces",
    "compilers",
    "rules"
  ],
  "title": "About the programming languages",
  "url": "https://codeforces.com/blog/entry/79"
}
```

### Get a contest

Get one contest: its name, rules, phase, start and end times and how many minutes away it starts.

**Inputs**

- Contest (`contest`, text, required): The contest's ID, the number in its address (2000 in codeforces.com/contest/2000), or the address itself.

**Outputs**

- `contest_kind` (text): For a Gym contest, its kind, such as Official ICPC Contest
- `difficulty` (number): For a Gym contest, its difficulty from 1 to 5, 0 when unset
- `duration_minutes` (number): How long it lasts, in minutes
- `end_time` (text): When it ends, ISO 8601 in UTC
- `frozen` (true/false): True while the standings are frozen
- `id` (number): The contest's ID
- `is_gym` (true/false): True for a contest in the Gym, Codeforces' training area
- `name` (text): The contest's name
- `phase` (text): BEFORE, CODING, PENDING_SYSTEM_TEST, SYSTEM_TEST or FINISHED
- `prepared_by` (text): For a Gym contest, who prepared it
- `season` (text): For a Gym contest, its season
- `start_time` (text): When it starts, ISO 8601 in UTC, empty when not scheduled
- `starts_in_minutes` (number): Minutes from now until it starts, negative once it has started
- `status` (text): The phase in words: Upcoming, Running, System testing or Finished
- `type` (text): Its scoring rules: CF, IOI or ICPC
- `url` (text): The contest's page on codeforces.com

**Example output**

```json
{
  "contest_kind": "",
  "difficulty": 0,
  "duration_minutes": 150,
  "end_time": "2026-11-07T17:05:00Z",
  "frozen": false,
  "id": 2279,
  "is_gym": false,
  "name": "Codeforces Round (Div. 1)",
  "phase": "BEFORE",
  "prepared_by": "",
  "season": "",
  "start_time": "2026-11-07T14:35:00Z",
  "starts_in_minutes": 24368,
  "status": "Upcoming",
  "type": "CF",
  "url": "https://codeforces.com/contest/2279"
}
```

### Get a problem

Get one problem from the archive by its code, such as 2000A: its title, difficulty rating, tags, how many solved it, and its link.

**Inputs**

- Problem (`problem`, text, required): The problem's code, contest ID then letter (2000A), or its address.

**Outputs**

- `contest_id` (number): The contest it belongs to
- `id` (text): The problem's code, contest ID then index, such as 2000A
- `index` (text): Its letter in that contest, such as A or B1
- `name` (text): The problem's title
- `points` (number): Its points in the contest, 0 when not scored by points
- `rating` (number): Its difficulty rating, 0 when not rated yet
- `solved_count` (number): How many people have solved it, 0 when not known
- `tags` (list): Its tags, such as dp or greedy
- `url` (text): The problem's page on codeforces.com

**Example output**

```json
{
  "contest_id": 2259,
  "id": "2259H",
  "index": "H",
  "name": "Treasure Map Destruction (Counting Version)",
  "points": 0,
  "rating": 2200,
  "solved_count": 1025,
  "tags": [
    "dfs and similar",
    "dp",
    "dsu",
    "graphs",
    "math"
  ],
  "url": "https://codeforces.com/problemset/problem/2259/H"
}
```

### Get a user

Get a user's public profile: rating and rank, best rating, name, country, organization, contribution and when they joined and were last online.

**Inputs**

- Handle (`handle`, text, required): A Codeforces handle, such as tourist, or the profile's address (codeforces.com/profile/tourist).

**Outputs**

- `avatar_url` (text): Their avatar image
- `city` (text): Their city, when published
- `contribution` (number): Their contribution score from blog votes
- `country` (text): Their country, when published
- `first_name` (text): Their first name, when published
- `friend_of_count` (number): How many users have them as a friend
- `handle` (text): The user's handle, such as tourist
- `last_name` (text): Their last name, when published
- `last_online` (text): When they were last online, ISO 8601 in UTC
- `max_rank` (text): The highest rank they have reached
- `max_rating` (number): The highest rating they have reached
- `name` (text): Their first and last name, when they publish them
- `organization` (text): Their school or company, when published
- `rank` (text): Their current rank, such as legendary grandmaster
- `rated` (true/false): True once they have a rating
- `rating` (number): Their current rating, 0 when unrated
- `registered` (text): When they joined Codeforces, ISO 8601 in UTC
- `title_photo_url` (text): Their profile photo
- `url` (text): Their profile on codeforces.com

**Example output**

```json
{
  "avatar_url": "https://userpic.codeforces.org/422/avatar/2b5dbe87f0d859a2.jpg",
  "city": "Gomel",
  "contribution": 111,
  "country": "Belarus",
  "first_name": "Gennady",
  "friend_of_count": 91436,
  "handle": "tourist",
  "last_name": "Korotkevich",
  "last_online": "2026-10-21T02:58:41Z",
  "max_rank": "tourist",
  "max_rating": 4009,
  "name": "Gennady Korotkevich",
  "organization": "ITMO University",
  "rank": "legendary grandmaster",
  "rated": true,
  "rating": 3380,
  "registered": "2010-02-12T15:08:08Z",
  "title_photo_url": "https://userpic.codeforces.org/422/title/50a270ed4a722867.jpg",
  "url": "https://codeforces.com/profile/tourist"
}
```

### Get a user's rating history

List a user's rated contests, newest first, with their place and how their rating changed, plus their current and best rating.

**Inputs**

- Handle (`handle`, text, required): A Codeforces handle, such as tourist, or the profile's address (codeforces.com/profile/tourist).
- How many (`limit`, number): How many contests to return, up to 1000. From 1 to 1000. Default: `50`.

**Outputs**

- `best_rank` (number): Their best place in a rated contest
- `changes` (list): The rated contests, newest first
- `count` (number): How many contests this answer holds
- `current_rating` (number): Their rating after their latest rated contest
- `handle` (text): The handle asked about
- `max_rating` (number): The highest rating they have had
- `total_contests` (number): How many rated contests they have taken part in

**Example output**

```json
{
  "best_rank": 1,
  "changes": [
    {
      "contest_id": 2261,
      "contest_name": "WorldQuant Round 1 (Codeforces Round 1128, Div. 1 + Div. 2)",
      "contest_url": "https://codeforces.com/contest/2261",
      "delta": 37,
      "handle": "tourist",
      "new_rating": 3380,
      "old_rating": 3343,
      "rank": 4,
      "rated_at": "2026-10-17T17:35:00Z"
    }
  ],
  "count": 1,
  "current_rating": 3380,
  "handle": "tourist",
  "max_rating": 4009,
  "total_contests": 310
}
```

### Get several users

Get up to 100 users' profiles in one step, such as a team or a class, with the handles Codeforces does not know listed separately rather than failing the step.

**Inputs**

- Handles (`handles`, list, required): The handles to look up.

**Outputs**

- `count` (number): How many users were found
- `not_found` (list): The handles Codeforces does not know
- `users` (list): The users found, in the order asked

**Example output**

```json
{
  "count": 1,
  "not_found": [],
  "users": [
    {
      "avatar_url": "https://userpic.codeforces.org/422/avatar/2b5dbe87f0d859a2.jpg",
      "city": "Gomel",
      "contribution": 111,
      "country": "Belarus",
      "first_name": "Gennady",
      "friend_of_count": 91436,
      "handle": "tourist",
      "last_name": "Korotkevich",
      "last_online": "2026-10-21T02:58:41Z",
      "max_rank": "tourist",
      "max_rating": 4009,
      "name": "Gennady Korotkevich",
      "organization": "ITMO University",
      "rank": "legendary grandmaster",
      "rated": true,
      "rating": 3380,
      "registered": "2010-02-12T15:08:08Z",
      "title_photo_url": "https://userpic.codeforces.org/422/title/50a270ed4a722867.jpg",
      "url": "https://codeforces.com/profile/tourist"
    }
  ]
}
```

### List a blog entry's comments

List the comments on a blog post, oldest, newest or highest rated first, as plain text with the author and a link to each.

**Inputs**

- Blog entry (`blog_entry`, text, required): The blog entry's ID, the number in its address (79 in codeforces.com/blog/entry/79), or the address itself.
- Order (`sort`, text): Oldest first by default, the order the page shows them. One of: `oldest` (Oldest first), `newest` (Newest first), `top` (Highest rated first). Default: `oldest`.
- How many (`limit`, number): How many comments to return, up to 1000. From 1 to 1000. Default: `50`.

**Outputs**

- `blog_entry_id` (number): The blog entry's ID
- `comments` (list): The comments
- `count` (number): How many comments this answer holds
- `total_count` (number): How many comments the entry has

**Example output**

```json
{
  "blog_entry_id": 79,
  "comments": [
    {
      "author": "andreyv",
      "created_at": "2015-05-15T20:10:04Z",
      "html": "<div class=\"ttypography\"><p>Rust 1.0 is released: http://blog.rust-lang.org/2015/05/15/Rust-1.0.html</p></div>",
      "id": 227612,
      "parent_id": 214139,
      "rating": 37,
      "text": "Rust 1.0 is released: http://blog.rust-lang.org/2015/05/15/Rust-1.0.html",
      "url": "https://codeforces.com/blog/entry/79#comment-227612"
    }
  ],
  "count": 1,
  "total_count": 273
}
```

### List a contest's submissions

List a contest's most recent submissions, newest first, optionally only one participant's or only one verdict.

**Inputs**

- Contest (`contest`, text, required): The contest's ID, the number in its address (2000 in codeforces.com/contest/2000), or the address itself.
- Handle (`handle`, text): Only this participant's submissions. Leave empty for everyone's.
- Verdict (`verdict`, text): Only submissions with this verdict, such as Accepted, or Anything but Accepted. Leave empty for every verdict.
- How many to read (`limit`, number): How many of the most recent submissions to read, up to 1000; the verdict filter applies to these. From 1 to 1000. Default: `20`.

**Outputs**

- `contest_id` (number): The contest's ID
- `count` (number): How many submissions matched
- `read_count` (number): How many submissions were read
- `submissions` (list): The submissions, newest first

**Example output**

```json
{
  "contest_id": 2261,
  "count": 1,
  "read_count": 1,
  "submissions": [
    {
      "accepted": true,
      "contest_id": 2261,
      "handle": "tourist",
      "handles": [
        "tourist"
      ],
      "id": 395033187,
      "language": "C++23 (GCC 14-64, msys2)",
      "memory_bytes": 0,
      "participant_type": "CONTESTANT",
      "passed_test_count": 55,
      "problem_id": "2261H",
      "problem_name": "Oh Tree Tree Tree, No Need to Leave",
      "problem_rating": 3500,
      "problem_tags": [
        "bitmasks",
        "interactive",
        "trees"
      ],
      "problem_url": "https://codeforces.com/problemset/problem/2261/H",
      "submitted_at": "2026-10-17T17:34:23Z",
      "team_name": "",
      "time_ms": 250,
      "url": "https://codeforces.com/contest/2261/submission/395033187",
      "verdict": "OK",
      "verdict_label": "Accepted"
    }
  ]
}
```

### List a user's blog entries

List the blog entries a user has written, newest first.

**Inputs**

- Handle (`handle`, text, required): A Codeforces handle, such as tourist, or the profile's address (codeforces.com/profile/tourist).

**Outputs**

- `blog_entries` (list): Their blog entries, newest first
- `count` (number): How many they have written
- `handle` (text): The handle asked about

**Example output**

```json
{
  "blog_entries": [
    {
      "author": "tourist",
      "created_at": "2026-08-08T01:42:57Z",
      "id": 155784,
      "locale": "en",
      "modified_at": "2026-08-08T01:42:57Z",
      "rating": 521,
      "tags": [],
      "title": "Cognition @ IOI 2026",
      "url": "https://codeforces.com/blog/entry/155784"
    }
  ],
  "count": 1,
  "handle": "tourist"
}
```

### List a user's submissions

List a user's most recent submissions, newest first, with the problem, language, verdict, time and memory, optionally only one verdict or only since a date.

**Inputs**

- Handle (`handle`, text, required): A Codeforces handle, such as tourist, or the profile's address (codeforces.com/profile/tourist).
- Verdict (`verdict`, text): Only submissions with this verdict, such as Accepted, or Anything but Accepted. Leave empty for every verdict.
- Submitted since (`since`, date and time): Only submissions made at or after this time.
- How many to read (`limit`, number): How many of their most recent submissions to read, up to 1000; the filters apply to these. From 1 to 1000. Default: `20`.

**Outputs**

- `accepted_count` (number): How many of those matched were accepted
- `count` (number): How many submissions matched
- `handle` (text): The handle asked about
- `read_count` (number): How many recent submissions were read
- `submissions` (list): The submissions, newest first

**Example output**

```json
{
  "accepted_count": 1,
  "count": 1,
  "handle": "tourist",
  "read_count": 5,
  "submissions": [
    {
      "accepted": true,
      "contest_id": 2261,
      "handle": "tourist",
      "handles": [
        "tourist"
      ],
      "id": 395033187,
      "language": "C++23 (GCC 14-64, msys2)",
      "memory_bytes": 0,
      "participant_type": "CONTESTANT",
      "passed_test_count": 55,
      "problem_id": "2261H",
      "problem_name": "Oh Tree Tree Tree, No Need to Leave",
      "problem_rating": 3500,
      "problem_tags": [
        "bitmasks",
        "interactive",
        "trees"
      ],
      "problem_url": "https://codeforces.com/problemset/problem/2261/H",
      "submitted_at": "2026-10-17T17:34:23Z",
      "team_name": "",
      "time_ms": 250,
      "url": "https://codeforces.com/contest/2261/submission/395033187",
      "verdict": "OK",
      "verdict_label": "Accepted"
    }
  ]
}
```

### List contests

List contests by phase: upcoming ones soonest first with when they start and how long they last, or running and finished ones newest first, optionally from the Gym or by name.

**Inputs**

- Which contests (`phase`, text): Upcoming contests by default. One of: `upcoming`, `running` (Running or being tested), `finished`, `any`. Default: `upcoming`.
- Gym contests (`gym`, true/false): List the Gym, Codeforces' archive of training contests, instead of its own rounds. The Gym list is long and takes about 20 seconds. Default: `false`.
- Name contains (`name_contains`, text): Only contests whose name contains this text.
- How many (`limit`, number): How many contests to return, up to 1000. From 1 to 1000. Default: `20`.

**Outputs**

- `contests` (list): The contests
- `count` (number): How many contests this answer holds
- `gym` (true/false): True when the Gym was listed
- `matched_count` (number): How many matched before the limit
- `phase` (text): Which contests were listed

**Example output**

```json
{
  "contests": [
    {
      "contest_kind": "",
      "difficulty": 0,
      "duration_minutes": 150,
      "end_time": "2026-11-07T17:05:00Z",
      "frozen": false,
      "id": 2279,
      "is_gym": false,
      "name": "Codeforces Round (Div. 1)",
      "phase": "BEFORE",
      "prepared_by": "",
      "season": "",
      "start_time": "2026-11-07T14:35:00Z",
      "starts_in_minutes": 24368,
      "status": "Upcoming",
      "type": "CF",
      "url": "https://codeforces.com/contest/2279"
    }
  ],
  "count": 1,
  "gym": false,
  "matched_count": 6,
  "phase": "upcoming"
}
```

### List recent blog activity

List the latest activity on Codeforces' blogs, newest first: new and edited posts and new comments, with links.

**Inputs**

- How many (`count`, number): How many of the latest actions to read, up to 100. From 1 to 100. Default: `20`.
- Only (`activity`, text): Comments only, or posts only. Leave empty for both. One of: `comment` (Comments only), `blog_entry` (New and edited posts only).

**Outputs**

- `actions` (list): The actions, newest first
- `count` (number): How many actions this answer holds

**Example output**

```json
{
  "actions": [
    {
      "blog_author": "omsincoconut",
      "blog_entry_id": 157917,
      "blog_title": "WorldQuant Round 1 (Codeforces Round 1128, Div. 1 + 2) Editorial",
      "comment_author": "dolaisubhrabijoy",
      "comment_id": 1400916,
      "comment_text": "Sample testcase for D1 could be stronger.",
      "time": "2026-10-21T05:55:33Z",
      "type": "comment",
      "url": "https://codeforces.com/blog/entry/157917#comment-1400916"
    }
  ],
  "count": 1
}
```

### List the latest submissions

List the submissions just made to the problem archive by anyone, newest first, optionally only one verdict.

**Inputs**

- How many to read (`count`, number): How many of the latest submissions to read, up to 1000. From 1 to 1000. Default: `20`.
- Verdict (`verdict`, text): Only submissions with this verdict, such as Accepted, or Anything but Accepted. Leave empty for every verdict.

**Outputs**

- `count` (number): How many submissions matched
- `read_count` (number): How many submissions were read
- `submissions` (list): The submissions, newest first

**Example output**

```json
{
  "count": 1,
  "read_count": 1,
  "submissions": [
    {
      "accepted": true,
      "contest_id": 2261,
      "handle": "tourist",
      "handles": [
        "tourist"
      ],
      "id": 395033187,
      "language": "C++23 (GCC 14-64, msys2)",
      "memory_bytes": 0,
      "participant_type": "CONTESTANT",
      "passed_test_count": 55,
      "problem_id": "2261H",
      "problem_name": "Oh Tree Tree Tree, No Need to Leave",
      "problem_rating": 3500,
      "problem_tags": [
        "bitmasks",
        "interactive",
        "trees"
      ],
      "problem_url": "https://codeforces.com/problemset/problem/2261/H",
      "submitted_at": "2026-10-17T17:34:23Z",
      "team_name": "",
      "time_ms": 250,
      "url": "https://codeforces.com/contest/2261/submission/395033187",
      "verdict": "OK",
      "verdict_label": "Accepted"
    }
  ]
}
```
