How to Use a Free Proxy List for Web Scraping with Python
Web scrapers get banned by IP. The fix is straightforward: route your requests through different IP addresses. This tutorial shows you how to pull a free proxy list, set it up with Python's requests library, and build a rotating proxy pattern with proper error handling.
Step 1: Get a Free Proxy List
ProxyForge publishes a tested, auto-refreshed list of working proxies. You can fetch it directly:
import requests
# Fetch the latest tested proxy list from ProxyForge
resp = requests.get("https://proxyforge.dev/proxies/curated.json", timeout=10)
data = resp.json()
# Build a list of proxy URLs (HTTP proxies only)
proxies_raw = [
p for p in data.get("proxies", [])
if p.get("type") == "http" and p.get("alive")
]
proxy_list = [f"http://{p['ip']}:{p['port']}" for p in proxies_raw]
print(f"Loaded {len(proxy_list)} live proxies")
The JSON includes ip, port, type, country, and alive fields. Filtering for alive=true skips the dead ones — ProxyForge tests each proxy every 6 hours so you're starting with a current list.
You can also browse by country (e.g. [GB proxies at /proxies/gb/](/proxies/gb/)) or by protocol at [/proxies/http/](/proxies/http/).
Step 2: Make a Single Request Through a Proxy
The requests library accepts a proxies dict. The keys are the scheme you want to proxy:
import requests
proxy_url = "http://45.77.56.114:3128" # replace with a live proxy
proxies = {
"http": proxy_url,
"https": proxy_url,
}
try:
resp = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=10,
)
print(resp.json()) # {"origin": "45.77.56.114"}
except requests.exceptions.ProxyError as e:
print(f"Proxy error: {e}")
except requests.exceptions.Timeout:
print("Timed out")
Free proxies fail often — always wrap requests in try/except and set a timeout. A 10-second timeout is a reasonable default; anything slower is not usable for scraping.
Step 3: Build a Rotating Proxy Pool
A single proxy will get banned fast. The real pattern is to cycle through your list and automatically skip dead ones:
import requests
import random
import time
def load_proxies():
resp = requests.get("https://proxyforge.dev/proxies/curated.json", timeout=10)
data = resp.json()
return [
f"http://{p['ip']}:{p['port']}"
for p in data.get("proxies", [])
if p.get("type") == "http" and p.get("alive")
]
def get_proxy(proxy_list):
return {"http": random.choice(proxy_list), "https": random.choice(proxy_list)}
def scrape(url: str, proxy_list: list, retries: int = 3) -> str | None:
for attempt in range(retries):
proxy = get_proxy(proxy_list)
try:
resp = requests.get(url, proxies=proxy, timeout=10, headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 Chrome/124 Safari/537.36"
})
if resp.status_code == 200:
return resp.text
if resp.status_code in (403, 429, 503):
time.sleep(2 ** attempt) # exponential backoff on blocks
except (requests.exceptions.ProxyError,
requests.exceptions.Timeout,
requests.exceptions.ConnectionError):
pass # dead proxy — try the next one
return None
# Usage
proxy_list = load_proxies()
html = scrape("https://example.com/products", proxy_list)
if html:
print(f"Got {len(html)} bytes")
else:
print("All retries failed")
Key points in this pattern:
- Random selection on each request — spreads traffic across many IPs
- Exponential backoff on 403/429 — avoids hammering a site that's already blocking you
- Silent exception handling — dead proxies don't crash the loop
Step 4: Track and Remove Dead Proxies
Random selection wastes time re-trying proxies that are consistently dead. A light failure-tracking layer fixes this:
from collections import defaultdict
failure_counts = defaultdict(int)
MAX_FAILURES = 3
def get_healthy_proxy(proxy_list):
healthy = [p for p in proxy_list if failure_counts[p] < MAX_FAILURES]
if not healthy:
return None
return random.choice(healthy)
def scrape_with_tracking(url, proxy_list, retries=3):
for _ in range(retries):
proxy_url = get_healthy_proxy(proxy_list)
if not proxy_url:
break
proxy = {"http": proxy_url, "https": proxy_url}
try:
resp = requests.get(url, proxies=proxy, timeout=10)
if resp.status_code == 200:
return resp.text
failure_counts[proxy_url] += 1
except Exception:
failure_counts[proxy_url] += 1
return None
After MAX_FAILURES misses, a proxy is excluded from selection for the rest of the session.
When Free Proxies Are Not Enough
Free proxies have real limits:
- High failure rate — 20–40% are dead at any moment, even on a tested list
- Slow — average latency is 3–8s; many are located overseas
- Low anonymity — transparent proxies reveal your real IP via
X-Forwarded-For - Not suitable for Cloudflare, Amazon, or Instagram — these block datacenter IP ranges
If you're hitting a wall on heavily-protected sites or need reliable throughput for production scraping, managed residential proxy services like Bright Data and SmartProxy provide pools of real residential IPs with much higher success rates.
For lighter-weight scraping needs — personal projects, research, testing scrapers before investing in paid infrastructure — the ProxyForge free list is a solid starting point. Download ProxyForge to auto-test and rotate proxies locally on your machine — one-off $29 unlock, no subscription.
Summary
The core pattern:
- Fetch a tested proxy list (ProxyForge or similar)
- Pass the proxy via the
requestsproxiesdict - Rotate randomly on each request
- Retry on connection errors and rate-limit responses with exponential backoff
- Track failures and skip consistently bad proxies
Free proxies work well for low-volume scraping and testing. When you need reliability at scale, move to paid residential proxies.
Free proxies break. ProxyForge doesn't.
The free lists above are public and often unreliable. ProxyForge auto-tests and rotates proxies on your machine, your IP — no stale lists, no shared pools, no surprises. One-off purchase, no subscription.
Download ProxyForge free →Need guaranteed uptime? Try a premium provider