How to Avoid IP Bans When Scraping
IP bans usually come from behavior, not bad luck — too many requests, sloppy headers, and a fingerprint that screams "bot." Here's how to scrape within the rules and keep your requests flowing.
Why sites ban IPs (and what to fix first)
Most blocks are triggered by how you request, not who you are.
Three signals do the heavy lifting behind most bans:
- Rate & volume — too many requests per second from one IP, or a perfectly even cadence no human would produce.
- Fingerprint — TLS/JA3, HTTP/2 frame order, and header ordering that don't match the browser you claim to be.
- Headers — a missing or default
User-Agent, noAccept-Language, a stale or absentReferer.
Before optimizing any of this, read the target's robots.txt and Terms of Service. Scraping public data is often fine; hammering an endpoint, ignoring published rate limits, or collecting personal data can break ToS and, in some jurisdictions, the law. Honor crawl-delay, cache what you fetch, and don't retry a site into the ground.
Once you're scraping responsibly, your main lever is how IPs are assigned:
| Approach | Best for | Trade-off |
|---|---|---|
| Rotating (new IP per request/batch) | High-volume public pages, search-style crawls | Spreads load, but breaks sessions, carts and logins |
| Sticky / session (same IP for a while) | Logged-in flows, multi-step navigation, pagination | Looks human, but concentrates load on one exit |
s4m runs datacenter proxies — authenticated SOCKS5 + HTTP, not residential. They're fast and cheap per GB, but some consumer sites flag datacenter ranges more readily, so pair them with clean headers and honest rate limits. Need one stable exit for logins? Add a dedicated IP. Prefer a full tunnel? See /vpn/, weigh options at /compare/, or read more guides.
The levers that keep you unbanned
Combine these — no single trick beats a good anti-bot system.
Rate-limit and jitter
Cap concurrency, add random delays between requests, and honor crawl-delay plus any 429 / Retry-After the server sends.
Rotate or stay sticky
Rotate IPs for stateless, high-volume crawls; keep a sticky exit for logged-in, multi-step flows. Many jobs mix both.
Clean fingerprint
Send realistic browser headers with a consistent Accept-Language and Referer instead of library defaults that mark you as a bot.
Back off on failure
Use exponential backoff with jitter on 429 and 5xx responses, and stop entirely when a site clearly signals stop.
Per-IP usage control
s4m limits are admin-tunable per IP, account and account-type, so one runaway job can't torch a shared exit or your budget.
No-logs, RAM-first
Authenticated proxies over TLS, no-logs by design. Your target list and traffic stay yours, on card or crypto.
A ban-resistant scraping setup
Six steps from first request to a durable crawler.
Check robots.txt and ToS
Confirm the endpoint allows automated access, note any crawl-delay, and skip personal or clearly off-limits data.
Set a request budget
Pick a concurrency cap and a target requests-per-second well below what would look abusive, then add random delay.
Send realistic headers
Set a real User-Agent, Accept, and Accept-Language, and keep them consistent for the life of a session.
Choose rotating vs sticky
Rotate exits for stateless pages; reuse one sticky exit per logged-in session so state doesn't break mid-flow.
Add exponential backoff
On 429 / 503, wait Retry-After (or 2^n) plus jitter and retry a few times, then give up gracefully.
Cap per-IP usage
Use s4m per-IP limits so a single scrape can't exhaust an exit, and monitor metered usage as you scale.
Python: polite crawler over s4m proxies
Sticky session, realistic headers, backoff with jitter. Swap USER:PASS for your credentials — never hard-code a real IP.
import random
import time
import requests
# s4m datacenter proxies (authenticated). Placeholder host only.
USER, PASS = "USER", "PASS"
HTTP = f"http://{USER}:{PASS}@proxy.s4m.online:3128"
SOCKS = f"socks5://{USER}:{PASS}@proxy.s4m.online:1080" # pip install requests[socks]
PROXIES = {"http": HTTP, "https": HTTP}
HEADERS = {
"User-Agent": (
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/125.0 Safari/537.36"
),
"Accept": "text/html,application/xhtml+xml;q=0.9,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.9",
}
def polite_get(url, session, max_retries=5):
for attempt in range(max_retries):
r = session.get(url, headers=HEADERS, proxies=PROXIES, timeout=20)
if r.status_code == 429 or r.status_code >= 500:
wait = float(r.headers.get("Retry-After", 2 ** attempt))
time.sleep(wait + random.uniform(0, 1)) # backoff + jitter
continue
r.raise_for_status()
return r
raise RuntimeError(f"gave up after {max_retries} tries: {url}")
def crawl(urls):
# One Session = one sticky exit for this run; open a new one to rotate.
with requests.Session() as s:
for url in urls:
resp = polite_get(url, s)
yield url, resp.text
time.sleep(random.uniform(1.5, 4.0)) # rate-limit + jitter
if __name__ == "__main__":
for url, html in crawl(["https://example.com/page/1"]):
print(url, len(html))Questions, answered
Are datacenter proxies enough to avoid bans?
They hide your origin IP and spread load, which prevents a lot of rate-based blocks. But s4m proxies are datacenter, not residential, and some consumer sites flag datacenter ranges more readily — so combine them with clean headers, sane rate limits, and sticky sessions where state matters.
Should I use rotating or sticky proxies?
Rotate exits for stateless, high-volume public pages so no single IP draws attention. Keep a sticky session when you're logged in or walking a multi-step flow, since a changing IP mid-session looks suspicious and can break carts or auth. Many jobs mix both.
Is web scraping legal?
It depends on your jurisdiction, the data, and the site's terms. Public, non-personal data is often fine, but a platform's ToS may forbid automated access even when it's technically possible, and personal data carries extra rules. Always check robots.txt and ToS, and scrape conservatively.
How do I stop one job from burning all my quota?
s4m proxies are metered and pay-as-you-go, with admin-tunable limits per IP, per account, and per account-type. Cap concurrency in your crawler and set a per-IP usage limit so a runaway loop can't drain your budget or a shared exit.
Can I get a stable IP for logged-in scraping?
Yes. The dedicated personal IP add-on is a static exit you can optionally unlink from your identity and bind to either a proxy or the VPN — useful when a target ties a session to one consistent address.
Scrape smarter, not harder
Authenticated SOCKS5 + HTTP datacenter proxies, metered pay-as-you-go, with per-IP usage limits and an optional dedicated IP. No-logs by design — and honest that these are datacenter, not residential, exits.
People found this page by searching for
- how to avoid IP bans when scraping
- what are ISP (static residential) proxies
- proxy for scraping with crypto payment
- how to set up a proxy in Chrome and Firefox
- Puppeteer proxy setup with authentication
- fresh free proxy list
- how free proxy list works
- http proxy
- vpn kill switch
- WireGuard vs OpenVPN
- socks5 proxy for business
- openvpn
- proxy authentication tutorial
- how to configure ip address
- ip address
- proxy authentication
Real search phrases this page answers — the linked ones open the page that covers them in depth.