Codeforces/ API
Stat API · Codeforces

Codeforces Stats API

Competitive programming analytics for Codeforces handles, ratings, contests, solved tags, and activity heatmaps.

Every canonical endpoint shares one response envelope across all platforms, so you can swap providers without rewriting your client. Legacy aliases stay available and are clearly marked.

REST JSON No auth {userid}
1

Make your first request

Send a GET request to any handle. Replace tourist with the userid you want to inspect — no API key required.

Terminal
# Fetch a Codeforces profile
curl /tourist/profile
i
Tip

Prefer a browser? Try the live playground, open /tourist/profile for raw JSON, or explore every route interactively in the OpenAPI explorer.

2

Response envelope

Successful responses follow one consistent shape. The data object carries the endpoint-specific payload while the outer fields stay identical everywhere.

200 OK · application/json
{
  "status": "success",
  "platform": "codeforces",
  "userid": "tourist",
  "cached": false,
  "data": { ... }
}
3

Canonical endpoints

The canonical surface — build against these. Click any endpoint to see its path parameters and an example response.

Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "totalSolved": 1263,
    "totalActiveDays": 608,
    "totalContests": 57,
    "currentRating": 1745,
    "maxRating": 1803,
    "rank": "Knight",
    "badgesCount": 24
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "displayName": "Shaurya Rahlon",
    "username": "tourist",
    "avatar": "https://...",
    "country": "India",
    "countryFlag": "https://...",
    "institution": "Jaypee Institute of Information Technology",
    "company": null,
    "bio": null,
    "websites": [],
    "social": {
      "github": null,
      "twitter": null,
      "linkedin": null
    },
    "verified": false
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "totalSolved": 859,
    "totalQuestions": 3000,
    "acceptanceRate": 65.5,
    "byDifficulty": {
      "easy": 267,
      "medium": 472,
      "hard": 120
    },
    "topicAnalysis": [
      {
        "topic": "Arrays",
        "count": 506
      },
      {
        "topic": "Dynamic Programming",
        "count": 152
      }
    ]
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Query parameters
NameTypeDescription
themestringoptionaldark (default) or light.
excludestringoptionalComma-separated topics/languages to omit from the bars.
Response · 200 OK

Returns image/svg+xml (not JSON). Use the playground to preview the card live.

Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "topicAnalysis": [
      {
        "topic": "Arrays",
        "count": 506
      },
      {
        "topic": "Dynamic Programming",
        "count": 152
      },
      {
        "topic": "Graphs",
        "count": 88
      }
    ]
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "count": 28,
    "rating": 1745,
    "maxRating": 1803,
    "rank": "Knight",
    "globalRanking": 38357,
    "topPercentage": 5.0,
    "history": [
      {
        "name": "Starters 175",
        "date": "2026-01-31",
        "timestamp": 1769817600,
        "rating": 1745,
        "ranking": 38357,
        "problemsSolved": 3,
        "totalProblems": 4
      }
    ]
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "current": 1745,
    "max": 1803,
    "history": [
      {
        "timestamp": 1769817600,
        "rating": 1745,
        "contestName": "Starters 175"
      }
    ]
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "totalSubmissions": 592,
    "totalActiveDays": 608,
    "currentStreak": 4,
    "longestStreak": 138,
    "maxDailySubmissions": 12,
    "firstActiveDate": "2024-01-03",
    "lastActiveDate": "2026-05-29",
    "dailyContributions": [
      {
        "date": "2024-01-03",
        "count": 3,
        "level": 1
      }
    ],
    "yearlyContributions": [
      {
        "year": 2025,
        "totalSubmissions": 320,
        "activeDays": 120
      }
    ]
  }
}
Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK
application/json
{
  "status": "success",
  "platform": "codeforces",
  "username": "tourist",
  "cached": false,
  "data": {
    "count": 0,
    "active": null,
    "list": []
  }
}
4

Legacy compatibility

Kept working for existing integrations. Prefer the canonical routes above for anything new.

Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK

Deprecated alias — returns the standard envelope wrapping the legacy payload.

Path parameters
NameTypeDescription
useridstringrequiredThe Codeforces userid to look up.
Response · 200 OK

Deprecated alias — returns the standard envelope wrapping the legacy payload.

Path parameters
NameTypeDescription
useridsstringrequiredComma-separated list of Codeforces handles.
Response · 200 OK

Deprecated alias — returns the standard envelope wrapping the legacy payload.

Path parameters
NameTypeDescription
useridsstringrequiredComma-separated list of Codeforces handles.
Response · 200 OK

Deprecated alias — returns the standard envelope wrapping the legacy payload.

Path parameters

None.

Response · 200 OK

Deprecated alias — returns the standard envelope wrapping the legacy payload.

Codeforces Stats API · part of the Stat API OpenAPI · ReDoc