This API provides access to CodeForces user statistics and contest data. Explore the endpoints below.
/{userid}
userid
(path parameter): CodeForces handle
{
"handle": "example_user",
"rating": 1500,
"maxRating": 1700,
"rank": "specialist",
"maxRank": "expert",
"contests_count": 25,
"solved_problems_count": 150,
"rating_history": [
{
"contestId": 1234,
"contestName": "Codeforces Round #123",
"handle": "example_user",
"rank": 100,
"ratingUpdateTimeSeconds": 1632145200,
"oldRating": 1400,
"newRating": 1500
}
]
}
GET /tourist
Try it in Swagger UI
/{userid}/basic
userid
(path parameter): CodeForces handle
{
"handle": "example_user",
"rating": 1500,
"maxRating": 1700,
"rank": "specialist",
"maxRank": "expert",
"country": "Russia",
"organization": "ITMO University"
}
GET /tourist/basic
Try it in Swagger UI
/multi/{userids}
userids
(path parameter): Semicolon-separated list of CodeForces handles
[
{
"handle": "tourist",
"rating": 3800,
"rank": "legendary grandmaster"
},
{
"handle": "SecondBest",
"rating": 3500,
"rank": "international grandmaster"
}
]
GET /multi/tourist;SecondBest
Try it in Swagger UI
/contests/upcoming
gym
(query parameter, optional): Boolean to include gym contests
[
{
"id": 1234,
"name": "Codeforces Round #123",
"type": "CF",
"phase": "BEFORE",
"frozen": false,
"durationSeconds": 7200,
"startTimeSeconds": 1632145200
}
]
GET /contests/upcoming?gym=false
Try it in Swagger UI
/{userid}/rating
userid
(path parameter): CodeForces handle
[
{
"contestId": 1234,
"contestName": "Codeforces Round #123",
"handle": "tourist",
"rank": 1,
"ratingUpdateTimeSeconds": 1632145200,
"oldRating": 3795,
"newRating": 3800
}
]
GET /tourist/rating
Try it in Swagger UI
/{userid}/solved
userid
(path parameter): CodeForces handle
{
"handle": "tourist",
"count": 1500
}
GET /tourist/solved
Try it in Swagger UI
/{userid}/contests
userid
(path parameter): CodeForces handle
{
"handle": "tourist",
"contests": [1234, 1235, 1236]
}
GET /tourist/contests
Try it in Swagger UI
/users/common-contests/{userids}
userids
(path parameter): Semicolon-separated list of CodeForces handles
{
"handles": ["tourist", "SecondBest"],
"common_contests": [1234, 1235, 1236]
}
GET /users/common-contests/tourist;SecondBest
Try it in Swagger UI
{
"detail": "User information not found for {handle}"
}
{
"detail": "No valid handles provided"
}
Please use this API responsibly and consider CodeForces' rate limits when making requests.
The API respects CodeForces' rate limiting of 1 request per 2 seconds.