How to fix error code 1020 (11 easy solutions in 2024)

Find out how to fix error code 1020, what's going on, and why this error code happens.

Content

Hey, we're Apify. You can build, deploy, share, and monitor your web scrapers and crawlers on the Apify platform.

What is error code 1020?

Error code 1020, known as the access denied error, occurs when Cloudflare blocks an IP address attempting to access a website. This measure protects against threats like malicious attacks and aggressive web scraping by restricting certain IPs to ensure website security.

Error Code 1020 by Cloudflare

What is causing error code 1020?

Error code 1020 is usually caused when the server detects a massive amount of requests from the same IP address. There are multiple reasons for this:

  • Using scripts that overload the website
  • Using browser extensions that are sending too many requests
  • Using bots or tools like ChatGPT
  • Having a shared IP address that gets blocked because of other users on the same IP address
  • Living in a country or region blocked by the site owner
  • And ultimately, because of web scraping

Let's take a look at how you can fix this error. There are two ways. The first applies when you're just visiting some site and get this error. In that case, continue reading the following section. But if you get this error when web scraping, click here.

How to fix error code 1020

1. See if the website is working

First, you should check if the website is working. This will eliminate aby problem on your end.

For that, you can use services such as DownDetector. Go to their page and enter the website you’re having a problem with.

If the website works well for others, continue with the following steps to fix the error code 1020.

DownDetector to see if the website is working

2. Try other pages on the site

If the website works correctly, check other pages on the same website to eliminate the possibility that you're trying to access a broken page.

Search for the website name in Google and click on other pages. Eventually, you can also use the site: command in Google to find all pages from the domain to check them. The syntax is as follows:

site: domain.com
Site command to find other pages on the domain

3. Restart your web browser

Another easy fix is to restart your browser. Close all browser windows, and make sure you also close the browser in the background. In Windows, you can do so in the “Show hidden icons” menu.

Another way is to find the process in the Task Manager and close it.

Task manager close Chrome process

4. Turn off VPN services

If you're using any VPN services such as ExpressVPN, NordVPN, etc., try to disable them and then reload the website you're trying to access.

Sometimes, the VPN services can cause errors such as error code 1020.

turn off VPN

5. Deactivate browser extensions

Some browser extensions can cause error code 1020. To eliminate this possibility, you can try to deactivate them. Here is a guide on how to deactivate browser extensions for Google Chrome:

  1. Open Chrome.
  2. Select More in the top right corner
  3. Then click on More tools and then click on Extensions
  4. Turn off all the extensions

If this solves the issue, you can turn on the extensions one by one to determine the faulty one and then replace it with an alternative.

Disable Chrome extensions

6. Purge browser cache

Another fix on our list is clearing your browser cache. Below, you can find a guide for clearing browser cache in Google Chrome:

  1. Open Chrome.
  2. Select More in the top right corner
  3. Then click on History
  4. Choose Clear Browsing Data
  5. Use All time for the time range
  6. Check Cookies and other site data, and then Cached images and files
  7. Click on Clear data
  8. After the process is finished, restart your browser
Clear cache

7. Switch to a different browser

If none of the previous steps helped resolve this error code, try using a different browser.

You can try to use one of the following browsers:

  • Chrome
  • Firefox
  • Edge
  • Opera
  • Safari
Different browsers

8. Pause firewall and antivirus programs temporarily

Another thing causing the error code 1020 could be your firewall or antivirus program.

Try to pause both the firewall and your antivirus temporarily.

You can find how to pause the firewall and the most common antivirus programs below:

Turn off antivirus programs

9. Restart your network router

Your router could be another source of this problem. There are three easy steps you can try as a fix:

  • Unplug the router from the power socket
  • Wait for 60 seconds
  • Plug the router back into the power socket

For more detailed instructions, you can watch the short video below.

10. Ensure browser cookies are enabled

Another reason you might see the error 1020 is that you have turned off cookies, and the website you are trying to approach does not allow that.

Here is how you can enable the cookies in the Google Chrome browser:

  1. Open Chrome.
  2. Select More in the top right corner
  3. Click on the Settings
  4. Then, click on Privacy and security in the left menu
  5. Now, click on the Third-party cookies option
  6. Finally, Allow third-party cookies
  7. Restart your browser and try again
Allow 3rd party cookies

11. Reach out to the website administrator

If nothing has helped, the only option is to contact the site administrator and ask if they can look into this error and grant your IP address an exception within CloudFlare.

Contact website administrator

10 tips on how to bypass Cloudflare error 1020 when web scraping

  1. Slow down your requests: By reducing the speed of your scraping activities, you can avoid hitting rate limits or appearing suspicious and behaving like a bot.
  2. Rotate IP addresses: Use proxy servers to distribute your requests across multiple IP addresses. This will help solve the problem of Cloudflare IP banning.
  3. Respect robots.txt: Always check the robots.txt file of a website. It provides guidance on what you can and can't scrape. If you don't need to scrape a particular page, skip it.
  4. Use headers wisely: Mimic real browser behavior by using user-agent strings and headers that won't immediately flag your scrapers as bots.
  5. Consider using scraping services: Tools and services designed for web scraping, such as the Apify platform or open-source web scraping libraries Crawlee and Scrapy, can help you scrape websites protected by Cloudflare and other security measures.
  6. Implement CAPTCHA-solving: if the website you're scraping uses CAPTCHAs as part of its access control, you'll need to find a way to solve those CAPTCHAs automatically.
  7. Use browser automation tools: Tools like Selenium, Playwright, or Puppeteer can simulate real user interactions more accurately, making it harder for Cloudflare to distinguish between a bot and a human user.
  8. Dynamic timing and request patterns: Adjust the timing of your requests dynamically to more closely mimic human browsing patterns.
  9. Use residential proxies: These proxies are less likely to be blocked because they come from real ISP-assigned IP addresses.
  10. HTTPS and TLS fingerprinting: Modifying the TLS fingerprint of your requests to match those of common web browsers can help avoid detection based on network traffic analysis.
🦾
Read more detailed suggestions and examples in our article on how to crawl without getting blocked

The 1020 error isn't the only code you might run into when scraping. Find out how to solve the 403 error.

David Barton
David Barton
Apifier since 2016 so learned about web scraping and automation from the experts. MSc in Computer Science from TCD. Former game designer and newspaper production manager. Now Head of Content at Apify.

Get started now

Step up your web scraping and automation