This project provides a FastAPI-based API to fetch user details from LeetCode, including their global ranking and total problems solved.
- Fetch LeetCode user profile details.
- Fetch the global ranking of a LeetCode user.
- Fetch the total number of problems solved by a LeetCode user, categorized by difficulty.
- URL:
/leetcode/{username}
- Method:
GET
- Description: Fetches the complete profile details of a LeetCode user.
- Response:
{ "username": "user123", "profile": { "realName": "User Name", "aboutMe": "About the user", "school": "User's School", "websites": ["website1", "website2"], "countryName": "Country", "company": "User's Company", "ranking": 12345 }, "submitStats": { "acSubmissionNum": [ { "difficulty": "All", "count": 100, "submissions": 150 }, ] } }
git clone https://github.com/yourusername/leetcode-api.git
cd leetcode-api
python -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
pip install -r requirements.txt
uvicorn main:app --reload
http://localhost:8000/docs
or
http://localhost:8000/redoc
FastAPI
requests
uvicorn
This project is licensed under the MIT License. See the LICENSE file for details.