ArticleTutorial / How-toOpen-sourceProxies

How to use Zyte Smart Proxy Manager with Scrapy

Zyte Smart Proxy Manager is specifically designed for web scraping. In this article, learn how to use Zyte Smart Proxy Manager, inside your Scrapy spider.

Attila Toth

2 min read ·

How to use Zyte Smart Proxy Manager with Scrapy

How to use Zyte Smart Proxy Manager with Scrapy

Zyte Smart Proxy Manager is a proxy service, specifically designed for web scraping. In this article, you are going to learn how to use Zyte Smart Proxy Manager inside your Scrapy spider.

How Zyte Smart Proxy Manager works

Zyte Smart Proxy Manager is a smart HTTP/HTTPS downloader. When you make requests using Zyte Smart Proxy Manager it routes them through a pool of IP addresses. When necessary, it automatically introduces delays between requests and discards IP addresses to help manage crawling challenges. And simply like that, it makes a successful request hassle-free.

Zyte Smart Proxy Manager with Scrapy

In order to use Zyte Smart Proxy Manager, you need to have an account with a Zyte Smart Proxy Manager subscription. If you haven’t signed up yet you can sign up here, it’s free. When you subscribe to a plan you will get an API key. You will need to use this API key in your Scrapy project to use Zyte Smart Proxy Manager.

Install Zyte Smart Proxy Manager middleware

First thing you need to do is to install the Zyte Smart Proxy Manager middleware:

1pip install scrapy-zyte-smartproxy
Copy

Scrapy settings

Next, add these lines to the project settings:

1# enable the middleware
2DOWNLOADER_MIDDLEWARES = {'scrapy_zyte_smartproxy.ZyteSmartProxyMiddleware': 610}
3
4# enable Zyte Proxy
5ZYTE_SMARTPROXY_ENABLED = True
6
7# the APIkey you get with your subscription
8ZYTE_SMARTPROXY_APIKEY = '<your_zyte_proxy_apikey>'
Copy

Zyte Smart Proxy Manager settings

By using the middleware you add Zyte Smart Proxy Manager-specific settings to your project that you can configure. These settings can be overridden in Scrapy settings. For example, it’s recommended to set these:

  • disable the Auto Throttle addon
  • increase the maximum number of concurrent requests
  • increase the download timeout
1AUTOTHROTTLE_ENABLED = False
2CONCURRENT_REQUESTS = 32
3CONCURRENT_REQUESTS_PER_DOMAIN = 32
4DOWNLOAD_TIMEOUT = 600
Copy

If you want to learn more about the usage of Zyte Smart Proxy Manager , go to the support page.

. You can also learn the the story behind Smart Proxy Manager. Unveil the secrets behind its creation and the passion that fuels its journey.

Try Zyte API

Build your first scraper in minutes

Free trial, no credit card. From a single request to production in an afternoon.

Get started

Attila Toth

Attila's 33 articles focus on the practical mechanics of scraping at scale: proxy types and success rates, ban avoidance, and Zyte's beta APIs for specific verticals (product reviews, automotive data, job postings, real estate, and news). He also authored the "Zyte Developers Com…

More from this author

Continue reading

The Community · Newsletter

The best of Zyte and the data web, in your inbox.

One curated edition — new articles, product updates, and the stories shaping the data web. No noise.