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

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

Request
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.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

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

Related Tags

Similar APIs

View All →