Overview
Codeforces is a competitive programming platform, and its API lets you retrieve contest data, user statistics, problem sets, and submission results programmatically. Most read endpoints are public and require no authentication, making it easy to start exploring contest history and rankings immediately. It is commonly used to build leaderboards, personal coding trackers, and competitive programming analytics tools.
Beginner Tip
Most read-only methods like user.info and contest.list work without any API key — start with these to get familiar with the response format before setting up HMAC-SHA512 signed requests.
Measurement Record
What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.
- Request
- GET https://codeforces.com/api/user.info?handles=tourist
- Result
- HTTP 200 · application/json · 508 bytes · compressed
- Response time
- 330 ms (median of 3) · fastest 327 ms
- Transport
- TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
- Browser CORS
- Allowed — Access-Control-Allow-Origin: *
- Served by
- cloudflare
- Recorded
- 2026-08-10
Fields Returned
Top-level fields present in the response we captured, with the type and value we actually received.
| Field | Type | Value received |
|---|---|---|
| lastName | string | Korotkevich |
| country | string | Belarus |
| lastOnlineTimeSeconds | integer | 1786359842 |
| city | string | Gomel |
| rating | integer | 3530 |
| friendOfCount | integer | 90220 |
| titlePhoto | string (url) | https://userpic.codeforces.org/422/title/50a2… |
| handle | string | tourist |
| avatar | string (url) | https://userpic.codeforces.org/422/avatar/2b5… |
| firstName | string | Gennady |
| contribution | integer | 109 |
| organization | string | ITMO University |
| rank | string | legendary grandmaster |
| maxRating | integer | 4009 |
Captured Response
Captured from a real request to https://codeforces.com/api/user.info?handles=tourist on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.
{
"status": "OK",
"result": [
{
"lastName": "Korotkevich",
"country": "Belarus",
"lastOnlineTimeSeconds": 1786359842,
"city": "Gomel",
"rating": 3530,
"friendOfCount": 90220,
"titlePhoto": "https://userpic.codeforces.org/422/title/50a270ed4a722867.jpg",
"handle": "tourist",
"avatar": "https://userpic.codeforces.org/422/avatar/2b5dbe87f0d859a2.jpg",
"firstName": "Gennady",
"contribution": 109,
"organization": "ITMO University",
"rank": "legendary grandmaster",
"maxRating": 4009,
"…": "(2 more fields)"
}
]
} Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://codeforces.com/api/user.info?handles=tourist";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
How This API Fails
We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.
Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.
Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Measured Score Breakdown
Live HTTP request to the API endpoint
Fully tested on Aug 10, 2026
Technical Specifications
Related Tags
Explore More
Similar APIs
View All →Hackerearth
HackerEarth is a developer assessment platform, and its API lets you compile and execute code in over 30 programming languages programmatically.
Judge0 CE
⭐ Beginner's PickJudge0 CE is an open-source online code execution API that compiles and runs code in over 60 programming languages.
Mintlify
Mintlify is a documentation platform API that lets you programmatically generate and manage beautiful docs for your code projects.