curl --request POST \
--url https://api.platform.soax.com/v1/proxy/analytics/traffic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "2026-08-01T00:00:00Z",
"to_date": "2026-08-07T23:59:59Z",
"group_by": "country",
"interval": "day",
"countries": [
"us",
"de"
]
}
'import requests
url = "https://api.platform.soax.com/v1/proxy/analytics/traffic"
payload = {
"from_date": "2026-08-01T00:00:00Z",
"to_date": "2026-08-07T23:59:59Z",
"group_by": "country",
"interval": "day",
"countries": ["us", "de"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_date: '2026-08-01T00:00:00Z',
to_date: '2026-08-07T23:59:59Z',
group_by: 'country',
interval: 'day',
countries: ['us', 'de']
})
};
fetch('https://api.platform.soax.com/v1/proxy/analytics/traffic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.soax.com/v1/proxy/analytics/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_date' => '2026-08-01T00:00:00Z',
'to_date' => '2026-08-07T23:59:59Z',
'group_by' => 'country',
'interval' => 'day',
'countries' => [
'us',
'de'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.soax.com/v1/proxy/analytics/traffic"
payload := strings.NewReader("{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platform.soax.com/v1/proxy/analytics/traffic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.soax.com/v1/proxy/analytics/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"data": [
{
"key": "us",
"value": 12.41
},
{
"key": "de",
"value": 3.17
}
]
},
{
"data": [
{
"key": "us",
"value": 9.83
},
{
"key": "de",
"value": 4.02
}
]
}
]{
"error": "hour interval requires a date range less than 24 hours"
}{
"detail": "Invalid API key"
}{
"detail": "Missing required scope: proxy:packages:read"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "Rate limit exceeded: 5 per 1 second"
}Traffic breakdown
Retrieve traffic (in GB) grouped by a dimension (package, proxy_type, tier, country, domain, or ingress_ip), as a series of interval buckets. When group_by=package, keys are package names. The date range may span at most 365 days. If interval is omitted it is chosen automatically from the range (< 24 h → hour, < 60 days → day, otherwise month). Explicit intervals are validated: hour needs a range of at most 24 hours, day between 24 hours and 180 days, month at least 60 days.
If the API key is restricted to specific packages, results (and any package_ids filter) are limited to those packages.
Requires the proxy:analytics:read scope.
curl --request POST \
--url https://api.platform.soax.com/v1/proxy/analytics/traffic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_date": "2026-08-01T00:00:00Z",
"to_date": "2026-08-07T23:59:59Z",
"group_by": "country",
"interval": "day",
"countries": [
"us",
"de"
]
}
'import requests
url = "https://api.platform.soax.com/v1/proxy/analytics/traffic"
payload = {
"from_date": "2026-08-01T00:00:00Z",
"to_date": "2026-08-07T23:59:59Z",
"group_by": "country",
"interval": "day",
"countries": ["us", "de"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_date: '2026-08-01T00:00:00Z',
to_date: '2026-08-07T23:59:59Z',
group_by: 'country',
interval: 'day',
countries: ['us', 'de']
})
};
fetch('https://api.platform.soax.com/v1/proxy/analytics/traffic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.platform.soax.com/v1/proxy/analytics/traffic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from_date' => '2026-08-01T00:00:00Z',
'to_date' => '2026-08-07T23:59:59Z',
'group_by' => 'country',
'interval' => 'day',
'countries' => [
'us',
'de'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.platform.soax.com/v1/proxy/analytics/traffic"
payload := strings.NewReader("{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platform.soax.com/v1/proxy/analytics/traffic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platform.soax.com/v1/proxy/analytics/traffic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_date\": \"2026-08-01T00:00:00Z\",\n \"to_date\": \"2026-08-07T23:59:59Z\",\n \"group_by\": \"country\",\n \"interval\": \"day\",\n \"countries\": [\n \"us\",\n \"de\"\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"data": [
{
"key": "us",
"value": 12.41
},
{
"key": "de",
"value": 3.17
}
]
},
{
"data": [
{
"key": "us",
"value": 9.83
},
{
"key": "de",
"value": 4.02
}
]
}
]{
"error": "hour interval requires a date range less than 24 hours"
}{
"detail": "Invalid API key"
}{
"detail": "Missing required scope: proxy:packages:read"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": "Rate limit exceeded: 5 per 1 second"
}Authorizations
API key secret (starts with s_live_). Create keys in the dashboard under Settings → API keys, or via POST /v1/api-keys/. Send it as Authorization: Bearer <secret>.
Body
Request model for traffic breakdown analysis.
Start of the query range (ISO 8601).
End of the query range (ISO 8601). At most 365 days after from_date.
Allowed grouping dimensions for analytics queries.
package, proxy_type, tier, country, domain, ingress_ip Bucket size for the series. Auto-selected from the range when omitted (< 24 h → hour, < 60 days → day, otherwise month).
hour, day, month Restrict results to these package IDs.
Restrict results to network types: residential and/or mobile.
Restrict results to tiers (1, 2, or 3).
Restrict results to these ISO country codes.
Restrict results to traffic sent to these domains.
Response
Successful Response
Show child attributes
Show child attributes
Was this page helpful?