Scraping

Scrapy proxy setup

Scrapy has proxy support built in — no third-party middleware needed. Enable HttpProxyMiddleware and set the proxy in each Request's meta, and your whole crawl exits from rotating residential IPs.

Get 1 GB of residential data — freeon your first $10+ top-upClaim it

Connection details

proxmint · gateway
Host : Port (HTTP)gw.proxmint.com:823
Host : Port (SOCKS5)gw.proxmint.com:824
UsernamePROXY_USER
PasswordPROXY_PASS

Swap PROXY_USER / PROXY_PASS for the credentials on your dashboard. New here? Create an account to generate a key.

Scrapy proxy example

python
# settings.py — the proxy middleware ships with Scrapy
DOWNLOADER_MIDDLEWARES = {
    "scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware": 750,
}
spider.py
import scrapy

class ExampleSpider(scrapy.Spider):
    name = "example"

    def start_requests(self):
        proxy = "http://PROXY_USER:PROXY_PASS@gw.proxmint.com:823"
        for url in ["https://example.com", "https://example.org"]:
            yield scrapy.Request(url, meta={"proxy": proxy}, callback=self.parse)

    def parse(self, response):
        yield {"url": response.url, "title": response.css("title::text").get()}

Steer the exit IP from the username

append to your username
CountryPROXY_USER__cr.us
Country + cityPROXY_USER__cr.us;city.newyork
Sticky IP (30 min)PROXY_USER__sessid.abc123;sessttl.30

Tips & gotchas

  • Set proxy in meta per request so you can mix pools or targets in one crawl.
  • Tune CONCURRENT_REQUESTS and AUTOTHROTTLE — residential exits reward polite crawling.

Scrapy, answered

Do I need scrapy-rotating-proxies?

No. The gateway rotates IPs for you on the rotating port, so Scrapy's built-in HttpProxyMiddleware is enough — one proxy URL, a new residential IP per request.

How do I geo-target a Scrapy crawl?

Append targeting to the username in the proxy meta, e.g. PROXY_USER__cr.de for Germany. You can set different targets on different requests within the same spider.

Ready to route Scrapy through residential IPs?

Create an account, paste the code above, and we'll add your first 1 GB of residential free on your first top-up. Pay by the GB after that — no subscription.