Discover/leetcode.com API
live

leetcode.com 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.

Endpoints
3
Updated
24d ago
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 retu
Difficulty filter. Accepts exactly one of: EASY, MEDIUM, HARD. Case-insensitive input is u
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.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/e4e91877-8a33-4462-b5ed-1a5cd60da1f0/search_problems?skip=0&limit=5&keyword=two+sum&difficulty=HARD' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 3 totalclick to expand

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.

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'). Tag slugs match the slug field in topicTags from problem results.
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": 405,
      "questions": [
        {
          "title": "Two Sum",
          "acRate": 57.47,
          "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.com 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.

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.

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,000250 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 →
arxiv.org API
Search and discover academic research papers on arXiv using keywords, authors, titles, categories, and dates, then access detailed metadata for any paper. Browse the complete arXiv category taxonomy to explore research across different scientific disciplines.
sketchfab.com API
Search and browse 3D models on Sketchfab, including filtering by category, license, animation, and downloadability. Retrieve detailed model metadata, creator profiles, collections, thumbnails, tags, and viewer configuration options.
theresanaiforthat.com API
Search and discover AI tools across different tasks, get detailed information about specific tools, browse available deals, and stay updated on the latest tools. Find the perfect AI solution for your needs by filtering by task category or checking featured and trending tools.
oeis.org API
Search OEIS for integer sequences by keyword, A-number, or known terms, then retrieve full sequence entries and b-file term data.
duden.de API
Get German verb conjugations, parts of speech, and usage frequency from Duden's comprehensive database. Quickly look up how to conjugate any German verb across all tenses and moods.
nvidia.com API
nvidia.com API
alienvault.com API
Search and analyze global threat intelligence data including indicators of compromise, threat pulses, and adversary profiles from the Open Threat Exchange community. Monitor recent security alerts and access detailed information about threats and adversaries to strengthen your cybersecurity defenses.
mvnrepository.com API
Search Maven artifacts and retrieve detailed information about Java libraries, including artifact details, relocation notices, and popular package rankings. Find the exact dependencies you need and discover trending open-source projects in the Maven ecosystem.