It's a custom leetcode API to retrieve user profile and question details.
1.9K
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.
https://alfa-leetcode-api.onrender.com/
docker run -p 3000:3000 alfaarghya/alfa-leetcode-api:2.0.1
follow this documentation => CONTRIBUTING.mdโ
I've implemented a rate limit to prevent any potential server overload issues.
During development, it's recommended to utilize the API locally. To do so, follow this documentation => Local Deployโ
| Details | Endpoint | Description | Demo |
|---|---|---|---|
| Profile | /:username | Get details about a user's profile. | click hereโ |
| Badges | /:username/badges | Get the badges earned by the user. | click hereโ |
| Solved | /:username/solved | Get the total number of questions solved by the user. | click hereโ |
| Contest | /:username/contest | Get details about the user's contest participation. | click hereโ |
| Contest History | /:username/contest/history | Get contest history. | click hereโ |
| Submission | /:username/submission | Get the last 20 submissions of the user. | click hereโ |
| Limited Submission | /:username/submission?limit=number | Get a specified number of the user's last submissions. | click hereโ |
| Accepted Submission | /:username/acSubmission | Get the last 20 accepted submission of the user. | click hereโ |
| Limited Accepted Submission | /:username/acSubmission?limit=7 | Get a specified number of the user's last accepted submission. | click hereโ |
| Calendar | /:username/calendar | Get the user's submission calendar. | click hereโ |
| Details | Endpoint | Description |
|---|---|---|
| Full Profile | /userProfile/:username | get full profile details in one call |
| Year Calender | /userProfileCalendar?username=yourname&year=2024 | get your calendar details with year |
| Lang Stats | /languageStats?username=yourname | get the language stats of a user |
| Question Progress | /userProfileUserQuestionProgressV2/:userSlug | get your question progress |
| Skill Stats | /skillStats/:username | get your skill stats |
| User Contest Ranking | /userContestRankingInfo/:username | get contest ranking |
| Trending Discussion | /trendingDiscuss?first=20 | get top 20 trending discussions |
| Discussion Topic | /discussTopic/:topicId | get discussion topic |
| Discussion Comment | /discussComments/:topicId | get discussion comments |
| Raw Daily Problem | /dailyQuestion | get raw daily question |
| Details | Endpoint | Description | Demo |
|---|---|---|---|
| Daily Problem | /daily | Get the daily question. | click hereโ |
| Selected Problem | /select?titleSlug=selected-question | Get details about a selected-question. | click hereโ |
| Problems | /problems | Get a list of 20 problems. | click hereโ |
| Limited Problems | /problems?limit=number | Get a list of a specified number of problems. | click hereโ |
| Filter Problems | /problems?tags=tag1+tag2 | Get a list of problems based on selected tags. | click hereโ |
| Skip Problems | /problems?skip=number | Get a list of 20 problems, skipping a specified number of problems. | TODO |
| Filter & Limited Problems | /problems?tags=tag1+tag2+tag3&limit=number | Get a list of a specified number of problems based on selected tags. | click hereโ |
| Skip & Limited Problems | /problems?limit=number&skip=number | Get a list of a specified number of problems skipping a specified number of problems. | TODO |
| Skip & Filter & Limited Problems | /problems?tags=tag1+tag2+tag3&limit=number&skip=number | Get a list of a specified number of problems based on selected tags skipping a specified number of problems. | TODO |
| Contributor | Contribution |
|---|---|
| @aryanpingleโ | AC submission |
| @jamesh48โ | TypeScript Refactoring |
| @kvqnโ | PORT environment variable |
| @changchunleiโ | New Endpoints - language stats, integrated user profile, contest and discussions |
| @merakesh99โ | Hot reload issue solved |
| @ajchiliโ | Skip param to fetch problems |
| @theinit01โ | Temp fix for skip |
Content type
Image
Digest
sha256:12064546cโฆ
Size
68.5 MB
Last updated
6 months ago
docker pull alfaarghya/alfa-leetcode-api:2.0.4