This API provides access to LeetCode user statistics and submission data. Click on each endpoint to see details.
/{username}
username
(path parameter): LeetCode username
{
"status": "success",
"message": "retrieved",
"totalSolved": 100,
"totalQuestions": 2000,
"easySolved": 40,
"totalEasy": 500,
"mediumSolved": 40,
"totalMedium": 1000,
"hardSolved": 20,
"totalHard": 500,
"acceptanceRate": 65.5,
"ranking": 100000,
"contributionPoints": 50,
"reputation": 100,
"submissionCalendar": {"timestamp": "count"}
}
GET /khan-tashif
/{username}/contests
username
(path parameter): LeetCode username
{
"status": "success",
"message": "retrieved",
"attendedContestsCount": 10,
"rating": 1500,
"globalRanking": 5000,
"totalParticipants": 100000,
"topPercentage": 5.00,
"badge": {
"name": "Guardian"
},
"contestHistory": [
{
"attended": true,
"rating": 1500,
"ranking": 1000,
"trendDirection": "UP",
"problemsSolved": 3,
"totalProblems": 4,
"finishTimeInSeconds": 3600,
"contest": {
"title": "Weekly Contest 123",
"startTime": 1615694400
}
}
]
}
GET /khan-tashif/contests
/{username}/profile
username
(path parameter): LeetCode username
{
"status": "success",
"message": "retrieved",
"username": "example_user",
"githubUrl": "https://github.com/example",
"twitterUrl": "https://twitter.com/example",
"linkedinUrl": "https://linkedin.com/in/example",
"contributions": {
"points": 100,
"questionCount": 5,
"testcaseCount": 10
},
"profile": {
"realName": "Example User",
"userAvatar": "https://assets.leetcode.com/avatar.jpg",
"birthday": "2000-01-01",
"ranking": 10000,
"reputation": 100,
"websites": ["https://example.com"],
"countryName": "United States",
"company": "Example Corp",
"school": "Example University",
"skillTags": ["Python", "Algorithms"],
"aboutMe": "LeetCode enthusiast",
"starRating": 4.5
},
"badges": [...],
"upcomingBadges": [...],
"activeBadge": {...},
"submitStats": {...},
"submissionCalendar": {"timestamp": "count"},
"recentSubmissions": [...]
}
GET /khan-tashif/profile
/{username}/badges
username
(path parameter): LeetCode username
{
"status": "success",
"message": "retrieved",
"badges": [
{
"id": "1",
"displayName": "Problem Solver",
"icon": "badge-icon-url",
"creationDate": 1609459200
}
],
"upcomingBadges": [
{
"name": "Fast Coder",
"icon": "upcoming-badge-icon-url"
}
],
"activeBadge": {
"id": "1",
"displayName": "Problem Solver",
"icon": "badge-icon-url",
"creationDate": 1609459200
}
}
GET /khan-tashif/badges
{
"status": "error",
"message": "user does not exist",
...
}
{
"status": "error",
"message": "error message",
...
}
Please be mindful of LeetCode's rate limiting policies when using this API.