Skip to main content
These examples use Go’s standard net/http and net/url packages. No external dependencies needed. Replace YOUR_PACKAGE_KEY with your actual package key from the dashboard.

Residential proxies

Rotating (new IP every request)

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
Each time you run this, you’ll get a different IP.

Session (same IP across requests)

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://country-us-session-go1:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	for i := 0; i < 3; i++ {
		resp, err := client.Get("https://checker.soax.com/api/ipinfo")
		if err != nil {
			fmt.Println("Error:", err)
			continue
		}
		body, _ := io.ReadAll(resp.Body)
		resp.Body.Close()
		fmt.Printf("Request %d: %s\n", i+1, string(body))
	}
}
All three requests will return the same IP.

Session with timed rotation

Rotate to a new IP every 5 minutes:
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://country-us-session-job1-rotate-timed_300:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

Target a specific city and ISP

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://country-us-city-los_angeles-isp-comcast:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

Session with error retry and lookalike replacement

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://country-us-session-scrape1-onerror-retry_3-prefer-lookalike:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

Mobile proxies

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

Rotating

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://network-mob-country-us:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

Session

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://network-mob-country-us-session-mobile1:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	for i := 0; i < 3; i++ {
		resp, err := client.Get("https://checker.soax.com/api/ipinfo")
		if err != nil {
			fmt.Println("Error:", err)
			continue
		}
		body, _ := io.ReadAll(resp.Body)
		resp.Body.Close()
		fmt.Printf("Request %d: %s\n", i+1, string(body))
	}
}

Target a specific carrier

package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse("http://network-mob-country-us-isp-verizon_wireless-session-vz1:YOUR_PACKAGE_KEY@proxy.soax.com:1337")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://checker.soax.com/api/ipinfo")
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}

Multiple concurrent sessions

Run several sessions in parallel using goroutines:
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
	"sync"
)

type target struct {
	session string
	country string
}

func main() {
	targets := []target{
		{session: "target_a", country: "us"},
		{session: "target_b", country: "gb"},
		{session: "target_c", country: "de"},
	}

	var wg sync.WaitGroup
	for _, t := range targets {
		wg.Add(1)
		go func(t target) {
			defer wg.Done()
			proxyStr := fmt.Sprintf("http://country-%s-session-%s:YOUR_PACKAGE_KEY@proxy.soax.com:1337", t.country, t.session)
			proxyURL, _ := url.Parse(proxyStr)
			client := &http.Client{
				Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
			}
			resp, err := client.Get("https://checker.soax.com/api/ipinfo")
			if err != nil {
				fmt.Printf("%s: error: %s\n", t.session, err)
				return
			}
			defer resp.Body.Close()
			body, _ := io.ReadAll(resp.Body)
			fmt.Printf("%s: %s\n", t.session, string(body))
		}(t)
	}
	wg.Wait()
}

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.

Node.js examples

Working Node.js code for SOAX proxies.

Residential proxies

Full parameter reference.

Error codes

What to do when something goes wrong.