IPs and sessions
Every request leaves through a SIM card in a German 4G network. By default each request gets whichever modem is least busy, so consecutive requests usually come from different IPs.
Keep one IP: sessions
Send the same session name and your requests leave through the same modem, and so the same IP, for up to 10 minutes from the first request.
{ "url": "https://shop.example/cart", "session": "cart-42" }- The name is yours to choose. Use one per logical visitor, for example a cart or a login.
- Sessions belong to your account. Another customer using the same name gets a different session.
- After 10 minutes the name starts a new session on whichever modem is free.
- If the modem loses its connection or is busy with its maximum of parallel requests, the session moves to another modem and the IP changes. Compare
exit.ipbetween responses if your flow depends on it.
A new IP: fresh_ip
"fresh_ip": true reconnects a modem to the mobile network before your request, which gives it a new address.
{ "url": "https://example.com/", "fresh_ip": true }- The reconnect takes 10 to 20 seconds. Set your client's timeout accordingly.
- It costs 5 credits on top of the request.
- It needs a modem that is idle at that moment. When none is, you get
busy(503, not charged). fresh_ipandsessioncannot be combined.
Mobile networks hand out addresses from a pool. A fresh IP is new for this modem, but it may be an address another subscriber used earlier.
Automatic rotation
You do not have to rotate anything. Modems change their IP on their own after a number of requests or a few minutes of use, while they are idle and no session is pinned to them.
IPv4 and IPv6
| ip_version | Behaviour |
|---|---|
"4" | Default. The request uses the modem's IPv4 address. |
"6" | The request uses the modem's IPv6 address. The target must be reachable over IPv6. |
"auto" | IPv6 where the target supports it, otherwise IPv4. |
Targets that are not reachable
Addresses in private or local networks (10.0.0.0/8, 192.168.0.0/16, 127.0.0.1, localhost, link-local and similar) are refused with target_not_allowed. This also applies when a public name resolves to such an address.