Skip to content
Guide

Scrapfly Not Working on Cloudflare in 2026: ERR::ASP Errors, Unblocker Settings and Fixes

NSLSolver TeamPublished Updated 8 min read

If Scrapfly returns Cloudflare's "Just a moment..." page or ERR::SCRAPE::BAD_UPSTREAM_RESPONSE, the scrape most likely ran without the Unblocker (the feature formerly called ASP, enabled with unblocker=true or the older asp=true). If the Unblocker is on and you get ERR::ASP::SHIELD_PROTECTION_FAILED or ERR::ASP::TIMEOUT, Scrapfly tried and did not get through on that attempt: those errors are not billed and most are retryable. Check the documented error code, retry the retryable ones, keep the default retry and timeout settings, and set cost_budget so a protected target cannot surprise you on cost. If Cloudflare's challenge is the only obstacle and you fetch many pages per site, a dedicated solver that returns a cf_clearance cookie can be cheaper.

Error codes, parameters and prices below come from Scrapfly's documentation and pricing page (checked 2026-12-01). Scrapfly is a broad platform (Scrape API, screenshots, extraction, a cloud browser), so this guide is about the Cloudflare case only.

Quick answer: Scrapfly errors on Cloudflare sites

Scrapfly documents, for each error code, the HTTP status, whether it is retryable and whether it is billed. The ones you meet on Cloudflare-protected targets:

ERR::SCRAPE::BAD_UPSTREAM_RESPONSE (HTTP 200, billed)
The website responded with an unexpected status code (above 400), such as Cloudflare's 403 challenge. Turn on the Unblocker (unblocker=true, or asp=true). Without it, the challenge response is simply returned to you.
ERR::ASP::SHIELD_PROTECTION_FAILED (422, not billed)
"The Unblocker shield failed to solve the challenge against the anti-bot protection." Retry (Scrapfly marks it retryable depending on the response). Add render_js, a country and a session if the site needs them.
ERR::ASP::TIMEOUT (422, not billed)
The Unblocker took too much time to solve or respond. Retry. With retry=false, do not set the timeout below the documented Unblocker minimum (30,000 ms; default 75,000).
ERR::ASP::CAPTCHA_TIMEOUT / ERR::ASP::UNABLE_TO_SOLVE_CAPTCHA (422)
The captcha budget time was reached, or the captcha could not be solved this time. Both are retryable. Note that a captcha solve that has started is billed however it ends.
ERR::ASP::SHIELD_EXPIRED (422, not billed)
The Unblocker shield previously set has expired. Retry the request, as the error text says.
ERR::ASP::SHIELD_NOT_ELIGIBLE (422, not retryable)
A feature you requested is not eligible with the Unblocker for this protection or target. Remove the feature you requested for that target (it cannot be combined with the Unblocker there) and resend; retrying unchanged returns the same error.
ERR::SCRAPE::COST_BUDGET_LIMIT (422, not retryable)
The scrape needed more credits than your cost_budget allows. Raise cost_budget to what X-Scrapfly-Api-Cost shows for successful scrapes of that site, or accept the failure.
ERR::THROTTLE::MAX_CONCURRENT_REQUEST_EXCEEDED / MAX_API_CREDIT_BUDGET_EXCEEDED (429)
Too many concurrent scrapes for your plan, or your API credit budget is reached. Lower concurrency or raise the budget; both are retryable later.
ERR::PROXY::RESOURCES_SATURATION (422, not billed)
Proxies are saturated for the requested country. Retry, or try another country.

Why Cloudflare still comes back through Scrapfly

Scrapfly states that its Unblocker handles Cloudflare's "Checking your browser" interstitial, Bot Management and "all three Turnstile modes, no solver setup". When you still see Cloudflare, it is usually one of these:

  • The Unblocker is off. The default for asp is false. A plain datacenter scrape that hits a challenge comes back as ERR::SCRAPE::BAD_UPSTREAM_RESPONSE, which is billed.
  • A single unlucky attempt. ERR::ASP::SHIELD_PROTECTION_FAILED, ERR::ASP::TIMEOUT and the captcha errors are documented as retryable and are not billed, so one failure is not a verdict on the site.
  • Settings that fight the Unblocker: a custom timeout below the Unblocker minimum, session_sticky_proxy=false (rejected with HTTP 400 when the Unblocker is enabled), or an option the Unblocker cannot use for that target (SHIELD_NOT_ELIGIBLE).
  • Returning before the real page. With render_js, Scrapfly waits rendering_wait (1,000 ms by default) after load; wait_for_selector is more reliable.
  • Budget limits. cost_budget, credit budgets and concurrency limits turn otherwise successful scrapes into COST_BUDGET_LIMIT or THROTTLE errors.

