LeetCode Scraper.
Problems and solutions, fully rendered.
Send any LeetCode URL and get the fully rendered HTML back, through residential proxies with anti-bot handling built in.
Or pull structured JSON with the leetcode-serp, leetcode-problem, leetcode-solutions and leetcode-solution scrapers.
Four LeetCode scrapers. One clean JSON each.
The four LeetCode scrapers, typed live. leetcode-solution pulls one community write-up with its code blocks, leetcode-serp reads the problem set, leetcode-problem returns a single problem with its statement and starter code, and leetcode-solutions reads a solutions tab. Switch tabs, or hover to pause and read.
One API, every corner of LeetCode.
Four dedicated scrapers cover the pages that matter: the problem set, single problems, solutions tabs and single write-ups. The Crawling API renders each page in a real browser, reaches it through residential IPs, and hands you clean HTML or JSON.
The whole catalogue
leetcode-serp turns a problem set page into JSON: totalProblems and problemCount, plus every row with its id, title, titleSlug, url, difficulty, acceptance rate, premium flag and daily-challenge flag.
Statements and starter code
leetcode-problem returns one problem with its statement as HTML and plain text, difficulty, category, topic tags, hints, example testcases, a starter snippet for every language LeetCode ships, similar questions and its like, dislike and submission counters.
The solutions tab
leetcode-solutions returns a solutions tab as JSON, each post with its id, title, url, author name and username, posted date, tags, upvotes, views and comment count.
Single solutions
Add scraper=leetcode-solution to return one write-up with its author, posted date, tags, engagement counters, the body as HTML and plain text, and every rendered code block with its language.
140M residential IPs
Every request rotates a residential IP across 30 geographies and clears bot checks automatically. Nothing to solve, nothing to maintain.
One API for every page
The Crawling API works on any URL, so the same token covers every LeetCode problem and solution and everything else you crawl. See the live demo.
Every problem field, as clean JSON.
Send a problem URL with scraper=leetcode-problem and the problem comes back as typed JSON, topic tags and starter code included. Swap in leetcode-serp, leetcode-solutions or leetcode-solution for the problem set and community write-ups.
Problem
url · string id · string title · string titleSlug · string
Statement
description · string descriptionHtml · string hints · array exampleTestcases · array
Topics & code
topicTags[].name · string topicTags[].slug · string codeSnippets[].languageSlug · string codeSnippets[].code · string
Engagement
likes · number dislikes · number submissionCount · number acceptanceRate · string
Related
similarQuestions[] · array officialSolution.available · boolean officialSolution.hasVideo · boolean solutionsUrl · string
From URL to data in one call.
Every LeetCode request moves through the same path. You send a URL, we operate everything in between.
Send the URL
Pass any public LeetCode URL with your token: the problem set, a problem, a solutions tab or a single write-up.
Rotate a proxy
A residential IP and geography that reach the site cleanly, drawn from 140M IPs across 30 regions.
Render the page
A real browser loads the page so the problem table, statement panel and solution body render before capture.
Clear anti-bot
The site's bot checks and rate limits are handled automatically. Nothing to solve, nothing to maintain.
Return HTML or JSON
The fully rendered HTML comes back, or typed JSON when you add leetcode-serp, leetcode-problem, leetcode-solutions or leetcode-solution.
What teams build on LeetCode data.
Problem set indexing
Walk the problem set page by page to build a searchable index of every problem with its id, slug, difficulty, acceptance rate and premium flag.
Interview prep tooling
Pull statements, hints, example testcases and starter snippets to power practice apps, spaced-repetition decks and internal prep tracks.
Model and agent evaluation
Assemble problem statements with their example testcases and reference write-ups as a graded benchmark set for code-generation models.
Solution and pattern mining
Collect solutions tabs and single write-ups to see which approaches, languages and data structures the community actually converges on.
Difficulty and popularity tracking
Track acceptance rates, likes, dislikes, submission counts, upvotes and views over time to see which problems and write-ups gain traction.
Any URL, one API
Crawl the problem set, problems, solutions tabs and single write-ups, plus any other site you need.
Good to know when scraping LeetCode.
HTML by default, JSON on request
You get the full rendered HTML. Add scraper=leetcode-serp, leetcode-problem, leetcode-solutions or leetcode-solution for parsed JSON, or parse the HTML yourself.
The daily challenge is an extra row
LeetCode pins the daily challenge above the table, so a full page comes back with one row more than the page size. It is the only row with isDailyQuestion set to true, so filter on that flag rather than on position.
Premium problems return metadata only
A premium problem keeps its identity fields, isPremium and its topic tags, but the statement and counters are behind the paywall and come back empty. Check isPremium before you treat an empty description as a parse failure.
Counters come as displayed
LeetCode abbreviates anything above a thousand on the page, so 11.9K is expanded back to 11900. The value carries the precision of the page, not the exact figure.
Built to crawl LeetCode at scale.
The Crawling API runs on the same network that serves 46,000+ paying customers and 70,000+ developers. No proxies to buy, no browsers to run, nothing to patch when the site changes.
One token, official SDKs for Python, Node and Ruby, and a 99.99% uptime network underneath.
LeetCode scraping questions.
Start scraping LeetCode.
Skip the proxies and rate limits.
Free to begin with up to 20,000 requests. One token for the Crawling API and every scraper.