# How to rotate the IP of a 4G/5G mobile proxy (2026)

> Rotate the IP of LatamProxies 4G/5G mobile proxies by API link or timer, with bash, Python and Node.js code. Ports from $9/day, no KYC, crypto.

- URL: https://latamproxies.com/guides/mobile-proxy-rotation/
- Last updated: 2026-10-05
- Publisher: LatamProxies (https://latamproxies.com)

Change your Latin American mobile IP on demand through an API link, or let a timer do it. Code for bash, Python and Node.js.

**Quick answer — How do I rotate the IP of a LatamProxies mobile proxy?**

To rotate the IP of a **LatamProxies** dedicated 4G/5G port, send a GET request to your port's rotation link, `https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY`, then wait for the modem to reconnect. Rotation options: IP change on demand through an API link, or automatically every 5 to 60 minutes. Dedicated ports start at $9/day. No KYC — no ID, no selfie, no documents. Pay in crypto.

## Mobile rotation at a glance

| Attribute | Value |
| --- | --- |
| Rotation link | `https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY` |
| Rotation modes | IP change on demand through an API link, or automatically every 5 to 60 minutes |
| Traffic on dedicated ports | unlimited traffic (fair use, no daily GB cap) |
| Dedicated port price | From $9/day (1 day), $29.25 for 7 days, $66.75 for 30 days |
| Rotating 4G/5G per GB | From $1.50/GB |
| Protocols | HTTP, HTTPS, SOCKS5 |
| KYC | None — no ID, no selfie, no documents |
| Payment | Crypto only: USDT, BTC, USDC, ETH, LTC, SOL |
| Top-up | Minimum $25 in crypto; unused balance stays on your account |

## How does IP rotation work on a 4G/5G proxy?

A 4G/5G proxy changes IP when its modem reconnects to the carrier. The carrier then assigns a new public IP from its own pool. Mobile carriers share each public IP between many subscribers through carrier-grade NAT (CGNAT). That is why websites are careful about blocking mobile IPs: one block can hit many real users.

A **dedicated port** is one modem with a SIM card reserved for you. Its IP stays the same until you rotate it, either by calling the rotation link or with a timer. During the reconnection, which takes a short moment, open connections on that port are dropped. Your scripts should wait and retry, as shown in the code below.

## Should I rotate on demand or on a timer?

Rotate on demand when your script knows when a task ends; use a timer when you just want a fresh IP at regular intervals. LatamProxies supports both: IP change on demand through an API link, or automatically every 5 to 60 minutes.

- **On demand (API link)**: your code calls the rotation link between jobs, for example after each batch of 200 product pages or before each new ad-verification run. You control exactly when the IP changes.
- **Timer**: set an interval in the dashboard. The port reconnects by itself. This suits tools that cannot call a URL, such as some browser profiles or desktop apps.

Do not combine a short timer with on-demand calls on the same port: the IP may change in the middle of a job.

## What is the difference between sticky and rotating mobile proxies?

A sticky mobile proxy keeps one IP for a period you control; a rotating one gives you new IPs often, without managing modems.

- **Dedicated port (sticky by default)**: from $9/day, unlimited traffic (fair use, no daily GB cap). The IP changes only when you rotate it. Best for logged-in work on accounts you own, app testing and long browser sessions.
- **Rotating 4G/5G per GB**: from $1.50/GB. Billed by traffic and used through the gateway with the username syntax from the [proxy setup guide](https://latamproxies.com/guides/proxy-setup/). Best for spreading many short requests across mobile IPs.

Dedicated ports depend on live modem stock per carrier; the dashboard shows free ports before you pay. Compare products on the [mobile proxies page](https://latamproxies.com/mobile-proxies/) and every tier on the [pricing page](https://latamproxies.com/pricing/).

## Sticky port vs rotating mobile traffic

|  | Dedicated 4G/5G port | Rotating 4G/5G (per GB) |
| --- | --- | --- |
| Price | From $9/day | From $1.50/GB |
| Billing | Per day, week or month | Per GB |
| Traffic | unlimited traffic (fair use, no daily GB cap) | Plan size; Residential and rotating mobile traffic stays valid for 90 days from purchase |
| IP change | Rotation link or timer | New session id in the username |
| Best for | Long sessions, app testing, own accounts | Many short, independent requests |

## Where do I find my rotation link?

Your dashboard shows, for each dedicated port, its connection details (host, port, username, password) and its rotation link. The link follows this pattern:

`https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY`

Replace `{port}` with your port number and `API_KEY` with the key shown in the dashboard. Treat the link like a password: anyone who has it can change your IP. If it leaks, ask support@latamproxies.com for a new key.

## How do I rotate the IP in bash?

The script below calls the rotation link, then checks the exit IP through the proxy until it changes. Fill in the four values from your dashboard.

*bash — rotate and wait for the new IP*

```bash
#!/usr/bin/env bash
# Values from your dashboard
PROXY="http://USERNAME:PASSWORD@HOST:PORT"
ROTATE_URL="https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY"   # replace {port} and API_KEY
CHECK="https://api.ipify.org"

old_ip=$(curl -s -x "$PROXY" "$CHECK")
echo "Current IP: $old_ip"

curl -s "$ROTATE_URL" > /dev/null

for i in $(seq 1 20); do
  sleep 3
  new_ip=$(curl -s --max-time 10 -x "$PROXY" "$CHECK")
  if [ -n "$new_ip" ] && [ "$new_ip" != "$old_ip" ]; then
    echo "New IP: $new_ip"
    exit 0
  fi
done
echo "IP did not change yet, try again later" >&2
exit 1
```

## How do I rotate the IP in Python?

In Python, wrap the rotation in a function and call it between jobs. The function returns the new IP, or raises an error if the modem did not reconnect in time.

*Python — rotate between batches*

```python
import time
import requests

PROXY = "http://USERNAME:PASSWORD@HOST:PORT"          # from your dashboard
ROTATE_URL = "https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY"  # replace {port} and API_KEY
CHECK = "https://api.ipify.org"
proxies = {"http": PROXY, "https": PROXY}

def current_ip():
    return requests.get(CHECK, proxies=proxies, timeout=10).text.strip()

def rotate(max_wait=60):
    old = current_ip()
    requests.get(ROTATE_URL, timeout=30).raise_for_status()
    deadline = time.time() + max_wait
    while time.time() < deadline:
        time.sleep(3)
        try:
            new = current_ip()
            if new and new != old:
                return new
        except requests.RequestException:
            pass  # modem is reconnecting
    raise RuntimeError("IP did not change in time")

for batch in range(3):
    # ... run one batch of requests through `proxies` here ...
    print("Rotated to", rotate())
```

## How do I rotate the IP in Node.js?

In Node.js 18 or later, use `undici` for proxied requests and the built-in `fetch` for the rotation link, which is a normal HTTPS call that does not go through the proxy.

*Node.js — rotate and wait*

```javascript
// npm install undici
import { fetch as pfetch, ProxyAgent } from 'undici';

// Values from your dashboard
const dispatcher = new ProxyAgent({
  uri: 'http://HOST:PORT',
  token: 'Basic ' + Buffer.from('USERNAME:PASSWORD').toString('base64'),
});
const ROTATE_URL = 'https://latamproxies.com/api/v1/mobile/{port}/rotate?key=API_KEY'; // replace {port} and API_KEY
const CHECK = 'https://api.ipify.org';
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

async function currentIp() {
  const res = await pfetch(CHECK, { dispatcher, signal: AbortSignal.timeout(10_000) });
  return (await res.text()).trim();
}

export async function rotate(maxWaitMs = 60_000) {
  const old = await currentIp();
  const r = await fetch(ROTATE_URL);
  if (!r.ok) throw new Error(`rotate failed: ${r.status}`);
  const deadline = Date.now() + maxWaitMs;
  while (Date.now() < deadline) {
    await sleep(3000);
    try {
      const ip = await currentIp();
      if (ip && ip !== old) return ip;
    } catch { /* modem is reconnecting */ }
  }
  throw new Error('IP did not change in time');
}

console.log('New IP:', await rotate());
```

## What are good rotation habits?

Rotate between tasks, not in the middle of them. A few rules that keep jobs stable:

- **Finish the job, then rotate.** A rotation drops open connections, so a page load or an upload in progress will fail.
- **Do not rotate in a tight loop.** Each rotation needs a reconnection; calling the link again before it finishes only adds delay.
- **Keep cookies with the IP.** If your job uses a browser profile, start a fresh context after each rotation.
- **Match the country to the target.** Use a port in [Brazil](https://latamproxies.com/mobile-proxies/brazil/) for Brazilian apps, in [Mexico](https://latamproxies.com/mobile-proxies/mexico/) for Mexican ones, and so on.
- **Stay within the rules.** Rotation is for spreading legitimate load, such as price checks and ad verification, not for ban evasion or bulk account creation. See the [Acceptable Use Policy](https://latamproxies.com/acceptable-use-policy/).

## Mobile rotation questions

### How often can I change the IP of a LatamProxies mobile proxy?

Dedicated 4G/5G ports offer IP change on demand through an API link, or automatically every 5 to 60 minutes. In practice, rotate between tasks and wait for each reconnection to finish before the next call. Calling the link again while the modem reconnects only adds delay.

### Does rotating the IP cost extra?

No. Rotation is included with every dedicated 4G/5G port, which starts at $9/day. Dedicated ports come with unlimited traffic (fair use, no daily GB cap), so a rotation does not consume a traffic allowance. See every tier on the [pricing page](https://latamproxies.com/pricing/).

### Will I get a different IP every time I rotate?

Usually, yes, but not always. The carrier assigns the new IP from its own pool, and it can sometimes return an IP you had before. That is why the scripts in this guide compare the old and new IPs and wait until they differ.

### Why did my connections drop during rotation?

Rotation reconnects the modem, so every open connection on that port closes. Rotate between tasks, add retry logic to your scripts, and wait until the new IP answers before sending traffic again. The bash, Python and Node.js examples above all do this.

### Can I keep the same mobile IP for hours?

Yes, on a dedicated port. The IP stays the same until you call the rotation link or the timer you set fires. The carrier may still change it on its own in rare cases, for example during network maintenance, so check the IP at the start of long jobs.

### Which Latin American countries have 4G/5G ports?

Mobile pages exist for 38 countries, including [Brazil](https://latamproxies.com/mobile-proxies/brazil/), [Mexico](https://latamproxies.com/mobile-proxies/mexico/), [Argentina](https://latamproxies.com/mobile-proxies/argentina/), [Colombia](https://latamproxies.com/mobile-proxies/colombia/), [Chile](https://latamproxies.com/mobile-proxies/chile/) and [Peru](https://latamproxies.com/mobile-proxies/peru/). Dedicated ports depend on live modem stock per carrier; the dashboard shows free ports before you pay.

### Do I need KYC to buy a mobile proxy?

No. LatamProxies sells 4G/5G proxies with no KYC — no ID, no selfie, no documents. Pay in crypto: USDT, BTC, USDC, ETH, LTC or SOL. Your port is delivered as soon as your top-up is credited, and use is governed by our Acceptable Use Policy.

**Get a dedicated 4G/5G port** From $9/day, with rotation by API link or timer. No KYC — no ID, no selfie, no documents. Pay in crypto. [Get 4G/5G proxies — from $9/day](https://latamproxies.com/pricing/) · [Mobile proxies](https://latamproxies.com/mobile-proxies/)

---

LatamProxies: LatamProxies is a no-KYC residential and 4G/5G mobile proxy provider for Latin America and the Caribbean — Brazil, Mexico, Argentina, Colombia, Chile, Peru and more — paid only in crypto (USDT, BTC, USDC, ETH, LTC, SOL). Residential traffic starts at $0.50/GB.
