How to bypass CAPTCHAs when scraping: reCAPTCHA, hCaptcha and Turnstile
A CAPTCHA is rarely the real problem. It is a symptom: something earlier in the request made the site doubt you, and the CAPTCHA is the last check before a block. Solve it and the doubt stays.
This guide explains how the three CAPTCHAs you will meet most often decide when to appear, when solving services make sense, and why avoiding the challenge is cheaper and faster than solving it.
How to tell a site uses CAPTCHA
Each of the three loads from its own host, which also tells you whether the widget is interactive or invisible.
| Signal | Where | What it means |
|---|---|---|
| google.com/recaptcha/…/anchor | iframe | reCAPTCHA v2 checkbox. size=invisible in the URL means no checkbox. |
| grecaptcha.execute | Script | reCAPTCHA v3: no widget, a score from 0.0 to 1.0 sent to the site. |
| hcaptcha.com | iframe | hCaptcha checkbox or image challenge. |
| challenges.cloudflare.com/…/turnstile/ | iframe | Cloudflare Turnstile. Usually passes by itself; a visible checkbox means the score is doubtful. |
| Small page built around the widget | HTML | An interstitial. A widget inside a full page is usually just a login or comment form. |
A CAPTCHA script on a page is not a block: ordinary pages load reCAPTCHA for their contact or login forms. Only treat it as a wall when the page is small and built around the widget:
import re
WIDGET = re.compile(r"turnstile|recaptcha|hcaptcha", re.I)
def is_captcha_wall(html: str) -> bool:
# A real interstitial is a thin page; a product page with a
# newsletter form that uses reCAPTCHA is hundreds of KB.
return len(html) < 64_000 and bool(WIDGET.search(html[:20_000]))How CAPTCHA decides you are a bot
Modern CAPTCHAs are mostly risk engines with an optional puzzle. They decide from signals collected before you ever see a challenge.
reCAPTCHA v2 and v3
v2 shows a checkbox and sometimes image grids; v3 shows nothing and gives the site a score. Both lean on browser signals, IP reputation and Google's view of the visitor. A clean browser on a residential IP often passes the checkbox with one click, or v3 with a usable score.
hCaptcha
Similar risk scoring, with image challenges when doubtful. Common on sites that moved away from Google.
Cloudflare Turnstile
Mostly non-interactive: it runs browser checks and passes without a click. We measured it: on a clean exit, a Turnstile that passes does so in tens of milliseconds. One that has not passed after a few seconds does not pass at all on that exit.
What people try, and why it breaks
Solving services (human or AI)
Helps, not enoughThey return a token for a fee per solve and add seconds to every request. They work for a one-off form, but at scale you pay per page for a problem the fingerprint and IP created, and some sites re-challenge immediately.
Clicking the checkbox with automation
Helps, not enoughWorks when the score is already good, which means the checkbox is not the real obstacle.
Waiting longer for the widget
Breaks quicklyIf Turnstile has not passed in a few seconds on that exit, waiting a minute will not help. Change the exit instead.
Better fingerprint and IP
NecessaryThe cheapest CAPTCHA is the one you are never shown.
What actually gets through
The goal is to be scored as a visitor, so the CAPTCHA either never appears or passes on its own.
- 1
Real browser, clean fingerprint
Most CAPTCHA decisions are made from browser signals; a patched real engine scores like a person's browser.
- 2
Residential exits
IP reputation is half the score. Datacenter IPs get far more challenges.
- 3
Give up on an exit quickly
Set a short limit (a few seconds) for an unsolved visible challenge, then retry on a different exit. Long waits only spend your timeout.
- 4
Do not mistake form CAPTCHAs for walls
A reCAPTCHA in the footer of a full page is a form widget. Treat only thin interstitials as blocks.
Getting past CAPTCHA with UnblockingAPI
Send the URL you want. You do not pick a proxy type, a browser or a "premium" mode: the API tries a fast plain fetch with a real Chrome TLS and HTTP/2 fingerprint first, and switches to a real browser on a residential exit when the answer is a block, a challenge or an empty shell. A request that fails is not charged.
curl -G "https://api.unblockingapi.com/unblock" \
-H "X-Api-Key: $UNBLOCKINGAPI_KEY" \
--data-urlencode "url=https://www.example.com/search?q=widgets" \
--max-time 180import os, requests
r = requests.get(
"https://api.unblockingapi.com/unblock",
params={"url": "https://www.example.com/search?q=widgets"},
headers={"X-Api-Key": os.environ["UNBLOCKINGAPI_KEY"]},
timeout=180,
)
result = r.json()
if result["status"] == "succeeded":
print(result["http_response_code"], result["render_reason"])
html = result["response"] # the page itself, not the challenge
else:
print("failed, not charged:", result.get("error"))render_reason in the response says how the page was fetched: plain, fallback:challenge (the plain fetch hit a wall, so a browser took over), replay (a plain fetch carrying the session a browser earned earlier) and so on. What a site needs is learned per site, so the second request to a CAPTCHA site goes straight to whatever worked.
What happens for CAPTCHA specifically
- —UnblockingAPI does not send CAPTCHAs to solving services. A visible, interactive check that has not passed within about eight seconds means that exit has been judged; the attempt is dropped and retried on a different exit, inside the same request.
- —Invisible widgets (reCAPTCHA v3, invisible v2, a Turnstile that is passing) are left to do their work; only a visible, interactive check counts as a challenge.
- —A full page that merely contains a CAPTCHA widget, for a form, is returned as a page. Only thin interstitials built around a widget are treated as blocks.
- —An exit that got a CAPTCHA on a site rests from that site for 30 minutes.
wait_for with a CSS selector of the content, or scroll_steps for lists that grow as you scroll. See the API docs for every option.When it still fails
No tool gets through every CAPTCHA configuration every time, and anyone who promises 100% is guessing. The honest limits:
- —Pages that put an interactive CAPTCHA in front of every visitor, regardless of score. Without a solving service those cannot be read, and UnblockingAPI does not use one.
- —Forms: submitting a form protected by a CAPTCHA is an interaction, not reading a public page.
- —If every attempt inside the request's budget is blocked, you get
status: "failed"and the request costs nothing. You only pay for pages that came back.
Responsible use
Frequently asked questions
For a handful of pages, it can work. At scale it adds cost per request and seconds of latency, and it does not fix the fingerprint or IP that caused the challenge, so you keep paying. Avoiding the challenge is cheaper.
Your browser has a normal fingerprint, a residential IP, history and cookies. Your scraper usually has none of those, so the risk engine asks for proof.
It gives the site a score between 0.0 and 1.0 based on the visitor's signals. The site decides what to do with low scores: block, add a step, or ignore.
No. It avoids them with real browsers on residential exits, abandons an exit that gets an interactive challenge, and retries elsewhere. A request that ends blocked is not charged.
Turnstile is mostly non-interactive and passes for clean browsers within milliseconds. If it does not pass in a few seconds, change the exit. More in the Cloudflare guide.
Try a CAPTCHA-protected URL.
Test the fetching layer before building your parser. Start with 500 free credits and no credit card. See pricing for credits from €5, with no subscription.
One successful request is one credit. No multipliers for rendering, proxies or retries.
Other anti-bot systemsHow anti-bot systems work
Cloudflare
"Just a moment...", error 1020, Turnstile and cf_clearance, and what actually gets through.
DataDome
captcha-delivery.com, the datadome cookie, device checks and why deep links get blocked.
Akamai Bot Manager
_abck and bm_sz cookies, sensor data, "Access Denied" reference pages and sec-cpt.
PerimeterX (HUMAN)
"Press & Hold", _px3 and _pxhd cookies, and why a vendor tag is not a block.
Kasada
x-kpsdk headers, ips.js and proof-of-work: a defence with no CAPTCHA to look at.
AWS WAF Bot Control
aws-waf-token, challenge.js and the 202/405 responses AWS WAF sends instead of the page.
