Skip to main content
These examples use axios with https-proxy-agent. Replace YOUR_PACKAGE_KEY with your actual package key from the dashboard. Install the dependencies:
npm install axios https-proxy-agent

Residential proxies

Rotating (new IP every request)

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));
Each time you run this, you’ll get a different IP.

Session (same IP across requests)

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us-session-node1:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

async function run() {
  for (let i = 0; i < 3; i++) {
    const res = await axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent });
    const data = res.data.data;
    console.log(`Request ${i + 1}: ${data.ip} (${data.city}, ${data.country_code})`);
  }
}

run();
All three requests will return the same IP.

Session with timed rotation

Rotate to a new IP every 5 minutes:
const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us-session-job1-rotate-timed_300:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));

Target a specific city and ISP

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us-city-new_york-isp-comcast:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));

Session with error retry and lookalike replacement

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us-session-scrape1-onerror-retry_3-prefer-lookalike:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));

Mobile proxies

Add network-mob to the proxy URL. Everything else works the same way.

Rotating

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://network-mob-country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));

Session

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://network-mob-country-us-session-mobile1:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

async function run() {
  for (let i = 0; i < 3; i++) {
    const res = await axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent });
    const data = res.data.data;
    console.log(`Request ${i + 1}: ${data.ip} (${data.carrier})`);
  }
}

run();

Target a specific carrier

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://network-mob-country-us-isp-t_mobile-session-tm1:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent })
  .then(res => console.log(res.data))
  .catch(err => console.error(err.message));

Multiple concurrent sessions

Run several sessions in parallel with unique session IDs:
const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const targets = [
  { session: "target_a", country: "us" },
  { session: "target_b", country: "gb" },
  { session: "target_c", country: "de" },
];

async function fetch(target) {
  const agent = new HttpsProxyAgent(
    `http://country-${target.country}-session-${target.session}:YOUR_PACKAGE_KEY@proxy.soax.com:1337`
  );
  const res = await axios.get("https://checker.soax.com/api/ipinfo", { httpsAgent: agent });
  const data = res.data.data;
  return `${target.session}: ${data.ip} (${data.country_code})`;
}

Promise.all(targets.map(fetch)).then(results => results.forEach(r => console.log(r)));

Using node-fetch

If you prefer node-fetch over axios:
npm install node-fetch https-proxy-agent
const fetch = require("node-fetch");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent("http://country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337");

fetch("https://checker.soax.com/api/ipinfo", { agent })
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err.message));

Expected response

All examples return a JSON response from the SOAX checker:
{
  "status": true,
  "data": {
    "ip": "185.123.45.67",
    "country_code": "US",
    "country_name": "United States",
    "region": "California",
    "city": "Los Angeles",
    "isp": "Spectrum",
    "carrier": ""
  }
}

Next steps

Python examples

Working Python code for SOAX proxies.

Go examples

Working Go code for SOAX proxies.

Residential proxies

Full parameter reference.

Error codes

What to do when something goes wrong.