Fix 1: enable the Unblocker correctly

Add unblocker=true. The old asp parameter "still works exactly as before" and is not deprecated; if you send both, asp wins, so do not send asp=false next to unblocker=true. The ERR::ASP::* codes and the context.asp response fields also keep their names.

Scrapfly says the Unblocker is "totally free on non-blocked scrape" and has no flat fee: a protected target can add its own fee and move the request to residential proxies and a browser. Read the X-Scrapfly-Api-Cost header on a few successful scrapes to learn what a given site really costs.

scrapfly_cloudflare.py
import requests

SF = "https://api.scrapfly.io/scrape"
params = {
    "key": "YOUR_SCRAPFLY_KEY",
    "url": "https://example.com/products",
    "unblocker": "true",                  # formerly asp=true, still accepted
    "render_js": "true",
    "wait_for_selector": ".product-list", # an element of the real page only
    "country": "us",
    "cost_budget": "60",                  # max credits per scrape (Unblocker only)
}
# retry=true (default) fixes the API timeout at 150 s: let the client wait longer
r = requests.get(SF, params=params, timeout=170)
print(r.status_code, "cost:", r.headers.get("X-Scrapfly-Api-Cost"))

data = r.json()
html = data.get("result", {}).get("content") or ""
if r.status_code != 200 or "Just a moment" in html:
    print(r.text[:800])   # error code, e.g. ERR::ASP::SHIELD_PROTECTION_FAILED
else:
    print(len(html), "bytes of real HTML")

Fix 2: retries and timeouts

Scrapfly's retry and timeout rules are strict, and most "it hangs" or "it gives up" reports come from them:

  • retry defaults to true: Scrapfly retries on network errors and HTTP 5xx, and the timeout is then fixed at 150,000 ms. Give your own HTTP client a bit more than 150 seconds.
  • A custom timeout needs retry=false. With the Unblocker on, it must be between 30,000 and 150,000 ms (default 75,000); values outside that range, or sent with retry=true, are refused.
  • In your own code, retry only the codes Scrapfly marks retryable (SHIELD_PROTECTION_FAILED depending on the response, ASP::TIMEOUT, SHIELD_EXPIRED, the captcha errors, PROXY::TIMEOUT, RESOURCES_SATURATION) and stop on SHIELD_ERROR, SHIELD_NOT_ELIGIBLE and UPSTREAM_UNEXPECTED_RESPONSE, which Scrapfly says its team is alerted about or which need a change on your side.

Fix 3: proxies, sessions and waiting

Once the Unblocker is on, these parameters decide whether the real page comes back:

  • proxy_pool: public_datacenter_pool (default) or public_residential_pool. The Unblocker can move a protected request to residential proxies itself; set the pool explicitly only if you want residential on every request.
  • country: an ISO country code, a list (us,gb) or an exclusion (-gb). Pick the site's home market when it treats foreign traffic differently.
  • session: persists cookies, fingerprint and proxy across scrapes, so a clearance obtained on one page is reused on the next. Keep session_sticky_proxy at its default (true) with the Unblocker.
  • render_js with wait_for_selector: wait for a CSS or XPath selector (or an xhr: pattern) that exists only on the real page instead of relying on rendering_wait.

Fix 4: keep costs predictable with cost_budget

cost_budget sets the maximum cost of one scrape in API credits and is read only when the Unblocker is enabled (or a solve_captcha step runs in a js_scenario). A scrape the budget cannot pay fails with ERR::SCRAPE::COST_BUDGET_LIMIT, which is not retryable, so set the budget from the costs you observed rather than guessing low.

