LeetScan API fetches and displays profile data from LeetCode, allowing developers to access key statistics and recent activities.
LeetScan API is a powerful tool for fetching and analyzing data from LeetCode user profiles. It provides developers, recruiters, and coding enthusiasts with detailed insights into a user's coding activity, problem-solving statistics, and contest performance. This API is designed for easy integration with other systems and offers robust data access features.
- 🔍 Profile Data Retrieval: Fetch comprehensive LeetCode user profiles with detailed problem-solving statistics.
- 📊 Contest and Submission Stats: Access a user's contest rankings, total submissions, and recent activities.
- 🔢 Multiple User Profiles: Fetch data for multiple users in a single request.
- 🔒 Rate Limiting: Built-in rate limiting to handle multiple requests safely and prevent abuse.
- 🔌 Easy Integration: RESTful API that can be integrated into any platform or application.
- 📱 Responsive Documentation: Interactive and mobile-friendly API documentation.
GET /:username
Replace :username
with the LeetCode username.
{
"username": "codingwizard",
"totalSolved": 100,
"totalSubmissions": 150,
"totalQuestions": 1500,
"easySolved": 50,
"totalEasy": 500,
"mediumSolved": 30,
"totalMedium": 750,
"hardSolved": 20,
"totalHard": 250,
"ranking": 5000,
"contributionPoints": 500,
"reputation": 1000,
"submissionCalendar": {...},
"profile": {
"realName": "John Doe",
"aboutMe": "Passionate coder",
"userAvatar": "https://example.com/avatar.jpg",
"location": "New York",
"skillTags": ["Python", "JavaScript", "Algorithms"],
"websites": ["https://johndoe.com"],
"company": "Tech Corp",
"school": "Code University",
"starRating": 4.5
},
"recentSubmissions": [...],
"badges": [...],
"contestRanking": {
"attendedContestsCount": 10,
"rating": 1800,
"globalRanking": 1000,
"totalParticipants": 10000,
"topPercentage": 10,
"badge": {
"name": "Knight",
"icon": "https://example.com/knight.png"
}
}
}
POST /multi
Send a POST request with a JSON body containing an array of usernames:
{
"usernames": ["user1", "user2", "user3"]
}
The response will be an array of profile objects, each following the structure of the single profile response.
- Node.js
- Express.js
- GraphQL for fetching LeetCode data
- HTML/CSS/JavaScript for interactive documentation
Follow these steps to get started with LeetScan API:
-
Clone the repository:
git clone https://github.com/chinxcode/leetScan-api.git
-
Install dependencies:
cd leetScan-api npm install
-
Start the server:
npm start
-
Access the API documentation: Open
http://localhost:8000
in your web browser to view the interactive API documentation. -
Make your first API call:
curl http://localhost:8000/leetcode_username
For more detailed information about the API, including request/response formats and error handling, visit the interactive documentation at the root URL of your deployed API.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
-
devArena Leaderboard:
This leaderboard application leverages the LeetScan API to fetch coding profiles from LeetCode and display relevant statistics. It retrieves data from MongoDB and is built using Express.js with dotenv for environment variables, mongoose for database interactions, and express-rate-limit for rate limiting. Additionally, it includes CORS for unrestricted origins, making it a robust and secure solution for managing developer leaderboards. -
Profile Data Handler:
This backend service integrates the LeetScan API to handle user profile data efficiently. It fetches LeetCode statistics and provides APIs for CRUD operations, enabling seamless data management and integration with other systems. Designed with scalability and performance in mind, it is ideal for managing and analyzing user profiles.
Made with ❤️ by Sachin Sharma