LeetCode

Leetcode Contests

Request

Make a GET request to /api/leetcode (opens in a new tab) or /api/6 (opens in a new tab) to get a list of all upcoming Leetcode contests.

Response

{
  "ok": true,
  "data": [
    {
      "title": "Example Contest of LeetCode 1",
      "url": "https://leetcode.com/contest/example-contest",
      "startTime": "2023-12-16T09:42:23Z",
      "endTime": "2023-12-16T10:42:23Z",
      "duration": 3600,
      "platform": "LeetCode"
    },
    {
      "title": "Example Contest of LeetCode 2",
      "url": "https://leetcode.com/contest/example-contest",
      "startTime": "2023-12-16T09:42:23Z",
      "endTime": "2023-12-16T11:42:23Z",
      "duration": 7200,
      "platform": "LeetCode"
    }
  ],
  "lastUpdated": "2023-12-16T09:42:23Z"
}
Response Details
PropertyTypeDescription
okboolWhether the request was successful - true or false
dataarrayData returned from the API (list of contests)
titlestringTitle of the contest
urlstringUrl of the contest
startTimestringStart time of the contest in UTC ISO 8601 format
endTimestringEnd time of the contest in UTC ISO 8601 format
durationintDuration of the contest in seconds
lastUpdatedstringLast time the data was updated