PY
Languages & HTTP Clients
Python (Requests) proxy integration
Python's Requests library has first-class proxy support, so adding Aethyn residential proxies is a two-line change. Pass the proxy URL in the standard username:password@host:port form and every request — HTTP and HTTPS — tunnels through a real residential IP.
Setup steps
- 1Install Requests with pip install requests.
- 2Grab your Aethyn username (aethyn-XXXXX) and password from the dashboard.
- 3Build the proxy URL and pass it to the proxies argument.
- 4Add targeting suffixes (e.g. -country-us) to the username as needed.
Code
Basic rotating request
import requests
proxy = "http://aethyn-XXXXX:PASSWORD@proxy.aethyn.io:2099"
proxies = {"http": proxy, "https": proxy}
resp = requests.get("https://httpbin.org/ip", proxies=proxies, timeout=30)
print(resp.json()) # each call exits from a fresh residential IPCountry targeting + sticky session
import requests
# US exit held for ~10 minutes via a sticky session id
user = "aethyn-XXXXX-country-us-session-abc123-lifetime-10"
proxy = f"http://{user}:PASSWORD@proxy.aethyn.io:2099"
proxies = {"http": proxy, "https": proxy}
resp = requests.get("https://example.com", proxies=proxies, timeout=30)
print(resp.status_code)Replace aethyn-XXXXX and PASSWORD with your dashboard credentials. See the full targeting reference and protocol/port list. Or use the official proxy-builder-sdk to build targeting strings without hand-assembling usernames.
Tips
- Always set a timeout — residential routes are slower than datacenter.
- Reuse a requests.Session() for connection pooling across many requests.
- Use a sticky session when a flow spans multiple requests (login, checkout).
Python (Requests) proxy FAQ
Do I need a different proxy for HTTPS?
No. The HTTP port (2099) handles HTTPS automatically via the CONNECT method, so the same proxy URL works for both http and https in the proxies dict.
How do I rotate IPs in Python Requests?
Aethyn rotates by default — every request without a session id gets a fresh exit. To hold an IP, add a -session-<id>-lifetime-<minutes> suffix to the username.
Docs, solutions & blog
Related solution guideEnd-to-end workflow that pairs with this integration.Python SDKproxy-builder-sdk on PyPI — requests/httpx helpers and validated targeting.Premium residential proxiesCost-efficient rotating residential pool from €2.00/GB for bulk scraping and monitoring.Elite residential proxiesCurated high-trust pool with city and ISP targeting for hard anti-bot targets.Quickstart docsCredentials, endpoints, and your first proxied request.Related blog articleDeeper context on proxies, errors, and anti-bot for this stack.