Captchas are the one place where a failure can still cost you: Scrapfly documents captcha solves at $0.001575 to $0.0039 each (11 to 51 credits), and "a captcha whose solve has started is billed however the solve ends, a scrape that fails included."

What a Cloudflare-protected page costs on Scrapfly

Prices checked 2026-12-01 on scrapfly.io/pricing: Free gives 1,000 credits per month; Discovery is $30 per month for 200,000 credits, Pro $100 for 1,000,000, Startup $250 for 2,500,000 and Enterprise $500 for 5,500,000. A base scrape costs 1 credit on a datacenter IP and 25 on a residential IP, and JavaScript rendering adds 5 (so 30 for a rendered residential scrape). Failed scrapes are not billed, apart from started captcha solves; 404 and 410 responses are billed as regular scrapes.

By our arithmetic, a rendered residential scrape (30 credits) on the Pro plan comes to about $3.00 per 1,000 pages, before any fee a protected target adds through the Unblocker. That includes the proxy, the browser and the retries.

When a dedicated challenge solver is cheaper or simpler

A cf_clearance solver moves the cost from "per page" to "per clearance". You solve the challenge once, get the cookie plus the 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), and no challenge is shown while it is valid.

That model wins when Cloudflare's challenge is the only obstacle, the data is in HTML or a JSON endpoint, and you fetch many pages from a few domains. NSLSolver charges $1.00 per 1,000 successful Cloudflare Challenge solves, and you pay your own proxy bandwidth.

Scrapfly remains the better choice for rendered pages, screenshots, extraction, many unrelated domains, or protections a Cloudflare-focused solver does not cover. NSLSolver supports Cloudflare Turnstile, Cloudflare Challenge, reCAPTCHA v3 / Enterprise, Kasada and Akamai (beta); it 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 on the challenge page) and your proxy. The synchronous response holds cookies (with cf_clearance) and user_agent; replay both through the same proxy. Omit user_agent in the request, or send an iPhone Safari UA, since the clearance is issued for an iPhone Safari User-Agent. A challenge solve averages 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.

nslsolver_challenge.py
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))

Frequently asked questions

What does ERR::ASP::SHIELD_PROTECTION_FAILED mean?

Scrapfly documents it as "The Unblocker shield failed to solve the challenge against the anti-bot protection." It is a 422, not billed, and retryable depending on the response. Retry, and check that render_js, country and session suit the site.

Why do I get ERR::SCRAPE::BAD_UPSTREAM_RESPONSE on a Cloudflare site?

The target answered with a status above 400, typically Cloudflare's challenge, and the scrape ran without the Unblocker. This error is returned with HTTP 200 and is billed. Enable unblocker=true (or asp=true).

Is asp=true still valid in Scrapfly?

Yes. ASP is now called the Unblocker and the new parameter is unblocker=true, but asp keeps working and is not deprecated. If both are sent, asp wins, so do not send asp=false with unblocker=true.

Does Scrapfly charge for failed Unblocker attempts?

Failed scrapes are not billed under Scrapfly's Scrape Failed Protection, and the ERR::ASP codes are marked not billed. The exception is a captcha solve that has started, which is billed however it ends.

Why is my custom timeout refused?

A custom timeout requires retry=false. With the Unblocker it must be between 30,000 and 150,000 ms (default 75,000). With retry=true the timeout is fixed at 150,000 ms.

How much does a Cloudflare-protected page cost on Scrapfly?

A rendered residential scrape costs 30 credits, and the Unblocker can add a target-specific fee. The X-Scrapfly-Api-Cost header shows the real cost; cost_budget caps it. On the Pro plan ($100 for 1,000,000 credits, checked 2026-12-01) 30 credits is about $3.00 per 1,000 pages.

When is a cf_clearance solver cheaper than Scrapfly?

When the Cloudflare challenge is the only obstacle and you fetch many pages from the same sites. One clearance stays valid for the site's Challenge Passage (30 minutes by default), so a $1.00 per 1,000 solve can cover many requests sent with your own client and proxy.

Pay per clearance, not per page

NSLSolver returns cf_clearance and the matching User-Agent in one synchronous call, at $1.00 per 1,000 successful solves. Free credit with Google, Gmail or Proton sign-up, no card needed.