Rotation is the question every proxy user ends up asking: when should my IP change? Too often and you break sessions. Too rarely and one IP carries more traffic than a person would.
Dengz offers four rotation modes across its products. This post covers how each works, with code for the API calls, and how to pick one.
Per connection on the universal endpoint
The shared mobile proxy pool is reached through one host and port, the universal endpoint. You pick the country in the username: USER__fr, USER__de, USER__es, USER__ch, USER__gb, or USER__global for any available country.
Each new connection is served by a ready modem of that country, drawn at random among the shared modems. Dengz renews the pool IPs automatically. You do not call anything to rotate.
curl -x "http://USER__fr:PASS@HOST:PORT" "$IP_CHECK_URL"
curl -x "http://USER__fr:PASS@HOST:PORT" "$IP_CHECK_URL"
Two commands, two connections, usually two different French IPs. The unit is the connection, not the request. An HTTP client that keeps a connection alive sends every request on it through the same modem. In Python, requests.get opens a fresh connection each call, while a requests.Session reuses one:
import os
import requests
user, pwd = os.environ["DENGZ_USER"], os.environ["DENGZ_PASS"]
proxy = f"http://{user}__de:{pwd}@{os.environ['DENGZ_HOST']}:{os.environ['DENGZ_PORT']}"
proxies = {"http": proxy, "https": proxy}
url = os.environ["IP_CHECK_URL"]
# A new connection per call: usually a different German IP each time
for _ in range(3):
print(requests.get(url, proxies=proxies, timeout=30).text.strip())
# One Session keeps the connection open: same modem while it lasts
with requests.Session() as s:
for _ in range(3):
print(s.get(url, proxies=proxies, timeout=30).text.strip())
On a timer with a dedicated modem
A dedicated mobile IPv4 proxy is one physical 4G modem reserved for you. Its IP is sticky: it stays the same until you renew it. You can set automatic renewal with an interval between 5 minutes and 12 hours.
The API field is rotate_interval_secs, from 300 to 43200. Renewals are spread by plus or minus 10%, capped at 5 minutes, so that proxies on the same interval do not all change at once. A 30-minute interval renews between 27 and 33 minutes. A 1-hour interval would get 6 minutes of spread, so the cap applies and it renews between 55 and 65 minutes.
curl -X PATCH "https://dengz.io/api/proxies/PROXY_ID/rotate-interval" -H "Authorization: Bearer $DENGZ_API_KEY" -H "Content-Type: application/json" -d '{"rotate_interval_secs": 1800}'
On demand through the API
Sometimes the right moment to change IP is a step in your own workflow, such as the end of a test run or the start of a new country check. Renew from the dashboard or call the API:
curl -X POST "https://dengz.io/api/proxies/PROXY_ID/rotate" -H "Authorization: Bearer $DENGZ_API_KEY"
The same two calls in Python, with the key read from the environment:
import os
import requests
API = "https://dengz.io/api"
HEADERS = {"Authorization": f"Bearer {os.environ['DENGZ_API_KEY']}"} # dzk_...
def rotate(proxy_id: str) -> None:
r = requests.post(f"{API}/proxies/{proxy_id}/rotate", headers=HEADERS, timeout=30)
r.raise_for_status()
def set_rotate_interval(proxy_id: str, seconds: int) -> None:
if not 300 <= seconds <= 43200:
raise ValueError("interval must be between 300 and 43200 seconds")
r = requests.patch(
f"{API}/proxies/{proxy_id}/rotate-interval",
headers=HEADERS,
json={"rotate_interval_secs": seconds},
timeout=30,
)
r.raise_for_status()
Use GET /proxies to list your proxies and their IDs. After a renewal, confirm the new exit IP before you resume work. The API can also pause, resume and reboot a modem. See the API reference and IP rotation docs.
Sticky sessions on the Swiss IPv6 pool
The Swiss IPv6 proxy pool gives you a dedicated /54, which is 1,024 /64 subnets. You choose the address mode in the username:
| Username | Behavior |
|---|---|
USER | Sticky address |
USER__session_ID | One address per session ID |
USER__random | New address per connection |
The session ID is 1 to 128 letters, digits, underscores or hyphens. Reuse an ID to keep the same address, for example USER__session_job42 for every request in one job. Pick a new ID when you want a new address. See sessions for details.
Common mistakes
- Rotating in the middle of a session. If a site ties a login or a cart to an IP, a renewal halfway through looks like a stolen session. Rotate between tasks, not during them.
- Rotating too often. A new IP every few seconds is not how phones behave. On a dedicated modem, start with a longer interval and shorten it only if you have a reason.
- Forgetting connection reuse. On the universal endpoint, a long-lived connection pool keeps you on the same modem. That is fine for a session and wrong for a spread of independent checks.
- Not checking the result. Log the exit IP at the start of each task, so you can match odd responses to the IP that produced them.
Choosing a strategy
- Many independent requests across countries: per connection on the universal endpoint.
- Long tasks that need one IP for a while: a dedicated modem on a timer.
- IP changes tied to your own workflow steps: a dedicated modem with on-demand renewal.
- Many parallel stable identities on IPv6 targets: session IDs on the Swiss IPv6 pool.
Whatever you choose, rotation does not replace good pacing. Start with the quick start.