Skip to content

ravibabuvadde/competeapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comepete API

Users Profile fetched from Codeforces, Codechef, and Leetcode.


Users can be searched by username/handle.


Features

  • rating, ranking
  • solutions, problems solved by user
  • contests participated by user
  • rating history

Usage

  • get user profile
    https://competeapi.vercel.app/user/<platform>/<username>/
    This will return user info in json format.

Contest Platforms :

  1. codeforces
  2. codechef
  3. leetcode

Use :

User Info

  • get leetcode user info
    https://competeapi.vercel.app/user/leetcode/<username>/
    This will return Leetcode user info in json format.
  • get codechef user info
    https://competeapi.vercel.app/user/codechef/<username>/
    This will return Codechef user info in json format.
  • get codeforces user info
    https://competeapi.vercel.app/user/codeforces/<username>/
    This will return Codeforces user info in json format.

Example

Example request for user info:

[https://competeapi.vercel.app/user/codeforces/bharanispace/
https://competeapi.vercel.app/user/codeforces/bharanispace/

Example response for user info:

[
  {
    "contribution": 0,
    "lastOnlineTimeSeconds": 1660836836,
    "rating": 349,
    "friendOfCount": 1,
    "titlePhoto": "https://cdn-userpic.codeforces.com/no-title.jpg",
    "rank": "newbie",
    "handle": "Bharanispace",
    "maxRating": 349,
    "avatar": "https://cdn-userpic.codeforces.com/no-avatar.jpg",
    "registrationTimeSeconds": 1655563973,
    "maxRank": "newbie"
  },
  {
    "ratings": [
      {
        "contestId": 1701,
        "contestName": "Educational Codeforces Round 131 (Rated for Div. 2)",
        "handle": "Bharanispace",
        "rank": 14409,
        "ratingUpdateTimeSeconds": 1657298100,
        "oldRating": 0,
        "newRating": 349
      }
    ]
  }
]

Contests Info

Upcoming Contests

  • Upcoming Contests of all sites
    https://competeapi.vercel.app/contests/upcoming/
    This will return all future contests

Request

https://competeapi.vercel.app/contests/upcoming/

Response

[
  {
    "site": "codeforces",
    "title": "Codeforces Round #817 (Div. 4)",
    "startTime": 1661870100000,
    "duration": 8100000,
    "endTime": 1661878200000,
    "url": "https://codeforces.com/contest/1722"
  },
  {
    "site": "codechef",
    "title": "Starters 54 (Rated for Div 2, 3 & 4)",
    "startTime": 1661956200000,
    "duration": 10800000,
    "endTime": 1661967000000,
    "url": "https://www.codechef.com/START54"
  }
]
  • get leetcode contests info
    https://competeapi.vercel.app/contests/leetcode/
    This will return Leetcode user info in json format.
  • get codechef contests info
    https://competeapi.vercel.app/contests/codechef/
    This will return Codechef user info in json format.
  • get codeforces contests info
    https://competeapi.vercel.app/contests/codeforces/
    This will return Codeforces user info in json format.

Example

Example request for contests info:

[https://competeapi.vercel.app/contests/leetcode/
https://competeapi.vercel.app/contests/leetcode/

Example response for contests info:

{
  "data": {
    "topTwoContests": [
      {
        "title": "Weekly Contest 308",
        "startTime": 1661653800,
        "duration": 5400,
        "cardImg": null
      },
      {
        "title": "Biweekly Contest 86",
        "startTime": 1662215400,
        "duration": 5400,
        "cardImg": "https://assets.leetcode.com/contest/biweekly-contest-86/card_img_1661011324.png"
      }
    ]
  }
}