Discover/LeetCode API
live

LeetCode APIleetcode.com

Search LeetCode problems by difficulty, tags, and category. List all programming contests and fetch public user profiles with submission stats via 3 endpoints.

Endpoint health
verified 7d ago
search_problems
list_contests
get_user_profile
3/3 passing latest checkself-healing
Endpoints
3
Updated
22d ago

What is the LeetCode API?

This API exposes 3 endpoints covering LeetCode's problem bank, contest schedule, and public user profiles. Use search_problems to filter the full problem set by difficulty, topic tags like dynamic-programming or hash-table, and category slugs such as algorithms or database. The response includes each problem's acceptance rate, paidOnly flag, topic tags, and frontend question ID — enough to build a problem-picker, study tracker, or contest-prep tool.

Try it
Number of problems to skip for pagination (offset).
Comma-separated topic tag slugs to filter by (e.g. 'array,hash-table,dynamic-programming').
Maximum number of problems to return per page.
Search keyword to filter problems by title (e.g. 'two sum', 'binary tree').
Category slug filter. Accepts: algorithms, database, shell, concurrency. Empty string returns all categories.
Difficulty filter. Accepts exactly one of: EASY, MEDIUM, HARD. Case-insensitive input is uppercased internally.
api.parse.bot/scraper/e4e91877-8a33-4462-b5ed-1a5cd60da1f0/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/e4e91877-8a33-4462-b5ed-1a5cd60da1f0/search_problems?skip=0&tags=array&limit=5&keyword=two+sum&category=algorithms&difficulty=EASY' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace leetcode-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""
LeetCode API — search problems, list contests, look up user profiles.
"""

from parse_apis.leetcode_api import LeetCode, Problem, Contest, UserProfile, Difficulty

leetcode = LeetCode()

# Search for easy array problems
for problem in leetcode.problems.search(keyword="two sum", difficulty=Difficulty.EASY):
    print(problem.title, problem.ac_rate, problem.difficulty, problem.title_slug)
    for tag in problem.topic_tags:
        print("  tag:", tag.name, tag.slug)

# List all contests
for contest in leetcode.contests.list(limit=5):
    print(contest.title, contest.start_time, contest.duration, contest.contains_premium)

# Fetch a user profile by username
user = leetcode.userprofiles.get(username="neal_wu")
print(user.username, user.profile.ranking, user.profile.country_name)
for stat in user.submit_stats_global.ac_submission_num:
    print(stat.difficulty, stat.count, stat.submissions)
All endpoints · 3 totalmissing one? ·

Search and filter LeetCode problems. Supports keyword search, difficulty filtering, topic tag filtering, category filtering, and offset-based pagination. Returns problems sorted by question number. Each problem includes acceptance rate, difficulty, question ID, paid-only status, title, slug, and topic tags.

Input
ParamTypeDescription
skipintegerNumber of problems to skip for pagination (offset).
tagsstringComma-separated topic tag slugs to filter by (e.g. 'array,hash-table,dynamic-programming').
limitintegerMaximum number of problems to return per page.
keywordstringSearch keyword to filter problems by title (e.g. 'two sum', 'binary tree').
categorystringCategory slug filter. Accepts: algorithms, database, shell, concurrency. Empty string returns all categories.
difficultystringDifficulty filter. Accepts exactly one of: EASY, MEDIUM, HARD. Case-insensitive input is uppercased internally.
Response
{
  "type": "object",
  "fields": {
    "total": "integer - total number of problems matching the filters",
    "questions": "array of Problem objects with acRate, difficulty, frontendQuestionId, paidOnly, title, titleSlug, topicTags"
  },
  "sample": {
    "data": {
      "total": 410,
      "questions": [
        {
          "title": "Two Sum",
          "acRate": 57.6,
          "paidOnly": false,
          "titleSlug": "two-sum",
          "topicTags": [
            {
              "name": "Array",
              "slug": "array"
            },
            {
              "name": "Hash Table",
              "slug": "hash-table"
            }
          ],
          "difficulty": "Easy",
          "frontendQuestionId": "1"
        }
      ]
    },
    "status": "success"
  }
}

About the LeetCode API

Problem Search

The search_problems endpoint accepts up to six filter parameters: keyword (title substring match), difficulty (EASY, MEDIUM, or HARD), tags (comma-separated tag slugs, e.g. array,binary-search), category (one of algorithms, database, shell, concurrency), and skip/limit for offset-based pagination. The response includes a total count of matching problems alongside a questions array. Each question object carries frontendQuestionId, title, titleSlug, difficulty, acRate (acceptance rate as a float), paidOnly (boolean), and a topicTags array with tag names and slugs.

Contests

list_contests returns the complete history of LeetCode weekly and biweekly contests — no filters, no pagination. Every contest object includes title, titleSlug, startTime (Unix timestamp), duration in seconds, originStartTime, and a containsPremium flag. The full list is returned in a single response sorted most-recent first, making it straightforward to identify upcoming or recently completed rounds.

User Profiles

get_user_profile takes a single required username parameter and returns public profile data. The profile object contains realName, aboutMe, userAvatar, reputation, ranking, company, school, websites, countryName, and skillTags. Submission statistics live in submitStatsGlobal, which holds an acSubmissionNum array broken out by difficulty level. If the username does not exist, the endpoint returns a stale_input response with kind input_not_found rather than an HTTP error.

Reliability & maintenanceVerified

The LeetCode API is a managed, monitored endpoint for leetcode.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when leetcode.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official leetcode.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
7d ago
Latest check
3/3 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a spaced-repetition study tool that surfaces unsolved MEDIUM and HARD problems filtered by a specific topic tag like graph or tree.
  • Generate a contest calendar by pulling startTime and duration from list_contests and syncing entries to a personal calendar.
  • Rank candidates in a hiring pipeline by comparing ranking and per-difficulty acSubmissionNum values from their LeetCode profiles.
  • Track a user's global ranking over time by periodically polling get_user_profile and storing the ranking field.
  • Filter premium-only problems using the paidOnly field from search_problems to show only freely accessible content.
  • Identify problems with low acceptance rates by sorting results from search_problems on the acRate field for advanced challenge sets.
  • Display a contributor's skillTags, company, and school on a developer portfolio page using data from get_user_profile.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does LeetCode have an official developer API?+
LeetCode does not publish an official public REST API or developer documentation. There is no official API key or OAuth flow available to third-party developers.
What does the `search_problems` endpoint return for problems that require a paid subscription?+
Each problem object includes a paidOnly boolean. When paidOnly is true, the problem is only accessible to LeetCode Premium subscribers. The endpoint returns the metadata — title, difficulty, tags, acceptance rate — for both free and premium problems, so you can filter or label them as needed.
Does `list_contests` support filtering by contest type (weekly vs. biweekly) or by date range?+
No filters are currently supported. The endpoint returns all contests in a single response sorted most-recent first. You can differentiate weekly from biweekly contests by parsing the title or titleSlug fields client-side. If you need server-side filtering or date-range slicing, you can fork the API on Parse and revise it to add those parameters.
Does the API return a user's full submission history or individual solution code?+
No. get_user_profile returns aggregate accepted submission counts broken down by difficulty via submitStatsGlobal.acSubmissionNum. Individual submission records, solution code, and problem-by-problem solve history are not exposed. You can fork the API on Parse and revise it to add an endpoint covering submission details if that data becomes accessible.
How should I handle a username that doesn't exist when calling `get_user_profile`?+
The endpoint returns a structured stale_input response with kind: input_not_found rather than an HTTP 404. Your client code should check for this response shape rather than relying solely on HTTP status codes to detect missing usernames.
Page content last updated . Spec covers 3 endpoints from leetcode.com.
Related APIs in Developer ToolsSee all →
codechef.com API
Access competitive programming data from CodeChef by retrieving problem lists, contest information with details, user profiles, and recent submission history. Explore coding challenges across multiple contests and browse problems by difficulty rating.
neetcode.io API
Access curated coding problem collections including Core Skills, Blind 75, NeetCode 150, and NeetCode 250, along with detailed problem solutions and course content organized by chapters and lessons. Perfect for preparing for technical interviews and mastering data structures and algorithms through structured learning paths.
cses.fi API
Explore the CSES Problem Set by browsing problems across different categories, viewing detailed problem information, and discovering available courses and contests. Access comprehensive problem lists organized by topic to find coding challenges tailored to your learning goals.
hackerrank.com API
Retrieve challenge scores, difficulty ratings, success ratios, and track-level ranking data from HackerRank's public practice platform. Browse challenges by track, view submission statistics, and access ranking metrics across all available tracks.
linkedin.com API
Search LinkedIn job listings by job type, experience level, workplace type, salary range, and date posted, then retrieve detailed information about specific positions. Build job boards, career tools, or recruitment dashboards with access to comprehensive filtering options across LinkedIn's public job listings.
devpost.com API
Search and discover hackathons on Devpost by filtering based on status, keywords, and sorting options like prize money or submission deadlines. Find the perfect hackathon competition that matches your interests and timeline.
quizbowlpackets.com API
Search and browse thousands of quizbowl question sets across all competition levels, then access detailed metadata like difficulty, subjects, and download links for each packet. Find the perfect practice materials for High School, Collegiate, Middle School, or Pop Culture quizbowl competitions.
takeuforward.org API
Access Striver's complete A2Z and SDE DSA sheets along with detailed problem information and TUF+ subscription pricing directly from takeuforward.org. Streamline your interview preparation by retrieving curated coding problems, their solutions, and course pricing all in one place.