An API endpoint to get competitive programming ratings from various platforms.
- Codechef - Codeforces - LeetCode
Base URL - https://cp-rating-api.vercel.app/
Response:
{
"username": [username],
"avatar": [profile-image],
"rating": [rating],
"stars": [stars],
"country": [country],
"globalRank": [global rank],
"countryRank": [country rank],
"puzzleRating": [puzzle rating],
"onevsoneRating": [1v1 rating],
"participation": [no of contests],
"color": [rating color],
"problemsSolved": [completely solved problems],
"partialProblems": [partially solved problems],
"contests": [ - Array of all contests participated- ]
}
Response:
{
"rating": [current rating],
"titlePhoto": [photoURL],
"rank": [current rank],
"handle": [username],
"maxRating": [max_rating],
"color": [rank color],
"friends": [no of friends],
"contributions": [contributions]
}
Response:
{
"user": [username],
"rank": [ranking],
"avatar": [avatar-url],
"problemsSolved": [no of problems solved],
"languages": [
{
"languageName": [language],
"problemsSolved": [no of problems]
}
],
"totalProblems": [current total problems on leetcode],
"submissions": [
{
"difficulty": "All",
"count": [no of problems],
"submissions": [total submissions]
},
{
"difficulty": "Easy",
"count": [no of problems],
"submissions": [total submissions]
},
{
"difficulty": "Medium",
"count": [no of problems],
"submissions": [total submissions]
},
{
"difficulty": "Hard",
"count": [no of problems],
"submissions": [total submissions]
}
],
"topics": {
"advanced":[
[-array of topics with tagName and problemsSolved-]
]
"intermediate":[
[-array of topics with tagName and problemsSolved-]
]
"fundamental":[
[-array of topics with tagName and problemsSolved-]
]
}
}
To get shields.io badges with your rating, use these examples:
Codechef

Replace [USERNAME] with codechef username.
Codeforces

Replace [USERNAME] with codeforces username.
Leetcode

Replace [USERNAME] with leetcode username.