Home / Guides / Python, curl and Node.js

Use a 4G proxy in your scripts

Copy-paste examples for curl, Python, Node.js and Playwright, and how to call the rotation link to change IP automatically.

In the examples, replace sp123456, Password and the ports with yours, shown in your customer area.

curl

# HTTP
curl -x http://sp123456:Password@proxy.shadowproxy.fr:10001 https://api.ipify.org

# SOCKS5 (DNS resolved by the proxy)
curl -x socks5h://sp123456:Password@proxy.shadowproxy.fr:20001 https://api.ipify.org

Python (requests)

import requests

proxy = "http://sp123456:Password@proxy.shadowproxy.fr:10001"
r = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=30)
print(r.text)

# For SOCKS5: pip install "requests[socks]" then
# proxy = "socks5h://sp123456:Password@proxy.shadowproxy.fr:20001"

Node.js

import { ProxyAgent, fetch } from "undici";

const agent = new ProxyAgent("http://sp123456:Password@proxy.shadowproxy.fr:10001");
const res = await fetch("https://api.ipify.org", { dispatcher: agent });
console.log(await res.text());

Playwright

const browser = await chromium.launch({
  proxy: { server: "http://proxy.shadowproxy.fr:10001", username: "sp123456", password: "Password" },
});

Change IP from a script

Each proxy has a personal rotation link, to copy from your customer area. Call it with GET or POST; with ?wait=1, the answer comes once the new IP is active (under 20 seconds):

curl "https://shadowproxy.fr/api/rotate/YOUR-TOKEN?wait=1"
# {"ok":true,"status":"done","ip":"78.240.12.34","message":"Nouvelle IP attribuée."}
import requests

r = requests.post("https://shadowproxy.fr/api/rotate/YOUR-TOKEN", params={"wait": 1}, timeout=120)
print(r.json()["ip"])

Good practice

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