Analytics API

Query traffic (bandwidth) and request-count time series for your account or a specific sub-user, plus a per-domain breakdown. All analytics endpoints use POST (the request body carries the query parameters) and return flat, bespoke JSON — they do not use the standard {success, payload, ...} envelope.

Common request parameters. Every analytics endpoint accepts the same three inputs (domain breakdown adds limit):

  • usernullable string. A sub-user uuid to scope results to one sub-user, or the literal string "All Users" (or omit / null) for the whole account.
  • periodnullable integer, one of 1, 2, 3. 1 = last 24 hours, 2 = last 7 days, 3 = last 30 days. Defaults to 1.
  • timezonenullable string. A valid IANA timezone name (e.g. "America/New_York") used to bucket the series. Defaults to UTC.

There is no custom date range. period is a fixed integer (1/2/3) — there are no start_date, end_date, or "custom" options. labels are full ISO-8601 timestamps: hourly buckets when period=1, daily buckets for period=2 and period=3.

Traffic Time Series

POST /v1/traffic Requires Auth

Traffic Time Series

Traffic Time Series

Return bandwidth usage over the selected period as two parallel arrays: labels (ISO-8601 timestamps) and data (bytes consumed in each bucket). Hourly buckets for period=1, daily otherwise.

We filled these in for you: user period timezone

Tweak any value if you like — or just press Try.

Request Body
Name Type Required Description
user string Optional Sub-user uuid, or "All Users" (or null) for the whole account.
period integer Optional Time window: 1 = 24h, 2 = 7d, 3 = 30d. Default 1.
timezone string Optional IANA timezone used to bucket the series. Default UTC.
curl -X POST https://api.proxyhat.com/v1/traffic \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "user": "All Users",
    "period": 2,
    "timezone": "America/New_York"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/traffic",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Accept": "application/json",
    },
    json={
        "user": "All Users",
        "period": 2,
        "timezone": "America/New_York",
    },
)

series = response.json()
for label, bytes_used in zip(series["labels"], series["data"]):
    print(f"{label}: {bytes_used} bytes")
