Sign inSign up

alfaarghya/alfa-leetcode-api

By alfaarghya

โ€ขUpdated 6 months ago

It's a custom leetcode API to retrieve user profile and question details.

Image
Web servers
1

1.9K

alfaarghya/alfa-leetcode-api repository overview

โ alfa-leetcode-api

โ The API for retrieving your LeetCode profile & Problems statistics

TypeScript Node.js Express.js REST API

โ 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.1

โ Wanna Contribute ๐Ÿค”??

follow this documentation => CONTRIBUTING.mdโ 

โ ๐Ÿ’ก 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, follow this documentation => Local Deployโ 

โ Endpoints ๐Ÿš€

โ ๐Ÿ‘คUser Details
DetailsEndpointDescriptionDemo
Profile/:usernameGet details about a user's profile.click 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 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โ 
โ ๐Ÿ˜€ New Endpoints ๐ŸŽ‰
DetailsEndpointDescription
Full Profile/userProfile/:usernameget full profile details in one call
Year Calender/userProfileCalendar?username=yourname&year=2024get your calendar details with year
Lang Stats/languageStats?username=yournameget the language stats of a user
Question Progress/userProfileUserQuestionProgressV2/:userSlugget your question progress
Skill Stats/skillStats/:usernameget your skill stats
User Contest Ranking/userContestRankingInfo/:usernameget contest ranking
Trending Discussion/trendingDiscuss?first=20get top 20 trending discussions
Discussion Topic/discussTopic/:topicIdget discussion topic
Discussion Comment/discussComments/:topicIdget discussion comments
Raw Daily Problem/dailyQuestionget raw daily question
โ โ“Questions Details
DetailsEndpointDescriptionDemo
Daily Problem/dailyGet the daily question.click hereโ 
Selected Problem/select?titleSlug=selected-questionGet details about a selected-question.click 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.TODO
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.TODO
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.TODO

โ Author โœ’๏ธ

โ Contributor โœ๏ธ

ContributorContribution
@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

โ Connect with me ๐Ÿ“ฒ

LinkedIn Twitter Instagram LeetCode

Tag summary

Content type

Image

Digest

sha256:12064546cโ€ฆ

Size

68.5 MB

Last updated

6 months ago

docker pull alfaarghya/alfa-leetcode-api:2.0.4