Proxy guide

How to Rotate Proxies in Python

Rotating proxies in Python is useful when a script needs fresh network paths across repeated requests. Proxy11 gives you a proxy list API and a small Python SDK with a built-in rotator.

SDKs

Example

pip install proxy11 requests
from proxy11 import ProxyClient
import requests

client = ProxyClient("YOUR_API_KEY")
rotator = client.rotator(country="us", proxy_type="anonymous", auto_refresh=True)

proxy = rotator.next()
response = requests.get(
    "https://httpbin.org/ip",
    proxies={"http": f"http://{proxy}", "https": f"http://{proxy}"},
    timeout=15,
)
print(response.json())

Practical Tips

  • Start with a small limit and refresh the pool when proxies fail.
  • Use country and anonymity filters only when your task needs them.
  • Set request timeouts so dead public proxies do not stall your script.

Proxy API

Fetch proxy lists in TXT, JSON, CSV, or XML formats.

API documentation

Python SDK

Install with pip and use rotators or requests sessions.

Python GitHub repo

Node.js SDK

Install with npm and use async proxy helpers.

Node.js GitHub repo