README.md

April 14, 2026 · View on GitHub

alfa-leetcode-api

The API for retrieving your LeetCode profile & Problems statistics

About ✨

At First, I struggled to find proper documentation for the leetcode.com/graphql. After scouring various articles about the LeetCode public API, I still couldn't find the comprehensive documentation I was looking for. Fueled by the desire to fill this gap I created alfa-leetcode-api.

alfa-leetcode-api is a custom solution born out of the need for a well-documented and detailed LeetCode API. This project is designed to provide developers with endpoints that offer insights into a user's profile, badges, solved questions, contest details, contest history, submissions, and also daily questions, selected problem, list of problems.

API URL 🌐

https://alfa-leetcode-api.onrender.com/

Run with docker 🐳

docker run -p 3000:3000 alfaarghya/alfa-leetcode-api:2.0.4

Endpoints 🚀

👤User Details

DetailsEndpointDescriptionDemo
Profile/:usernameGet details about a user's profile.click here
Full Profile/:username/profileGet full profile details in one callclick here
Badges/:username/badgesGet the badges earned by the user.click here
Solved/:username/solvedGet the total number of questions solved by the user.click here
Contest/:username/contestGet details about the user's contest participation.click here
Contest History/:username/contest/historyGet all contest history.click here
Submission/:username/submissionGet the last 20 submissions of the user.click here
Limited Submission/:username/submission?limit=numberGet a specified number of the user's last submissions.click here
Accepted Submission/:username/acSubmissionGet the last 20 accepted submission of the user.click here
Limited Accepted Submission/:username/acSubmission?limit=7Get a specified number of the user's last accepted submission.click here
Calendar/:username/calendarGet the user's submission calendar.click here
Calendar with year/:username/calendar?year=2025Get the user's submission calendar with year queryclick here
Skill Stats/:username/skillGet the user's skill stats.click here
Lang Stats/:username/languageGet the language stats of a userclick here
Question Progress/:username/progressGet your question progressclick here

❓Questions Details

DetailsEndpointDescriptionDemo
Daily Problem/dailyGet the daily question.click here
Daily Problem Raw/daily/rawGet the daily question in raw.click here
Selected Problem/select?titleSlug=selected-questionGet details about a selected-question.click here
Raw Selected Problem/select/raw?titleSlug=selected-questionGet raw selected questionclick here
Problems/problemsGet a list of 20 problems.click here
Limited Problems/problems?limit=numberGet a list of a specified number of problems.click here
Filter Problems/problems?tags=tag1+tag2Get a list of problems based on selected tags.click here
Skip Problems/problems?skip=numberGet a list of 20 problems, skipping a specified number of problems.click here
Difficulty/problems?difficulty=EASYGet a list of difficulty based problems, use MEDIUM to get medium level, HARD to get Hard level .click here
Filter & Limited Problems/problems?tags=tag1+tag2+tag3&limit=numberGet a list of a specified number of problems based on selected tags.click here
Skip & Limited Problems/problems?limit=number&skip=numberGet a list of a specified number of problems skipping a specified number of problems.click here
Skip & Filter & Limited Problems/problems?tags=tag1+tag2+tag3&limit=number&skip=numberGet a list of a specified number of problems based on selected tags skipping a specified number of problems.click here
Official Solution/officialSolution?titleSlug=selected-questionGet the official solution(leetcode) for a questionclick here

🏆 Contests

DetailsEndpointDescriptionDemo
All Contests/contestsGet all the contestsclick here
Upcoming Contests/contests/upcomingGet the upcoming contests.click here

🗪 Discussion

DetailsEndpointDescriptionDemo
Trending Discussion/trendingDiscuss?first=20Get top 20 trending discussionsclick here
Discussion Topic/discussTopic/:topicIdGet discussion topicclick here
Discussion Comment/discussComments/:topicIdGet discussion commentsclick here

💡 Rate Limit

I've implemented a rate limit to prevent any potential server overload issues.

‼️ Note

During development, it's recommended to utilize the API locally. To do so, you can use docker image of our api.

MCP server integration 🤖

Follow this documentation MCP.md

Wanna Contribute 🤔??

Follow this documentation CONTRIBUTING.md

Author ✒️

Contributor ✏️

ContributorContribution
@aryanpingleAC submission
@jamesh48TypeScript Refactoring
@kvqnPORT environment variable
@changchunleiNew Endpoints - language stats, integrated user profile, contest and discussions
@merakesh99Hot reload issue solved
@ajchiliSkip param to fetch problems
@theinit01Temp fix for skip
@sazsuDocs improvements (capitalization, clarity, typo fixes)
@123xylemAdd Descriptions and Methods to API route documentation.
@P-M-ManmohanAdded filtering based on difficulty
@Ar0manKhanRaw selected question API (/select/raw)
@Ahmed-ArmaanUpdate DOCS example with images
@Ayushman2004Contest API endpoints
@devroopsaha744MCP server
@nickbar01234Added Zod schema for contest route
@DarrylMathiasUpdated demo images and typo fixes
@Morgan-NgetichAdded Swagger documentation

Connect with me 📲

LinkedIn Twitter Instagram LeetCode