Proxy Rotation
Enable proxy rotation for Dedicated Datacenter Proxies using port 8000. Get random IPs per request with optional country-specific rotation.
Self-Service Dedicated Datacenter Proxies supports 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 ddc.oxylabs.io:8000 -U "user-USERNAME:PASSWORD" https://ip.oxylabs.io/location import requests
username = 'USERNAME'
password = 'PASSWORD'
proxy = 'ddc.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: "ddc.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://ddc.oxylabs.io:8000 -U 'user-USERNAME-country-COUNTRY:PASSWORD' https://ip.oxylabs.io/locationimport requests
username = 'USERNAME'
password = 'PASSWORD'
country = 'COUNTRY'
proxy = 'ddc.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: "ddc.oxylabs.io",
port: 8000,
auth: {
username: `user-${username}-country-${country}`,
password: password,
},
},
})
.then((res) => {
console.log(res.data);
})
.catch((err) => console.error(err));
Last updated
Was this helpful?

