For the complete documentation index, see llms.txt. This page is also available as Markdown.

Proxy Rotation

Learn how to enable proxy rotation for Dedicated ISP Proxies and how to rotate IPs from a specific country pool.

Self-Service Dedicated ISP Proxies supports automatic proxy rotation. To use this feature you need to change your port number to 8000. With each new request you will receive a random IP from your proxy list.

Code examples

curl -x disp.oxylabs.io:8000 -U "user-USERNAME:PASSWORD" https://ip.oxylabs.io/location 
import requests

username = 'USERNAME'
password = 'PASSWORD'
proxy = 'disp.oxylabs.io:8000'

proxies = {
   "https": ('https://user-%s:%s@%s' % (username, password, proxy))
}

response=requests.get("https://ip.oxylabs.io/location", proxies=proxies)

print(response.content)
const axios = require("axios");
const https = require("https");

const client = axios.create({
    httpsAgent: new https.Agent({
        rejectUnauthorized: false,
    }),
});
const username = 'USERNAME';
const password = 'PASSWORD'

client
    .get("https://ip.oxylabs.io/location", {
        proxy: {
            protocol: "https",
            host: "disp.oxylabs.io",
            port: 8000,
            auth: {
                username: `user-${username}`,
                password: password,
            },
        },
    })
    .then((res) => {
        console.log(res.data);
    })
    .catch((err) => console.error(err));

IPs will be selected from the indicated country pool if you provide a country- parameter. For example, if you want to rotate your United States proxy pool only, use a parameter country- and add two letter country code country-US in your user string.

Code examples

curl -x https://disp.oxylabs.io:8000 -U 'user-USERNAME-country-COUNTRY:PASSWORD' https://ip.oxylabs.io/location
import requests

username = 'USERNAME'
password = 'PASSWORD'
country = 'COUNTRY'
proxy = 'disp.oxylabs.io:8000'

proxies = {
   "https": ('https://user-%s-country-%s:%s@%s' % (username, country, password, proxy))
}

response=requests.get("https://ip.oxylabs.io/location", proxies=proxies)

print(response.content)
const axios = require("axios");
const https = require("https");

const client = axios.create({
    httpsAgent: new https.Agent({
        rejectUnauthorized: false,
    }),
});
const username = 'USERNAME';
const country = 'COUNTRY'
const password = 'PASSWORD'

client
    .get("https://ip.oxylabs.io/location", {
        proxy: {
            protocol: "https",
            host: "disp.oxylabs.io",
            port: 8000,
            auth: {
                username: `user-${username}-country-${country}`,
                password: password,
            },
        },
    })
    .then((res) => {
        console.log(res.data);
    })
    .catch((err) => console.error(err));

Proxy rotation selects IPs only from proxies within the ASN you selected during initial setup. Automatic rotation will not switch to a different ISP or change your ASN.

Was this helpful?