Same code
import os, requests
proxy = os.environ["PROXY_URL"]
r = requests.get("https://httpbin.org/ip", proxies={"http": proxy, "https": proxy}, timeout=30)Works with Rayobyte gateways and Webshare's backbone or direct IPs. See Rayobyte with Python, Webshare with Python and Python Requests proxies.
Rotating a Webshare list yourself
With Webshare's direct connection, download your list and rotate in code:
import itertools
proxies = itertools.cycle(open("webshare_list.txt").read().split())
def next_proxy():
host, port, user, pw = next(proxies).split(":")
url = f"http://{user}:{pw}@{host}:{port}"
return {"http": url, "https": url}With Rayobyte rotating products, the gateway rotates for you.
Differences for Python workloads
| Rayobyte | Webshare | |
|---|---|---|
| Cheapest easy-site option | Rotating datacenter, $0.30/GB | Datacenter list, about 3 cents per IP |
| Residential at volume | Cheaper from about 50 GB | Monthly plans |
| Drop-in unblocking | Web Unblocker as a proxy URL | None |
| SOCKS5 | Yes, plus UDP | Yes |
| Free development | Trial | Free plan forever |
At the time of writing.
Which to choose
| Python workload | Better fit |
|---|---|
| Large crawls of lenient sites | Webshare list |
| Protected sites at volume | Rayobyte residential |
| A few impossible domains | Rayobyte Web Unblocker |
| Local development and CI | Webshare free plan |
With Geonode: Python across all three.
Residential tip: A common split is Webshare for cheap per-IP lists and Rayobyte for residential traffic, mobile IPs or managed scraping. Our using Rayobyte with Python covers each Rayobyte product.
A real-world example
A data engineer's Python scraper uses a dictionary of proxy URLs keyed by route: ws_list for a Webshare backbone URL, ry_resi for Rayobyte Premium Residential and ry_unblock for the Web Unblocker. A small function picks the route by domain and falls back to the next one on failure. When a new protected site appears, adding it to the routing dictionary is the only code change.
Detecting blocks
def looks_blocked(r, marker):
return r.status_code in (403, 429) or marker not in r.text or "captcha" in r.text.lower()Treat a blocked response as a failure, retry once with a new session, then fall back to the next route.
Pros and cons for Python
Rayobyte
- Web Unblocker usable as a normal proxy URL.
- SOCKS5 UDP for unusual clients.
Webshare
- Cheapest lists, rotatable in code or via the backbone.
- Python samples in its docs.
Budget tip: To test the Webshare side of this comparison, start with Webshare's free plan: 10 datacenter proxies and 1 GB a month with no card. See using Webshare with Python.
Bottom line
Keep proxy URLs in configuration and route domains between the two; Python code doesn't change.
If you're still shortlisting, compare these options with the wider market in our best proxies guide, and use our cheap proxies guide to estimate a sensible budget.
Proxy tip: If your residential usage goes up and down, compare Geonode: its per-GB residential bandwidth doesn't expire, so you only pay for what you use. See Rayobyte vs Geonode vs Webshare.
Key takeaways
- Python code is identical; only proxy URLs change.
- Webshare lists can be rotated in code or via the backbone.
- Rayobyte suits residential volume and drop-in unblocking.
- Keep proxy URLs in configuration.
FAQ
How do I rotate Webshare proxies in Python?
Use the backbone with a rotate suffix, or cycle through the downloaded list.
Does Rayobyte work with HTTPX and aiohttp?
Yes, with the same proxy URL.
Which supports SOCKS5?
Both.
How do I rotate Webshare IPs per request?
Use the backbone with a rotate suffix, or cycle through your downloaded list.
Does Rayobyte rotate automatically?
Yes, on its rotating gateways; add a session ID to keep an IP.
Does async Python work with both?
Yes; aiohttp and HTTPX accept the same proxy URLs.
Should I use Requests or HTTPX?
Requests for simplicity, HTTPX if you want HTTP/2 or async.
Editorial note: Proxy providers change their pools, features and prices often, so treat any figures here as typical ranges at the time of writing and confirm current terms with the provider before you buy.