Glossary Proxy features
IP rotation
IP rotation: IP rotation is the practice of changing the IP address your requests come from, either automatically through a rotating proxy or by cycling through your own list, to spread traffic and avoid per-IP limits and blocks.
Also called: proxy rotation, rotating IPs
Key takeaways
- Rotation spreads requests so no single IP exceeds a website’s rate limits.
- It can be done by the provider (rotating gateway) or in your own code (cycling a list).
- Rotate between logical sessions, not in the middle of them.
- Rotation does not fix headers, fingerprints or timing that look automated.
- Track success per IP and retire addresses that start failing.
What is IP rotation?
Websites track how many requests come from each IP address. Past a threshold, they slow you down, show CAPTCHAs or block the address. IP rotation keeps each address below that threshold by distributing requests across many IPs. It is the core technique behind large-scale web scraping, SERP tracking and price monitoring.
Ways to rotate
| Method | How it works | Control | Effort |
|---|---|---|---|
| Rotating proxy gateway | Provider assigns a new exit per request or interval | Low | Lowest |
| Session IDs on a gateway | You change the session ID when you want a new IP | Medium | Low |
| Your own list of static proxies | Round-robin or weighted choice in code | High | Medium |
| Mobile proxy reconnect | Trigger the modem to get a new carrier IP | Medium | Medium |
| IPv6 block | Bind each request to a new address in a large block | High | Medium |
Rotation strategies
- Per request: best for independent pages, such as product detail pages.
- Per session: one IP per logical task (login, search, checkout), then rotate. This is the safest default.
- Per target: separate IP pools for different websites, so a block on one does not spread.
- Weighted by health: prefer IPs with high recent success rates, rest IPs that just returned
429.
Rotation alone is not enough
Modern bot detection looks far beyond the IP. If every request from a thousand IPs carries the same unusual user agent, the same TLS fingerprint and perfectly regular timing, the pattern is obvious. Combine rotation with:
- A realistic client whose headers and TLS handshake match the browser it claims to be.
- Cookies kept per session and per IP.
- Natural pacing with jitter, and exponential backoff after errors.
- Respect for rate limits and
Retry-Afterheaders.
Measuring rotation quality
Log for each request: exit IP, ASN, country, status code, response time and whether the page contained the expected data. Over a day you will see which IPs, subnets or ASNs perform poorly, how many unique IPs you actually received and whether the pool’s geography matches what you paid for.
Rotation and session consistency
Rotation helps with anonymous requests, but it can break anything that depends on state. Most websites tie a session to cookies, and some also check that the IP stays roughly the same. If the IP changes in the middle of a login, a checkout or a multi-page form, the site may log you out or ask for verification. Group requests that belong together into one sticky session and rotate only between independent tasks.
A simple rotation loop with retries
import random, time, requests
def fetch(url, tries=4):
for attempt in range(tries):
session_id = random.randint(1, 10**9)
proxy = f"http://USER-session-{session_id}:[email protected]:7777"
r = requests.get(url, proxies={"http": proxy, "https": proxy}, timeout=30)
if r.status_code == 200:
return r
time.sleep(2 ** attempt) # back off before trying a new IP
return None
Each retry uses a new session ID, so a new IP, and waits a little longer than the last, following exponential backoff.
Signals that rotation is too aggressive
- The same headers and fingerprint appear from hundreds of IPs in a short time.
- Requests never carry cookies a normal visitor would have collected.
- IPs jump between countries or networks for what should look like one user.
Anti-bot systems link requests through these signals, so careful rotation looks more like many different ordinary visitors, each with a believable setup.
Frequently asked questions
How often should I rotate IPs?
Rotate between independent tasks, and keep one IP for the duration of any task that involves cookies or logins. For simple page fetches, per-request rotation is fine.
Is IP rotation legal?
Yes, it is a standard networking practice. Legality depends on what you collect and whether you respect site terms and data protection law.
Does rotating IPs prevent CAPTCHAs?
It reduces CAPTCHAs caused by per-IP rate limits. CAPTCHAs triggered by fingerprints or behaviour will continue until those are fixed.
How many IPs do I need for rotation?
Divide your target request rate by the rate one IP can sustain without triggering limits. Rotating residential pools remove most of this planning.
Can I rotate IPs without a proxy service?
You can restart a home router or mobile connection to get a new IP from your ISP, or rent several servers. Both are slow and limited compared with a rotating proxy pool.
Should I rotate IPs for logged-in sessions?
No. Keep one IP for the whole session, or for the life of the account. Rotating while logged in looks like a stolen session and often triggers verification or a logout.
Is per-request rotation always best for scraping?
Not always. Some sites set cookies on the first page and expect them on the next. Short sticky sessions of a few minutes, with rotation between them, often work better than a new IP on every request.