Codeforces API

⭐ Beginner's Pick Programming / API Key Intermediate HTTPS
Varies by plan (check documentation)

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.

Available Data

Use case: Integrate get access to codeforces data data into web and mobile applications
Codeforces data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Codeforces",
    "description": "Get access to Codeforces data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

result[].handle The Codeforces username of the user.
result[].rating Current Codeforces rating of the user (higher means more skilled).
result[].maxRating Highest rating the user has ever achieved on Codeforces.
result[].rank Text rank title corresponding to the current rating, such as newbie, specialist, or grandmaster.
result[].contribution Number of contribution points the user has earned by creating problems and writing editorials.

Implementation Example

const url = "https://codeforces.com/apiHelp";
// 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.

Common Errors & Troubleshooting

FAILED: handles: User with handle X not found The username provided does not exist on Codeforces.
Double-check the handle spelling on the Codeforces website, as handles are case-sensitive.
FAILED: Call failed with error: Unauthorized A method that requires authentication was called without a valid apiKey and hashed signature.
Generate your API key on the Codeforces settings page and sign requests using HMAC-SHA512 as described in the API docs.
HTTP 503 or FAILED: Call failed The Codeforces API is temporarily unavailable or under maintenance, which happens during active contests.
Retry after a short delay — the API is typically restored within minutes after a contest ends.

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Programming
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →