Residential Proxy Best Practices
Residential proxies provide IP addresses from real ISPs across 195+ countries. They carry the highest trust level of any proxy type — but using them effectively requires understanding rotation, targeting, bandwidth management, and anti-detection patterns. Follow these best practices to achieve 95%+ success rates.
Understanding Residential IP Pools
Hex Proxies' residential network provides rotating IP addresses from genuine residential ISPs worldwide. Each request can route through a different IP, or you can use sticky sessions to maintain the same IP. The pool is massive — providing IP diversity that makes fingerprinting practically impossible.
Best Practice 1: Country Targeting
Always target the country closest to your use case:
def get_residential_proxy(username: str, password: str, country: str = "") -> str: user = f"{username}-country-{country.lower()}" if country else username return f"http://{user}:{password}@gate.hexproxies.com:8080"
# Target US for US-specific content us_proxy = get_residential_proxy("YOUR_USER", "YOUR_PASS", "US")
# Target UK for UK pricing uk_proxy = get_residential_proxy("YOUR_USER", "YOUR_PASS", "GB") ```
**Why this matters**: Many sites serve different content by country. Using a US proxy to scrape UK pricing returns US prices — which is wrong data.
Best Practice 2: Optimize Bandwidth
Residential plans are typically billed per GB. Minimize waste:
- **Always send compression headers**: `Accept-Encoding: gzip, deflate, br`
- **Block unnecessary resources** in browser automation (images, videos, fonts)
- **Use HEAD requests** when you only need status codes
- **Cache responses** for pages you visit repeatedly
- Extract only the data you need — do not store full HTML for simple data points
Best Practice 3: Request Pacing
Residential IPs have high trust, but they are not invincible:
import randomasync def paced_fetch(url: str, proxy: str) -> str: # Random delay mimics human browsing patterns await asyncio.sleep(random.uniform(1.5, 4.0)) async with httpx.AsyncClient(proxy=proxy, timeout=30) as client: resp = await client.get(url, headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36", "Accept": "text/html,application/xhtml+xml", "Accept-Encoding": "gzip, deflate, br", }) return resp.text ```
Best Practice 4: Session Strategy
| Task | Session Type | Duration | |------|-------------|----------| | Product scraping | Rotating | Per request | | Account creation | Sticky | 30 minutes | | Search scraping | Sticky | Per search session (5-10 queries) | | Price monitoring | Rotating | Per request | | Social media ops | Sticky | Persistent (hours) |
Best Practice 5: Error Handling
Residential networks have slightly higher variance than ISP proxies. Build robust error handling:
async def resilient_fetch(url: str, username: str, password: str, max_retries: int = 3) -> dict:
for attempt in range(max_retries):
proxy = get_residential_proxy(username, password)
try:
async with httpx.AsyncClient(proxy=proxy, timeout=20) as client:
resp = await client.get(url)
if resp.status_code == 200:
return {"success": True, "body": resp.text, "attempts": attempt + 1}
if resp.status_code in (403, 429):
await asyncio.sleep(2 ** attempt)
continue
except (httpx.TimeoutException, httpx.ConnectError):
await asyncio.sleep(1)
continue
return {"success": False, "body": "", "attempts": max_retries}Best Practice 6: Monitor Usage
Track your residential bandwidth consumption: - Set up daily usage alerts in the Hex Proxies dashboard - Log per-request bandwidth to identify wasteful patterns - Compare bandwidth vs success rate — high bandwidth with low success indicates blocked requests re-downloading error pages
Cost Optimization Summary
| Optimization | Bandwidth Saving | Implementation Effort | |---|---|---| | Compression headers | 30-50% | 1 line of code | | Block images/fonts | 60-80% | Low | | Conditional requests | 90%+ for repeats | Medium | | HEAD requests | 95%+ | 1 line of code |
Hex Proxies residential network processes 800TB of data daily across 50 billion weekly requests. Our infrastructure supports SOCKS5, HTTP, and HTTPS with country-level targeting across 195+ countries.