---
title: "Cloudflare \"Access denied Error code 1020\": why and how to fix"
description: "Cloudflare error 1020 means a rule the site owner set blocked you, with a 403. The block page we hit never said 1020. Why it happens and how to fix it."
url: "https://scrapenews.com/errors/cloudflare-1020"
updated: "2026-11-26T00:00:00Z"
---

# Cloudflare "Access denied Error code 1020": why and how to fix

Cloudflare · 1020

Published 16 Nov 2026 · Updated 26 Nov 2026

What you see

- `Access denied Error code 1020`
- `Error 1020`
- `error code: 1020`
- `Attention Required! | Cloudflare`

**More error strings (4)**

- `Sorry, you have been blocked`
- `Access denied, Error code 1020`
- `Access was denied Error code 1020`
- `The site owner may have set restrictions that prevent you from accessing the site.`

## What it means

`Access denied` with `Error code 1020` means the site sits behind Cloudflare, and its owner set up a security rule. That rule matched your request, and Cloudflare answered with a 403 (the site refused you). Only the owner can change the rule, but you can often stop matching it.

## What we measured: the block page we hit never said 1020

We asked 100 well-known sites for one page each from a datacenter IP (probe run `2353`, 25 Nov 2026, 23:53 UTC), then retried the ones that failed from residential IPs (runs `0129-oxy-resi`, `0129-bd-resi`, 26 Nov 2026).

