Welcome to the documentation for the unofficial LeetCode API. This API allows you to fetch various details about LeetCode users, including profiles, badges, skill statistics, and more. You can integrate this data into your applications to provide insights and analytics about LeetCode users.
The base URL for the API is
https://leetcode-api.snehkr.in. All endpoints are
relative to this base URL.
CLICK HERE FOR TESTING
Endpoint:
/api/?user={user}&query={query}
user (path parameter): The username of the LeetCode
user (string).
query (path parameter): The type of information you
want to retrieve (string).
curl -X GET "https://leetcode-api.snehkr.in/api/?user=snehkr&query=userPublicProfile"
userPublicProfile : Fetches the public profile of the
user, including details like name, about section, profile picture,
and other publicly visible data.
userBadges : Retrieves the badges that the user has
earned on LeetCode.
skillStats : Provides statistics on the user's skills,
including problem-solving abilities in different categories such as
algorithms, data structures, and more.
languageStats : Shows the user's proficiency in
different programming languages based on the number of problems
solved using each language.
recentAcSubmissions : Retrieves a list of the user's
most recent accepted submissions, including problem titles and
submission times.
userProfileCalendar : Shows the user's submission
calendar, detailing the number of problems solved each day.
userContestRankingInfo : Provides information about the
user's contest rankings, including their global and regional ranks,
and contest history.
userProfileUserQuestionProgressV2 : Retrieves the
user's progress on various LeetCode questions, including those
attempted, solved, and not started.
Endpoint:
/api/?query={query}&slug={slug}
query (path parameter): The type of information you
want to retrieve (string).
slug (path parameter): The slug identifier for a
specific question or user-related data (string).
curl -X GET "https://leetcode-api.snehkr.in/api/?query={query}&slug={slug}"
questionOfToday : Fetches the "Question of the Day"
from LeetCode, which is a daily featured problem for users to solve.
curl -X GET "https://leetcode-api.snehkr.in/api/?query=questionOfToday"
questionContent : Retrieves the full content of a
specific question, including the problem statement, constraints,
example test cases, and hints if available.
two-sum,
add-two-numbers, etc.
curl -X GET "https://leetcode-api.snehkr.in/api/?query=questionContent&slug={slug}"
problemsetQuestionList : Provides a list of questions
within a specific problem set, typically categorized by difficulty,
topic, or other filters.
all-code-essentials,
algorithms, shell,
concurrency, javascript, etc.
curl -X GET "https://leetcode-api.snehkr.in/api/?query=problemsetQuestionList&slug={slug}"