Integrations · Automation & scraping

Use HProxy with Python Requests.

Route the requests library through an HProxy residential IP in three lines.

Requests is the most widely used HTTP library in Python, the default choice for scripts, scrapers and API clients.

A script that hits a site repeatedly from one address is the pattern rate limits are built to catch. Routing Requests through a rotating residential pool spreads the traffic so each address stays under the radar.

Setting up HProxy in Python Requests

  1. 1.Copy your proxy host, port and login from the HProxy dashboard.
  2. 2.Build a proxies dict pointing both http and https at the same proxy URL.
  3. 3.Pass it to every request, or set it once on a session.
import requests

proxies = {
  "http":  "http://user-country-us:pass@res.hproxy.com:8080",
  "https": "http://user-country-us:pass@res.hproxy.com:8080",
}
r = requests.get("https://ipinfo.io/json", proxies=proxies)
print(r.json())

Worth knowing

The username carries targeting: user-country-de sends you out of Germany, add -city-frankfurt to go finer.

The host, port and login shown here are the format; your exact values are on your dashboard, ready to copy.

HProxy.

Ready when you are.Your dashboard is ten seconds away.

Get Startedor talk to us at support@hproxy.com
HProxy