- **3 sites sent Cloudflare’s block page:** IKEA and ZipRecruiter to the datacenter IP, Crunchbase to one residential IP. Each time: HTTP 403, the title `Attention Required! | Cloudflare` and the headline “Sorry, you have been blocked”.
- **0 of the 3 pages contained “1020”.** That is Cloudflare’s WAF block page (see the table under Dev details). A check for “1020” alone would have missed all 3.
- **A new IP fixed 2 of 3.** IKEA opened from a residential IP with a plain request. A second residential provider got Crunchbase through.
- **ZipRecruiter only changed walls.** Both residential IPs were shown the [“Just a moment…” check](https://scrapenews.com/errors/cloudflare-just-a-moment.md) instead, and a real browser on a residential IP (patchright and camoufox, 3 tries each) did not get in either.

Which tool types get past it: a different IP first, so [residential proxies](https://scrapenews.com/compare/residential-proxies.md) (the price list below). When the rule matches more than your IP, [scraper and unblocker APIs](https://scrapenews.com/compare/scraper-apis.md) are the next step, but we have not measured those for this block yet.

Free tools with one setting for every site, on the Cloudflare sites in our test (all sites; [open-source benchmark](https://scrapenews.com/benchmarks/open-source.md), run scrapenews-open-source-benchmark-2026-11-26, 26 Nov 2026). Top tools: Scrapling StealthyFetcher, Botasaurus, Patchright, nodriver and Crawl4AI tie (63–76%). Top HTTP clients: curl_cffi, curl-impersonate, tls-client and Scrapling Fetcher tie (43–57%).

Residential proxies: price for 10 GB a month, cheapest first

| Vendor, plan it picks | Total a month | $/GB | Total a year | Free trial · note · source |
| --- | --- | --- | --- | --- |
| [HProxy Residential Proxies](https://scrapenews.com/compare/hproxy.md) (Lite: 10 GB) | $4.70 | $0.47 | $56.40 | ([hproxy.com · 29 Nov 2026](https://hproxy.com/residential-proxies)) |
| [CakeIP](https://scrapenews.com/compare/cakeip.md) (10GB) | $6.00 | $0.60 | $72 | promo price ([cakeip.com · 29 Nov 2026](https://www.cakeip.com/ip/trendsLong)) |
| [Geonode Residential Proxies](https://scrapenews.com/compare/geonode.md) (10 GB Plan) | $7.92 | $0.79 | $95.04 | free trial: $5 = 10 GB for 3 days ([geonode.com · 29 Nov 2026](https://geonode.com/pricing/residential-proxies)) |
| [ProxyBase Residential Proxies](https://scrapenews.com/compare/proxybase.md) (Pay as you go) | $8.50 | $0.85 | $102 | ([proxybase.org · 29 Nov 2026](https://proxybase.org/pricing)) |

List prices from each vendor’s pricing page, US dollars before tax, live from our price data. Your own size, in the price calculator: [Residential proxies](https://scrapenews.com/compare/residential-proxies.md).

## Why it happens

A security rule with a **Block** action matched your request, and the owner set no custom reply for it. Cloudflare shows 1020 in that case.

Things that can set it off:

- **Older Firewall Rules.** Before Cloudflare moved to WAF custom rules, a blocking firewall rule always showed 1020.
- **API Shield checks.** Schema validation and JWT validation (checks on API requests and the login tokens) can block with 1020.
- **What a rule looks at.** Owner rules can match your IP address, your country, your network (ASN, meaning the ID of the company that owns your IP), your User-Agent header, and a bot score from 1 to 99.

A twist: requests stopped by current WAF custom rules or WAF managed rules get a different block page, not 1020. So 1020 points to the kinds of rules above, or to a site that still runs older rules.

An IP Access rule (a plain block set of IPs or countries) shows a different code too: [1005](https://scrapenews.com/errors/cloudflare-1005-1006-1009.md).

Cloudflare stands between you and the site, like a bouncer at the door. The owner writes the rules: what to match, plus an action such as Block. When a Block rule matches, your call never reaches the site’s server.

The pair of API Shield checks:

- **Schema validation.** The owner uploads an OpenAPI schema, a file that lists all valid API calls: the path, the method, the format of each query value. Requests that don’t fit count as violations.
- **JWT validation.** A JWT is a signed token that proves who you are, sent in a header or cookie. Expired, tampered with or not-yet-valid tokens get flagged by Cloudflare.

Our guess: if you call a site’s hidden API with a request you built by hand or an old token, then suspect these 2 first.

The bot score: 1 means Cloudflare is quite confident the request was automated, 99 means quite sure it was a human. It reads your headers, session traits and browser signals.

## Fix it

1. **Read the body.** Make sure it actually says 1020. Other Cloudflare codes mean other things.
2. **Look at your User-Agent.** Rules can match it, so send the User-Agent of a real browser and test again.
3. **Change where you come from.** Rules can match your IP, plus country and network. Change one thing at a time: another network, or another country.
4. **Check the URL.** API Shield checks guard API endpoints, so try a normal page on the same site. If it loads, the block sits on this path.
5. **Ask the owner** if the data is yours to use (a partner, a client, your own firm). Include a screenshot, the Ray ID from the page, and the UTC time.
6. **If you own the site:** open Security > Analytics, Events tab, then search the Ray ID or the visitor’s IP. That event shows which feature and rule blocked them. Fix that rule.

Why one change at a time: the rule is hidden from you. Change only the User-Agent, test, then only the IP, test. The change that clears the 403 tells you what that rule matches on.

If nothing clears it, suspect the request itself. Compare your call with the one the site’s own page makes: method, path, query values, and the token in its header or cookie. That is what schema and JWT checks test.

Need the owner’s contact? For the related error 1010, Cloudflare’s docs point to the domain’s Whois record. Writing to Cloudflare support won’t help: it cannot override a customer’s security settings.

Their fixes differ, so know the neighbours:

- **1010**: the owner blocked you by your browser’s signature.
- **1015**: you are rate limited. Wait before you try again. Quick retries can make the block last longer.

Paste this into your AI

```
My scraper gets Cloudflare "Error 1020: Access denied" (HTTP 403) from a website.
The response body is: <paste the body, e.g. "error code: 1020" or the HTML page>.
Explain in plain words what 1020 means, then list the likely causes in order, most likely first.
For each cause, give one way to test it and one fix.
My setup: <language + library>, <the URL pattern>, <the request headers I send, incl. User-Agent>,
<where my IP comes from: home, cloud server, VPN, proxy type + country>, <how many requests per minute>.
Tell me which signals a site owner's Cloudflare rule could match on, and what I can change on my side.
```

## Dev details

The status is always 403. You will see one of 2 bodies.

Plain text. It is often seen by curl and API clients:

```text
HTTP/1.1 403 Forbidden

error code: 1020
```

An HTML page, the way web browsers show it:

```text
Access denied
Error code 1020
You do not have access to <site>.
The site owner may have set restrictions that prevent you from accessing the site.
```

The HTML source contains this:

```html
<span class="cf-code-label">Error code <span>1020</span></span>
```

Detect it in code by checking both the status and its body:

```js
const res = await fetch(url, { headers });
const body = await res.text();
if (res.status === 403 && /error code:?\s*(<span>)?1020/i.test(body)) {
  // Cloudflare 1020: an owner rule blocked this request. Change UA, IP or path, don't just retry.
  console.log("Ray ID:", res.headers.get("cf-ray"));
}
```

A few edge cases:

- **Ray ID.** Every request through Cloudflare gets one, so read the `cf-ray` header with browser developer tools or `curl -v`. The owner searches for it in Security Events.
- **Time zones.** The time on the 1020 page is in UTC, and the owner converts it to local time to find the event in Security Events.
- **Custom pages.** Owners can replace the 1020 page with their own, using a custom error rule on `cf.response.1xxx_code eq 1020`. Then the words “error code 1020” may never appear. The 403 still does.
- **Custom replies.** A Block rule with a custom response doesn’t show 1020 at all. You get whatever the owner wrote, in HTML or some other content type.
- **Rule order.** Custom rules run in order, and Block stops the rest. An early rule can block you before the later ones run.

Which block shows what page, per Cloudflare’s docs:

| What blocked you | What you get |
| --- | --- |
| API Shield schema or JWT check | 1020, status 403 |
| Old firewall rule (now deprecated) | the 1000-class error page |
| WAF custom rule, no custom reply | the WAF block page, status 403 |
| IP Access rule (IP or country) | error [1005](https://scrapenews.com/errors/cloudflare-1005-1006-1009.md), status 403 |
| Rate limiting rule | error 1015, status 429 |
| Any Block rule with a custom reply | whatever the owner wrote |

Why a 403 without “1020” can still be the same kind of block: Cloudflare upgraded old firewall rules into WAF custom rules. Those blocks now get the WAF block response. Owners can restyle it for the whole site (Error Pages > WAF block, always HTML) or per rule, in other content types too. So treat any 403 that carries a `cf-ray` header as a possible Cloudflare block, then read the body.

What the owner sees: each Ray ID in Security Events comes with your IP address, user agent and ASN, and the view may use sampled data, so an event can hide until they pick a shorter time window.

How many rules a site can have depends on its plan: 5 on Free, 20 on Pro, 100 on Business, 1,000 on Enterprise. The Free plan also has no regex. Our guess: its rules are plain matches on things like IP, country or User-Agent.

## Open questions

Cloudflare’s docs don’t print the words on its default WAF block page. A site owner on Cloudflare’s forum quoted its headline, “Sorry, you have been blocked”, and the 3 block pages we got showed it too. Cloudflare’s docs don’t say which error page a User Agent Blocking rule shows.

Why the block page wording matters: if your code spots a block by searching the body for known words, a check for “1020” misses WAF blocks completely. Better: flag any 403 that carries a `cf-ray` header, then sort by the words you find.

Why User Agent Blocking matters: it is a separate Cloudflare tool that blocks requests by their User-Agent header, on every plan, and if it answers with 1020, your fix is the User-Agent and nothing else. Until Cloudflare says, test the User-Agent first anyway. That test takes one request.

## Questions

### Can Cloudflare support unblock me from a site that shows 1020?

No. The rule belongs to the site owner, and only the owner can change it. Cloudflare's own community tip says contacting support or posting in the forum will not get you an answer.

### Is error 1020 related to Cloudflare Access?

No. 1020 means you hit a security rule the site owner set up. Cloudflare's community tip says it has nothing to do with the Cloudflare Access product.

### Why does curl print just "error code: 1020"?

That text is the server's reply, not a curl error. A curl maintainer said so on the curl issue tracker. Run curl with -v to see the 403 status and the headers.

## scrapenews difficulty

Not scored. We have 1 of 8 factors; a score needs 3.

| Factor | What we found | Source |
| --- | --- | --- |
| Checks stacked | IP reputation, header and HTTP/2 fingerprint | [developers.cloudflare.com](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/) |

Our analysis of 1 sourced facts; measured runs replace them as they come. [How we rate difficulty](https://scrapenews.com/rating.md)

## Related

- [Why am I blocked? How to avoid getting blocked while scraping](https://scrapenews.com/guides/how-to-avoid-getting-blocked-scraping.md)  (Guide)
- [Scraper and unblocker APIs](https://scrapenews.com/compare/scraper-apis.md)  (Compare)
- [Cloudflare "Just a moment...Enable JavaScript and cookies to continue"](https://scrapenews.com/errors/cloudflare-just-a-moment.md)  (Error)
- [Cloudflare Error 1005, 1006, 1009](https://scrapenews.com/errors/cloudflare-1005-1006-1009.md)  (Error)
- [Cloudflare Error 1010](https://scrapenews.com/errors/cloudflare-1010.md)  (Error)
- [Cloudflare Error 1015](https://scrapenews.com/errors/cloudflare-1015.md)  (Error)

## Sources

1. [Cloudflare docs: Error 1020](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1020/) developers.cloudflare.com
2. [Cloudflare docs: Firewall rules upgrade (different error page for blocked requests)](https://developers.cloudflare.com/waf/reference/legacy/firewall-rules-upgrade/) developers.cloudflare.com
3. [Cloudflare docs: WAF custom rules](https://developers.cloudflare.com/waf/custom-rules/) developers.cloudflare.com
4. [Cloudflare docs: Rules language fields reference](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/) developers.cloudflare.com
5. [Cloudflare docs: Cloudflare Ray ID](https://developers.cloudflare.com/fundamentals/reference/cloudflare-ray-id/) developers.cloudflare.com
6. [Cloudflare docs: Custom error rules examples (1020 page)](https://developers.cloudflare.com/rules/custom-errors/example-rules/) developers.cloudflare.com
7. [Cloudflare Community: Access was denied Error code 1020 (Community Tip)](https://community.cloudflare.com/t/community-tip-access-was-denied-error-code-1020/66439) community.cloudflare.com
8. [curl issue #5127: what is the meaning of error code 1020?](https://github.com/curl/curl/issues/5127) github.com
9. [acheong08/ChatGPT issue #963: "error code: 1020"](https://github.com/acheong08/ChatGPT/issues/963) github.com
10. [lutris/website issue #630: Access denied, Error code 1020](https://github.com/lutris/website/issues/630) github.com
11. [Cloudflare docs: API Shield schema validation](https://developers.cloudflare.com/api-shield/security/schema-validation/) developers.cloudflare.com
12. [Cloudflare docs: API Shield JWT validation](https://developers.cloudflare.com/api-shield/security/jwt-validation/) developers.cloudflare.com
13. [Cloudflare docs: Bot scores](https://developers.cloudflare.com/bots/concepts/bot-score/) developers.cloudflare.com
14. [Cloudflare docs: Error 1010](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1010/) developers.cloudflare.com
15. [Cloudflare docs: Error 1015](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1015/) developers.cloudflare.com
16. [Cloudflare docs: Troubleshoot Error Pages issues (which block shows which page)](https://developers.cloudflare.com/rules/custom-errors/troubleshooting/) developers.cloudflare.com
17. [Cloudflare docs: Error page types](https://developers.cloudflare.com/rules/custom-errors/reference/error-page-types/) developers.cloudflare.com
18. [Cloudflare docs: User Agent Blocking](https://developers.cloudflare.com/waf/tools/user-agent-blocking/) developers.cloudflare.com
19. [Cloudflare Community: Cannot turn off "Sorry, you have been blocked"](https://community.cloudflare.com/t/cannot-turn-off-sorry-you-have-been-blocked/479282) community.cloudflare.com

## Up

- [Home](https://scrapenews.com/index.md)
- [Errors & CAPTCHAs](https://scrapenews.com/errors.md)
