This project demonstrates how to interact with the LeetCode API to fetch user profiles and recent submissions using Python and make an internal LeaderBoard based on LeetCode data. The code is structured to handle authentication, fetch data, and process it into a usable format.
- Fetch user profile data from LeetCode
- Retrieve recent accepted submissions for multiple users
- Handle and process JSON responses from the LeetCode GraphQL API
- Aggregate and analyze user data
Together with my supervisor Reza Shokrzad (rezashokrzad), we created an internal leaderboard for our community, DSLanders at Cafetadris(cafetadris). This leaderboard uses LeetCode data to rank users based on their performance in terms of best runtime and memory usage for each LeetCode problems. Additionally, users earn extra points for giving presentations about a LeetCode problems or related concepts such as Algorithms or Data Structures for specific problems (DSLanders LeetCode Leaderboard).
The project utilizes the GraphQL API from (alfaarghya) user on GitHub to fetch user profile and recent submission data from LeetCode.
Before running the code, ensure you have the following installed:
- Python 3.x
- Required Python packages (can be installed via
pip
)
First, click the "Fork" button at the top right of the page to create a copy of the repository under your own GitHub account; then:
- Clone the repository:
git clone https://github.com/yourusername/LeetCode-LeaderBoard-API.git
- Change to the project directory:
cd LeetCode-LeaderBoard-API
- Install the required packages:
pip install -r requirements.txt
Feel free to connect with me on: