Setup guides

Use ProxyHQ with your tools.

Use ProxyHQ with Scrapy

Send Scrapy requests through ProxyHQ.

Connection details

Use these values. Your login and password are in your dashboard.

TypeHTTP (or SOCKS5)
Hostgw.proxyhq.net
Port (HTTP / HTTPS)823
Port (SOCKS5)824
Sticky ports10000 - 20000
UsernameYOUR_LOGIN
PasswordYOUR_PASSWORD

Steps

  1. Scrapy's built-in proxy support reads the proxy from a request. Set it with the proxy key in meta.
  2. Put your login and password in the proxy URL. Scrapy turns them into the right header for you.
  3. Run the spider and check the IP in the response.
import scrapy

PROXY = "http://YOUR_LOGIN__cr.us:[email protected]:823"

class IpSpider(scrapy.Spider):
    name = "ip"

    def start_requests(self):
        yield scrapy.Request("https://api.ipify.org", meta={"proxy": PROXY})

    def parse(self, response):
        self.logger.info("IP: %s", response.text)
To use the same proxy for every request, set it in a small downloader middleware or when you create each Request.
For several countries, create one URL per country by changing the __cr. code in the login.

Choose a country or a sticky IP

Add __cr.de (or another country code) to the end of your login to choose a country. Use a port from 10000 to 20000 for a sticky IP. See country targeting and rotating vs sticky.

Stuck? See troubleshooting or email [email protected].

More guides