pip install proxywhirlfrom proxywhirl import ProxyWhirl
rotator = ProxyWhirl(proxies=["http://p1:8080", "http://p2:8080"])
response = rotator.get("https://api.example.com/data")
# Dead proxies auto-ejected ✓ | Slow ones deprioritized ✓ | Fast ones favored ✓# Switch strategies on the fly
rotator = ProxyWhirl(strategy="performance-based")
rotator.set_strategy("geo-targeted", preferences={"US": [...], "EU": [...]})| Strategy | Best For |
|---|---|
round-robin |
Even distribution |
random |
Unpredictable patterns |
weighted |
Favor reliable proxies |
least-used |
Even load balance |
performance-based |
Lowest latency |
geo-targeted |
Regional routing |
session-persistence |
Sticky sessions |
cost-aware |
Budget optimization |
composite |
Custom pipelines |
from proxywhirl import ProxyFetcher
# Grab 300+ validated proxies in seconds
proxies = await ProxyFetcher().fetch_all(validate=True)|
Python API rotator.get(url)
rotator.post(url, json=data)
async with AsyncProxyWhirl() as async_rotator:
await async_rotator.get(url) |
CLI proxywhirl fetch
proxywhirl pool list
proxywhirl health |
REST API docker-compose up -d
curl localhost:8000/api/proxies |
📖 Full Documentation
🎯 Strategy Guide
🤖 MCP Server
📓 Examples
GitHub · Issues · MIT License
Built with ❤️ for ethical web automation