Home / Guides / Automatic rotation

Change IP automatically every X minutes

Your rotation link can be scheduled like any web address: with cron, Windows Task Scheduler or a few lines of Python.

How it works

Each proxy has a personal rotation link, to copy from your customer area (proxy page). Opening that link asks for a new IP, active in under 20 seconds. You just need to call it as often as you want.

Linux and Mac: cron

Open the task list with crontab -e and add a line:

# Every 10 minutes
*/10 * * * * curl -s "https://shadowproxy.fr/api/rotate/YOUR-TOKEN" > /dev/null

# Every hour, on the hour
0 * * * * curl -s "https://shadowproxy.fr/api/rotate/YOUR-TOKEN" > /dev/null

Windows: Task Scheduler

  1. Open Task Scheduler, then Create Basic Task.
  2. Trigger: Daily, then in the task’s properties tick Repeat task every 10 minutes (or the length you want) for a duration of Indefinitely.
  3. Action: Start a program, program curl.exe, arguments:
-s "https://shadowproxy.fr/api/rotate/YOUR-TOKEN"

Python: before each task

Often the most reliable way is to change IP right before a batch of work, and wait for the new address to be active with ?wait=1:

import requests

ROTATE = "https://shadowproxy.fr/api/rotate/YOUR-TOKEN"
PROXY = "http://sp123456:Password@proxy.shadowproxy.fr:10001"

def new_ip():
    r = requests.post(ROTATE, params={"wait": 1}, timeout=120)
    data = r.json()
    if data.get("status") != "done":
        raise RuntimeError(data.get("message", "change not finished"))
    return data["ip"]

for batch in range(3):
    print("New IP:", new_ip())
    r = requests.get("https://api.ipify.org", proxies={"http": PROXY, "https": PROXY}, timeout=30)
    print("Websites see:", r.text)
    # ... your work for this batch ...

Good to know

No proxy yet? Dedicated French 4G proxy, 200 GB per month, IP changeable in under 20 seconds: €30 per month, no commitment.

Order a 4G proxy