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.
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.
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
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.
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.
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:
- Open Chrome.
- Select More in the top right corner
- Then click on More tools and then click on Extensions
- 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.
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:
- Open Chrome.
- Select More in the top right corner
- Then click on History
- Choose Clear Browsing Data
- Use All time for the time range
- Check Cookies and other site data, and then Cached images and files
- Click on Clear data
- After the process is finished, restart your browser
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
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:
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:
- Open Chrome.
- Select More in the top right corner
- Click on the Settings
- Then, click on Privacy and security in the left menu
- Now, click on the Third-party cookies option
- Finally, Allow third-party cookies
- Restart your browser and try again
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.
10 tips on how to bypass Cloudflare error 1020 when web scraping
- 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.
- Rotate IP addresses: Use proxy servers to distribute your requests across multiple IP addresses. This will help solve the problem of Cloudflare IP banning.
- 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.
- Use headers wisely: Mimic real browser behavior by using user-agent strings and headers that won't immediately flag your scrapers as bots.
- 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.
- 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.
- 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.
- Dynamic timing and request patterns: Adjust the timing of your requests dynamically to more closely mimic human browsing patterns.
- Use residential proxies: These proxies are less likely to be blocked because they come from real ISP-assigned IP addresses.
- 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.
Blocked again? Apify Proxy will get you through
Improve the performance of your scrapers by smartly rotating datacenter and residential IP addresses.
Available on all Apify plans
The 1020 error isn't the only code you might run into when scraping. Find out how to solve the 403 error.