Cloudflare Error 1020 Access Denied: Scraper Fixes
Cloudflare error 1020 means a site's security rule blocked you, not a rate limit. Tell it apart from 'Sorry, you have been blocked', 1010 and 1015, and fix it.

Cloudflare error 1020 ("Access denied") means a security feature the website owner configured matched your request and blocked it with an HTTP 403. It isn't a rate limit and it isn't Cloudflare deciding on its own that you're a bot. Most guides go wrong on one point: since Cloudflare's current docs (updated 14 October 2026), requests blocked by ordinary WAF custom rules don't show 1020 at all. They get the "Sorry, you have been blocked" page instead. This guide explains how to tell the block pages apart, which signal in a scraper's request usually triggers each one, and how to find the cause with a handful of controlled requests instead of guesswork.
What Error 1020 Means Today
Cloudflare's error reference, updated 14 October 2026, defines it in two sentences: "This error indicates that a Cloudflare security feature configured by the website owner blocked the request. Cloudflare returns it with an HTTP 403 status code."
The common cause, in Cloudflare's words: "A security rule with a Block action matched the request, and the rule has no custom response configured. For example, API Shield schema validation and JWT validation can block requests with a 1020 error." Then comes the line most older articles miss: "Requests blocked by WAF custom rules or WAF managed rules do not get a 1020 error. These requests get the WAF block response instead."
So in 2026:
- A 1020 points at a security feature such as API Shield's schema or JWT validation, or another Block-action rule without a custom response. It's especially common on API endpoints.
- "Sorry, you have been blocked" is the WAF block page (a 403), returned when a WAF custom or managed rule matched.
- Both are deliberate rules written by the site owner. Neither is a temporary throttle you can wait out.
Older posts that say "1020 = firewall rule" describe how things worked before. The diagnosis below works whichever page you get.
1020 vs "Sorry, You Have Been Blocked" vs 1010, 1015 and Friends
Cloudflare has a family of access errors, and each one names its cause:
| What you see | HTTP | What matched (Cloudflare's docs) | Scraper reading |
|---|---|---|---|
| **Error 1020: Access denied** | 403 | A security feature's Block rule with no custom response (e.g. API Shield schema or JWT validation) | Your request shape broke a rule: path, method, body, headers or token |
| **"Sorry, you have been blocked"** | 403 | WAF block page: a WAF custom or managed rule matched | A custom rule (UA, ASN, country, path, header) or a managed rule (payload pattern) |
| **Error 1005: ASN banned** | 403 | The owner banned your autonomous system number | Your hosting provider's network is blocked |
| **Error 1006, 1007, 1008, 1106** | 403 | Your IP address is banned | That specific address is blocked |
| **Error 1009: Country or region banned** | 403 | The owner banned your country or region | Exit location problem |
| **Error 1010** | 403 | "banned your access based on your browser's signature" (Browser Integrity Check) | Non-browser client signature, e.g. the default Python urllib User-Agent |
| **Error 1015: You are being rate limited** | 429 | A rate limiting rule | Too many requests: slow down |
| **"Just a moment..." / challenge page** | 403 | Managed challenge or Under Attack mode | Bot checks want a real browser |
Two rows matter most for scrapers:
- 1010 is the "your client doesn't look like a browser" error. Cloudflare's doc names "the default Python urllib user agent" as an example of a client Browser Integrity Check treats as a non-browser.
- 1015 is the only one in the table that time fixes. Cloudflare warns visitors not to retry rapidly, "as this may extend the block".
Scraping at scale? Skip the blocks.
Fast, unblockable datacentre proxies with unlimited bandwidth.
Read the Page Before You Change Anything
Every Cloudflare block includes a Ray ID, an identifier "given to every request that goes through Cloudflare". It appears on the error page and in the cf-ray response header. Capture the code, the Ray ID and the UTC time first, because they're what the site owner needs. Cloudflare's 1020 guidance tells owners to "Search the Security Events log... for the Ray ID or client IP address", and to convert the UTC timestamp to local time when searching.
This helper classifies a response without guessing:
import re
import requests
def classify_cloudflare_block(r: requests.Response) -> dict:
"""Name the Cloudflare block type from status, headers and body. Read-only."""
h = {k.lower(): v for k, v in r.headers.items()}
body = r.text[:20000]
on_cf = "cf-ray" in h or h.get("server", "").lower() == "cloudflare"
code = None
m = re.search(r"(?:error code:?\s*|Error\s+)(1\d{3})\b", body, re.I)
if m:
code = int(m.group(1))
if not on_cf:
kind = "not a Cloudflare edge response"
elif code == 1020:
kind = "1020: security feature Block rule (often API Shield schema/JWT validation)"
elif code == 1010:
kind = "1010: browser signature (Browser Integrity Check)"
elif code == 1015 or r.status_code == 429:
kind = "1015: rate limited, back off"
elif code in (1005, 1006, 1007, 1008, 1106, 1009):
kind = f"{code}: ASN / IP / country ban"
elif "sorry, you have been blocked" in body.lower():
kind = "WAF block page: a WAF custom or managed rule matched"
elif "just a moment" in body.lower() or "challenge-platform" in body:
kind = "challenge page (managed challenge / bot checks)"
else:
kind = f"other ({r.status_code})"
return {"status": r.status_code, "kind": kind, "ray": h.get("cf-ray")}
Log that dictionary with every failed request. A queue of "1015" means pace. A queue of "1005" means the network. A mix of "WAF block page" on one path and 200 elsewhere means a path rule.
Why Scrapers Hit These Blocks
Site owners write rules against fields Cloudflare exposes to every plan. These are the ones that usually catch automated traffic:
| Signal | Typical rule | Which page it produces |
|---|---|---|
| Hosting-provider ASN | `ip.src.asnum in {...}` blocks cloud and datacenter networks | WAF block page, or 1005 for an ASN ban |
| Country | Geo rules on custom rules or IP Access rules | WAF block page, or 1009 |
| User-Agent | `http.user_agent contains "python-requests"`, empty UA, `curl/` | WAF block page. 1010 via Browser Integrity Check |
| Missing browser headers | Rules on `Accept-Language`, `sec-ch-ua` or `Referer` absence | WAF block page |
| Path and method | Blocking `/api/` or `POST` outside the site's own front end | WAF block page, or 1020 via API Shield |
| API schema and tokens | Schema validation or a missing or invalid JWT on API routes | 1020 |
| Request volume | Rate limiting rules | 1015 (429) |
| Known-bot status | `not cf.client.bot` combined with other conditions | WAF block page |
A pattern worth recognising: a script that works on your laptop but gets blocked from a cloud server is almost always an ASN rule, not a fingerprint problem. Our troubleshooting guide for a website that blocks AWS IPs but works locally walks through that exact case.
Isolate the Signal in Five Requests
Don't throw a full stealth stack at a 1020 or WAF block. Change one variable at a time, keep the request count tiny, and stop as soon as the cause is clear:
- Same URL, normal browser, same network. Blocked too? The rule matches your IP, ASN or country. Not blocked? It matches your client (headers, UA, TLS).
- Same script, different exit network. For example, your office connection instead of a cloud VM, or a proxy in another region. A change here confirms an IP, ASN or geo rule.
- Same script, browser-like User-Agent and headers. A change here confirms a UA or header rule. A 1010 that disappears is the classic case.
- Same client, different path. If
/works but/api/searchreturns 1020, you've hit an endpoint-level rule such as API Shield validation. The site's own front end probably sends a token or body shape you don't. - Same everything, slower. If blocks only appear after a burst, you're looking at rate limiting (1015 or 429), not an access rule.
import time, requests
URL = "https://target.example/path"
BROWSER_HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.9",
}
def probe(label, **kwargs):
r = requests.get(URL, timeout=20, **kwargs)
print(label, classify_cloudflare_block(r))
time.sleep(5) # keep it gentle: this is diagnosis, not load
probe("default client")
probe("browser headers", headers=BROWSER_HEADERS)
probe("browser headers via other exit", headers=BROWSER_HEADERS,
proxies={"https": "http://USER:PASS@gateway.sparkproxy.io:11002"})
Our explainer on why a website blocks Python requests but not the browser covers step 3 in depth, including the TLS fingerprint differences headers alone can't fix.
Fixes That Match the Cause
| Diagnosis | Fix that respects the rule's intent |
|---|---|
| UA or header rule, or 1010 | Send an honest, complete header set. Identify a crawler as a crawler, with contact details, if the site welcomes bots |
| ASN or hosting-network rule | Run from a network the site serves. A dedicated datacenter IP that's yours alone is easier to get allowlisted than shared cloud egress |
| Country rule (1009) | Only request content that's offered in your region. Don't route around licensing or legal geo-restrictions |
| Path or API rule (1020) | Use the site's public pages or its official API. Don't forge the front end's tokens |
| Rate limit (1015) | Slow down, add backoff, cache, spread requests over time |
| You can't tell, or the rule clearly targets automation | Stop and ask (next section) |
You'll notice there's no "Cloudflare 1020 bypass" row. A 1020 or WAF block is the site owner telling you, specifically, not to make that request. Working around a deliberate block can breach the site's terms and, depending on jurisdiction and what you access, the law. For public data a site doesn't block, ordinary proxies and a managed scraping API are fine tools. For data it does block, the fix is permission.
When to Stop and Send the Ray ID
Cloudflare's own advice to blocked visitors is the right move for legitimate use: "provide the website owner with a screenshot of the 1020 error message you received". Its WAF FAQ adds: include "the Cloudflare Ray ID displayed at the bottom of the error page".
A short, useful request:
Subject: Access request for automated data collection (Ray ID 8f3a1b2c4d5e6f70-AMS)
Hi, we collect public product availability from your site for <purpose>.
Our requests started returning Cloudflare error 1020 at 2026-11-20 14:05 UTC
(Ray ID above) from our fixed IPs 203.0.113.10-12, User-Agent "ExampleBot/1.2
(+https://example.com/bot; ops@example.com)". We fetch at most 1 request every
5 seconds. Could you allowlist these IPs or point us to an official feed/API?
Fixed, published IPs and an honest User-Agent make this easy for an owner to approve. That's one reason rotating random IPs is the wrong approach when you need a long-term relationship with a source.
If You Run the Site
If your own customers or partners report 1020 or "Sorry, you have been blocked":
- Find the rule. Search Security Events for the Ray ID or client IP. The event shows which feature and rule blocked the request. Cloudflare notes that Security Events may use sampled data, so a missing Ray ID doesn't prove nothing happened.
- Prefer custom rules over legacy tools. Cloudflare recommends custom rules over IP Access rules and User Agent Blocking for IP, geo and UA blocking. Remember that allowing an IP or ASN in IP Access rules bypasses custom rules, rate limiting and managed rules.
- Watch for collateral damage. Cloudflare's WAF FAQ warns that Block or Challenge rules keyed on URI, path, host, ASN or country can catch known bots and "affect search engine optimization (SEO) and website monitoring". Use
cf.client.botto exempt them. - Customise the page. A custom error rule for 1020 can tell legitimate users who to contact, which saves your support team the screenshot exchange.
Our guide to Cloudflare's anti-bot layers covers how these rules sit alongside bot scores and challenges.
Frequently asked questions
FAQ
Error 1020 "Access denied" means a Cloudflare security feature configured by the website owner blocked your request, returned with HTTP 403. In Cloudflare's current docs it typically comes from a Block-action rule without a custom response, such as API Shield schema or JWT validation. Ordinary WAF custom rule blocks show the "Sorry, you have been blocked" page instead.
No. Rate limiting returns Cloudflare error 1015 with an HTTP 429 status. A 1020 is an access rule that matched your request, so waiting usually doesn't help. Change whatever the rule matched, such as network, headers or path, or ask the site owner for access.
It's Cloudflare's WAF block page, shown with an HTTP 403 when a WAF custom rule or managed rule matches your request. Causes include rules on your ASN, country, User-Agent, headers, path, or payload patterns that look like attacks. The Ray ID at the bottom identifies the event for the site owner.
Capture the error code, Ray ID and time. Then change one variable at a time: try a browser on the same network, a different exit network, browser-like headers, a different path and a slower rate. Fix the specific signal honestly, or send the Ray ID to the site owner and ask for access.
There's no legitimate bypass, because a 1020 is a deliberate rule set by the site owner. You can fix accidental triggers, such as missing headers or a shared cloud IP, and ask for allowlisting with fixed IPs and an honest User-Agent. Evading a deliberate block can breach the site's terms.
Usually because the site blocks hosting-provider networks by ASN, or blocks the specific cloud IP range your server uses, while your home ISP is allowed. A test from a different network confirms it. A dedicated, allowlistable IP or the site's official API is the durable fix.
Get 20% off your first month
Premium datacentre proxies with unlimited bandwidth. Use the code at checkout.
Save up to 15% more on quarterly, half-yearly and yearly plans
Related articles

Turnstile Token Missing, Rejected or Expired: Fixes
Fix Turnstile token errors on your own forms: missing-input-response, invalid-input-response, timeout-or-duplicate, the 300-second rule and test keys.

Claude Code Web Fetch 403: Why Agents Get Blocked
Why Claude Code's WebFetch gets 403 errors: the Claude-User agent, Cloudflare agent policies, JS challenges and no JS execution, plus fixes that respect sites.

Cloudflare Bot Score Explained: What 1 vs 99 Means
Cloudflare bot score explained: 1 is automated, 99 human. The engines behind it, why scores of 1 and 29 appear, the cf-bot-score header and how to test it.
