Skip to main content
These examples use the requests library. Replace YOUR_PACKAGE_KEY with your actual package key from the dashboard. Install requests if you haven’t already:
pip install requests

Residential proxies

Rotating (new IP every request)

import requests

proxy_url = "http://country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())
Each time you run this, you’ll get a different IP.

Session (same IP across requests)

import requests

proxy_url = "http://country-us-session-python1:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

for i in range(3):
    response = requests.get(
        "https://checker.soax.com/api/ipinfo",
        proxies={"http": proxy_url, "https": proxy_url},
    )
    data = response.json()["data"]
    print(f"Request {i + 1}: {data['ip']} ({data['city']}, {data['country_code']})")
All three requests will return the same IP.

Session with timed rotation

Rotate to a new IP every 5 minutes:
import requests

proxy_url = "http://country-us-session-job1-rotate-timed_300:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())

Target a specific city and ISP

import requests

proxy_url = "http://country-us-city-los_angeles-isp-comcast:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())

Session with error retry and lookalike replacement

import requests

proxy_url = "http://country-us-session-scrape1-onerror-retry_3-prefer-lookalike:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())

Mobile proxies

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

Rotating

import requests

proxy_url = "http://network-mob-country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())

Session

import requests

proxy_url = "http://network-mob-country-us-session-mobile1:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

for i in range(3):
    response = requests.get(
        "https://checker.soax.com/api/ipinfo",
        proxies={"http": proxy_url, "https": proxy_url},
    )
    data = response.json()["data"]
    print(f"Request {i + 1}: {data['ip']} ({data['carrier']})")

Target a specific carrier

import requests

proxy_url = "http://network-mob-country-us-isp-t_mobile-session-tm1:YOUR_PACKAGE_KEY@proxy.soax.com:1337"

response = requests.get(
    "https://checker.soax.com/api/ipinfo",
    proxies={"http": proxy_url, "https": proxy_url},
)

print(response.json())

Multiple concurrent sessions

If you need to run several sessions in parallel (for example, scraping different targets), give each one a unique session ID:
import requests
from concurrent.futures import ThreadPoolExecutor

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

def fetch(target):
    proxy_url = f"http://country-{target['country']}-session-{target['session']}:YOUR_PACKAGE_KEY@proxy.soax.com:1337"
    response = requests.get(
        "https://checker.soax.com/api/ipinfo",
        proxies={"http": proxy_url, "https": proxy_url},
    )
    data = response.json()["data"]
    return f"{target['session']}: {data['ip']} ({data['country_code']})"

with ThreadPoolExecutor(max_workers=3) as pool:
    for result in pool.map(fetch, targets):
        print(result)

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

Node.js examples

Working Node.js 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.