const response = await fetch("https://api.proxyhat.com/v1/traffic", {
  method: "POST",
  headers: {
    "Authorization": "Bearer __API_KEY__",
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
  body: JSON.stringify({
    user: "All Users",
    period: 2,
    timezone: "America/New_York",
  }),
});

const series = await response.json();
series.labels.forEach((label, i) => console.log(`${label}: ${series.data[i]} bytes`));
payload := strings.NewReader(`{"user":"All Users","period":2,"timezone":"America/New_York"}`)

req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/traffic", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

var series struct {
    Labels []string `json:"labels"`
    Data   []int64  `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&series)
for i, label := range series.Labels {
    fmt.Printf("%s: %d bytes\n", label, series.Data[i])
}
POST /v1/traffic/period-total Requires Auth

Traffic Period Total

Traffic Period Total

Return the total bandwidth (in bytes) consumed across the whole selected period as a single number. The response contains only a raw byte total — there is no pre-formatted human-readable field.

We filled these in for you: user period timezone

Tweak any value if you like — or just press Try.

Request Body
Name Type Required Description
user string Optional Sub-user uuid, or "All Users" (or null) for the whole account.
period integer Optional Time window: 1 = 24h, 2 = 7d, 3 = 30d. Default 1.
timezone string Optional IANA timezone used to bound the period. Default UTC.
curl -X POST https://api.proxyhat.com/v1/traffic/period-total \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "user": "All Users",
    "period": 3,
    "timezone": "UTC"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/traffic/period-total",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Accept": "application/json",
    },
    json={
        "user": "All Users",
        "period": 3,
        "timezone": "UTC",
    },
)

total_bytes = response.json()["total"]
print(f"{total_bytes / 1e9:.2f} GB over the period")
const response = await fetch("https://api.proxyhat.com/v1/traffic/period-total", {
  method: "POST",
  headers: {
    "Authorization": "Bearer __API_KEY__",
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
  body: JSON.stringify({
    user: "All Users",
    period: 3,
    timezone: "UTC",
  }),
});

const { total } = await response.json();
console.log(`${(total / 1e9).toFixed(2)} GB over the period`);
payload := strings.NewReader(`{"user":"All Users","period":3,"timezone":"UTC"}`)

req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/traffic/period-total", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

var result struct {
    Total int64 `json:"total"`
}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%.2f GB over the period\n", float64(result.Total)/1e9)

Requests Time Series

POST /v1/requests Requires Auth

Requests Time Series

Requests Time Series

Return request counts over the selected period as parallel labels and data arrays. For period=1 the daily request totals are distributed across hourly buckets weighted by traffic; period=2 and period=3 return daily buckets.

We filled these in for you: user period timezone

Tweak any value if you like — or just press Try.

Request Body
Name Type Required Description
user string Optional Sub-user uuid, or "All Users" (or null) for the whole account.
period integer Optional Time window: 1 = 24h, 2 = 7d, 3 = 30d. Default 1.
timezone string Optional IANA timezone used to bucket the series. Default UTC.
curl -X POST https://api.proxyhat.com/v1/requests \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "user": "All Users",
    "period": 1,
    "timezone": "UTC"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/requests",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Accept": "application/json",
    },
    json={
        "user": "All Users",
        "period": 1,
        "timezone": "UTC",
    },
)

series = response.json()
for label, count in zip(series["labels"], series["data"]):
    print(f"{label}: {count} requests")
const response = await fetch("https://api.proxyhat.com/v1/requests", {
  method: "POST",
  headers: {
    "Authorization": "Bearer __API_KEY__",
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
  body: JSON.stringify({
    user: "All Users",
    period: 1,
    timezone: "UTC",
  }),
});

const series = await response.json();
series.labels.forEach((label, i) => console.log(`${label}: ${series.data[i]} requests`));
payload := strings.NewReader(`{"user":"All Users","period":1,"timezone":"UTC"}`)

req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/requests", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

var series struct {
    Labels []string `json:"labels"`
    Data   []int64  `json:"data"`
}
json.NewDecoder(resp.Body).Decode(&series)
for i, label := range series.Labels {
    fmt.Printf("%s: %d requests\n", label, series.Data[i])
}
POST /v1/requests/period-total Requires Auth

Requests Period Total

Requests Period Total

Return the total number of requests across the whole selected period as a single number.

We filled these in for you: user period timezone

Tweak any value if you like — or just press Try.

Request Body
Name Type Required Description
user string Optional Sub-user uuid, or "All Users" (or null) for the whole account.
period integer Optional Time window: 1 = 24h, 2 = 7d, 3 = 30d. Default 1.
timezone string Optional IANA timezone used to bound the period. Default UTC.
curl -X POST https://api.proxyhat.com/v1/requests/period-total \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "user": "All Users",
    "period": 2,
    "timezone": "UTC"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/requests/period-total",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Accept": "application/json",
    },
    json={
        "user": "All Users",
        "period": 2,
        "timezone": "UTC",
    },
)

print(f"{response.json()[\"total\"]} requests over the period")
const response = await fetch("https://api.proxyhat.com/v1/requests/period-total", {
  method: "POST",
  headers: {
    "Authorization": "Bearer __API_KEY__",
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
  body: JSON.stringify({
    user: "All Users",
    period: 2,
    timezone: "UTC",
  }),
});

const { total } = await response.json();
console.log(`${total} requests over the period`);
payload := strings.NewReader(`{"user":"All Users","period":2,"timezone":"UTC"}`)

req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/requests/period-total", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

var result struct {
    Total int64 `json:"total"`
}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%d requests over the period\n", result.Total)

Domain Breakdown

POST /v1/domain-breakdown Requires Auth

Domain Breakdown

Domain Breakdown

Return the top destination domains for the selected period, each with bytes of bandwidth and request count. Items are ordered by bandwidth descending. Accepts an additional limit parameter to cap the number of rows.

We filled these in for you: user period limit timezone

Tweak any value if you like — or just press Try.

Request Body
Name Type Required Description
user string Optional Sub-user uuid, or "All Users" (or null) for the whole account.
period integer Optional Time window: 1 = 24h, 2 = 7d, 3 = 30d. Default 1.
limit integer Optional Maximum number of domains to return, 1–500. Default 50.
timezone string Optional IANA timezone used to bound the period. Default UTC.
curl -X POST https://api.proxyhat.com/v1/domain-breakdown \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "user": "All Users",
    "period": 3,
    "limit": 10,
    "timezone": "UTC"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/domain-breakdown",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Accept": "application/json",
    },
    json={
        "user": "All Users",
        "period": 3,
        "limit": 10,
        "timezone": "UTC",
    },
)

for item in response.json()["items"]:
    print(f"{item[\"domain\"]}: {item[\"bandwidth\"]} bytes, {item[\"requests\"]} requests")
const response = await fetch("https://api.proxyhat.com/v1/domain-breakdown", {
  method: "POST",
  headers: {
    "Authorization": "Bearer __API_KEY__",
    "Content-Type": "application/json",
    "Accept": "application/json",
  },
  body: JSON.stringify({
    user: "All Users",
    period: 3,
    limit: 10,
    timezone: "UTC",
  }),
});

const { items } = await response.json();
items.forEach(i => console.log(`${i.domain}: ${i.bandwidth} bytes, ${i.requests} requests`));
payload := strings.NewReader(`{"user":"All Users","period":3,"limit":10,"timezone":"UTC"}`)

req, _ := http.NewRequest("POST", "https://api.proxyhat.com/v1/domain-breakdown", payload)
req.Header.Set("Authorization", "Bearer __API_KEY__")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

var result struct {
    Items []struct {
        Domain    string `json:"domain"`
        Bandwidth int64  `json:"bandwidth"`
        Requests  int64  `json:"requests"`
    } `json:"items"`
}
json.NewDecoder(resp.Body).Decode(&result)
for _, i := range result.Items {
    fmt.Printf("%s: %d bytes, %d requests\n", i.Domain, i.Bandwidth, i.Requests)
}