An API endpoint to get competitive programming profiles and 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
![Codechef badge](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fcp-rating-api.vercel.app%2Fbadge%2Fcodechef%2F[USERNAME]&cacheSeconds=86400)
Replace [USERNAME] with codeforces username.
-
Codeforces
![Codeforces badge](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fcp-rating-api.vercel.app%2Fbadge%2Fcodeforces%2F[USERNAME]&cacheSeconds=86400)
Replace [USERNAME] with codeforces username.
-
Leetcode
![Leetcode badge](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fcp-rating-api.vercel.app%2Fbadge%2Fleetcode%2F[USERNAME]&cacheSeconds=86400)
Replace [USERNAME] with leetcode username.