When Bright Data's Web Unlocker does not get you past Cloudflare, the response tells you who failed. If it carries an x-brd-error header, the unlock attempt failed: a 502 with reject_block means a CAPTCHA or protection page was found, and Bright Data says to retry, since each attempt uses a different peer. If there is no x-brd-error header, the status and body come from the target site itself. Retry only the codes Bright Data marks as retryable, give the client at least 180 seconds, and do not send your own cookies or headers unless custom features are enabled. If Cloudflare's challenge is the only obstacle and you fetch many pages per site, a solver that returns a cf_clearance cookie for your own client can be cheaper.
Error codes, headers and prices below come from Bright Data's documentation and pricing page (checked 2026-12-01). Web Unlocker handles proxies, fingerprints, rendering and CAPTCHA solving across many sites, so this guide only covers the Cloudflare case.
Quick answer: Web Unlocker errors on Cloudflare sites
Every Web Unlocker error has an x-brd-error header; most also carry a machine-readable code in x-brd-error-code (unlocker level) or x-brd-err-code (proxy level). Branch on the code, not the message.
- 502 reject_block
- "captcha or protection page found": the attempt ended on a challenge or block page. Retry; each attempt uses a different peer.
- 502 resolve_failed_*
- A CAPTCHA solve was attempted but did not complete. Retry. If one URL keeps failing, report it to support with the req_id.
- 502 http_status
- The target returned a blocking HTTP status, including its own 429. Retry once; if it persists, contact support with the req_id.
- 502 expect_element / navigation_timeout / domcontentloaded_event_timeout
- A selector wait timed out, or the rendered page did not finish loading in time. Allow at least 180 seconds on the client side; report persistent URLs with the req_id.
- 429 sr_rate_limit
- "The request was auto-throttled due to low success rate". Contact Bright Data support; retrying harder will not help.
- 400 premium
- "Targeting %HOST% requires Premium permissions." Enable Premium domains in the zone. Bright Data says Premium domains are deprecated and not offered to customers who signed up after 20 May 2026.
- 400 feature_not_active
- You sent a custom feature (for example the x-unblock-expect header) that is not enabled on the zone. Enable the feature or remove the header. Custom features switch the zone to 100% billing.
- 400 ub_bad_endpoint_robots
- The path is disallowed by robots.txt in immediate access mode. Complete KYC verification or ask your account manager for full access.
- 407 client_10000 / client_10002 / 403 client_10090
- Wrong zone password or customer ID, zone not found, or a Browser API zone used for Web Unlocker. Check the credentials and use an active Web Unlocker zone.
- Cloudflare 403 page with no x-brd-error header
- This response came from the target site, not from Web Unlocker. Compare with a browser from the same country; check that you are not forcing headers or cookies that Web Unlocker ignores.
Why Cloudflare still shows up through Web Unlocker
Web Unlocker manages the whole unblocking process itself: "By default, Web Unlocker API automatically manages all request headers, cookies, expect elements etc." and it also solves CAPTCHAs by default. When Cloudflare still gets in the way, it is usually one of these:
- A single failed attempt. reject_block and resolve_failed_* are per-attempt results, and Bright Data documents both as worth retrying.
- The target answered, not the unlocker. Without an x-brd-error header, a 403 or a challenge page is the site's own response; with http_status, the site returned a blocking status Web Unlocker could not get around on that attempt.
- Your own session data is ignored. Unless Custom Web Unlocker API is enabled, "any extra elements that are sent along with the request are disregarded", so a cookie or header you add does not reach the site.
- Timeouts. Waiting for an element or a rendered page can take long, and Bright Data recommends allowing at least 180 seconds on the client side.
- Low success rate on a domain, which Bright Data can answer with 429 sr_rate_limit.
Fix 1: read x-brd-error and retry only what is retryable
Bright Data states that "retrying is worth doing for errors caused by the peer or by the unlock attempt". reject_block and resolve_failed_* can succeed on the next attempt. Certificate errors (net_err_cert_date_invalid, net_err_cert_common_name_invalid, net_err_cert_authority_invalid), proxy_error for a host that does not resolve and no_peers return the same result every time, and so do premium, feature_not_active and ub_bad_endpoint_robots until the zone or the request changes.
In practice: check whether x-brd-error is present, read the code from x-brd-error-code or x-brd-err-code, retry a small number of times with backoff for the retryable ones, and log the req_id for anything you will report.
import time
import requests
API = "https://api.brightdata.com/request"
HEADERS = {"Authorization": "Bearer YOUR_BRIGHTDATA_API_KEY"}
ZONE = "YOUR_WEB_UNLOCKER_ZONE"
def unlock(url, attempts=3):
for i in range(attempts):
r = requests.post(API, headers=HEADERS, timeout=180, json={
"zone": ZONE, "url": url, "format": "raw",
})
if "x-brd-error" not in r.headers:
return r # no x-brd-error: status and body come from the target site
code = r.headers.get("x-brd-error-code") or r.headers.get("x-brd-err-code") or ""
print(r.status_code, code, r.headers["x-brd-error"])
# branch on the code, not the message text
if code in ("reject_block", "http_status") or code.startswith("resolve_failed"):
time.sleep(2 * (i + 1)) # each retry goes through a different peer
continue
return None # premium, feature_not_active, cert errors...: fix first, do not loop
return None
resp = unlock("https://example.com/products")
if resp is not None:
print(resp.status_code, len(resp.text))Fix 2: rendering, waiting and custom features
Web Unlocker decides on its own whether a page needs a browser, but you can steer it:
- Force JavaScript rendering with the documented rendering option when the content only appears after scripts run. Bright Data warns that because it forces browser use, "you may see significant increase in response time".
- x-unblock-expect makes Web Unlocker wait for specific elements or text before returning, for example {"element": ".product-list"}. Use an element that exists only on the real page. It is a custom feature: without it enabled on the zone you get 400 feature_not_active.
- Custom headers and cookies can be enabled in the zone's advanced settings, from a pre-approved list or on request. Bright Data is clear about the trade-off: with custom features "you'll be billed for 100% of the requests (both successful and failed)".
- no_peers on a 502 means there is no peer for the requested country; change or remove the country value.
Fix 3: zone, credentials and access mode
Several errors have nothing to do with Cloudflare and only look like blocks:
- 407 client_10000 (auth failed), client_10002 (zone not found), client_10010 (no proxy credentials) and client_10001 (malformed parameter in the proxy username, such as usa instead of us) are credential problems.
- 403 client_10090 means the zone is a Browser API zone, which Web Unlocker cannot use.
- In Direct API mode, a 401 with a plain text body and no x-brd-* headers means the API key was rejected before the request reached the unlocker. Send Authorization: Bearer with a valid key.
- ub_bad_endpoint_robots appears in immediate access mode; KYC verification is the route to full access for restricted targets.
What a Cloudflare-protected page costs on Web Unlocker
Prices checked 2026-12-01 on brightdata.com/pricing/web-unlocker: pay as you go is $1.5 per 1,000 requests with "Pay only for success"; Scale is $499 per month with 383K requests included and $1.3 per 1,000 additional requests; a free tier gives 5K requests per month. Full browser rendering and CAPTCHA solving are listed as included in every plan.
So a Cloudflare-protected page costs the same as any other page, about $1.50 per 1,000 successful requests on pay as you go, with proxies, rendering and retries included. The exception is a zone with custom features enabled, where failed requests are billed too.
When a dedicated challenge solver is cheaper or simpler
Web Unlocker and NSLSolver are both billed only on success, so the difference is what one unit buys. Web Unlocker charges per page. A cf_clearance solver charges per clearance: you solve the challenge once, get the cookie and matching User-Agent, and fetch the following pages with your own HTTP client through your own proxy. Cloudflare's default clearance lifetime is 30 minutes (configurable per site), with no new challenge while it is valid.
If you fetch many pages from a few Cloudflare-protected sites, and the data is in the HTML or a JSON endpoint, one NSLSolver Challenge solve ($1.00 per 1,000 successful solves) can cover many requests; you pay your own proxy traffic. If you need your own cookies or session data with the request, replaying a clearance in your own client also avoids the custom-features billing rule.
Web Unlocker is the simpler choice when you scrape many different domains, need rendering, face protections other than Cloudflare or do not want to manage proxies at all. NSLSolver covers Cloudflare Turnstile, Cloudflare Challenge, reCAPTCHA v3 / Enterprise, Kasada and Akamai (beta), and does not solve reCAPTCHA v2, hCaptcha, image or text CAPTCHAs, FunCaptcha, GeeTest or DataDome.
The same Cloudflare challenge with NSLSolver
POST the url, the challenge site_key (the 0x... widget id from the challenge page) and your proxy to /solve. The synchronous response contains cookies (including cf_clearance) and user_agent; replay both through the same proxy. Do not send user_agent in the request, or send an iPhone Safari UA, because the clearance is issued for an iPhone Safari User-Agent. Challenge solves average about 3.3 seconds.
Only automate sites you own or are authorised to access. Sign up with Google, Gmail or Proton for $0.10 of free credit (about 125 Turnstile solves), no card required.
import requests
API = "https://api.nslsolver.com/solve"
PROXY = "http://user:pass@host:port" # your proxy: used for the solve AND the replay
TARGET = "https://example.com/products"
# 1) One solve: NSLSolver passes the Cloudflare challenge and returns cf_clearance
r = requests.post(API, headers={"X-API-Key": "YOUR_API_KEY"}, json={
"type": "challenge",
"url": TARGET,
"site_key": "0x4AAAAAAAxxxxxxxxxxxxxxxx", # challenge widget id (0x...) from the page
"proxy": PROXY,
# no user_agent: the clearance is issued for the solver's iPhone Safari
}, timeout=120)
r.raise_for_status() # 400 field, 401 key, 402 balance, 429 rate, 503 retry (not billed)
data = r.json()
# 2) Replay with your own HTTP client: same proxy, returned cookies and user_agent
s = requests.Session()
s.proxies = {"http": PROXY, "https": PROXY}
s.cookies.update(data["cookies"]) # includes cf_clearance
s.headers["User-Agent"] = data["user_agent"]
for page in range(1, 51):
resp = s.get(f"{TARGET}?page={page}", timeout=30)
if resp.status_code == 403 and "Just a moment" in resp.text:
break # clearance expired or the context changed: solve again
print(page, resp.status_code, len(resp.text))