Analytics API

Retrieve traffic usage statistics, request counts, and domain breakdown for your proxy infrastructure. Use these endpoints to monitor bandwidth consumption over time, track request volumes, and identify which domains are driving the most traffic.

POST /v1/traffic Requires Auth

Get Traffic Chart

Get Traffic Chart

Retrieve traffic usage data points for charting. Returns date labels and corresponding bandwidth values in bytes for the specified time period.

Request Body
Name Type Required Description
period string Required The time period to query. One of "24h", "7d", "30d", or "custom".
start_date string Optional Start date in YYYY-MM-DD format. Required when period is "custom".
end_date string Optional End date in YYYY-MM-DD format. Required when period is "custom".
curl -X POST https://api.proxyhat.com/v1/traffic \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "period": "7d"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/traffic",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "period": "7d",
    },
)

data = response.json()
for label, value in zip(data["labels"], data["data"]):
    print(f"{label}: {value} 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({
    period: "7d",
  }),
});

const data = await response.json();
data.labels.forEach((label, i) => console.log(`${label}: ${data.data[i]} bytes`));
payload := strings.NewReader(`{
  "period": "7d"
}`)

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 result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["labels"], result["data"])
Response 200
{
  "labels": ["2026-01-14", "2026-01-15", "2026-01-16"],
  "data": [1073741824, 2147483648, 536870912]
}
POST /v1/traffic/period-total Requires Auth

Get Traffic Period Total

Get Traffic Period Total

Retrieve the total traffic consumed during the specified time period. Returns both the raw byte count and a human-readable formatted string.

Request Body
Name Type Required Description
period string Required The time period to query. One of "24h", "7d", "30d", or "custom".
start_date string Optional Start date in YYYY-MM-DD format. Required when period is "custom".
end_date string Optional End date in YYYY-MM-DD format. Required when period is "custom".
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 '{
    "period": "30d"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/traffic/period-total",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "period": "30d",
    },
)

data = response.json()
print(f"Total: {data[\"human\"]} ({data[\"total\"]} bytes)")
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({
    period: "30d",
  }),
});

const data = await response.json();
console.log(`Total: ${data.human} (${data.total} bytes)`);
payload := strings.NewReader(`{
  "period": "30d"
}`)

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 map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Total: %s (%v bytes)\n", result["human"], result["total"])
Response 200
{
  "total": 3758096384,
  "human": "3.50 GB"
}
POST /v1/requests Requires Auth

Get Requests Chart

Get Requests Chart

Retrieve request count data points for charting. Returns date labels and corresponding request counts for the specified time period.

Request Body
Name Type Required Description
period string Required The time period to query. One of "24h", "7d", "30d", or "custom".
start_date string Optional Start date in YYYY-MM-DD format. Required when period is "custom".
end_date string Optional End date in YYYY-MM-DD format. Required when period is "custom".
curl -X POST https://api.proxyhat.com/v1/requests \
  -H "Authorization: Bearer __API_KEY__" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "period": "7d"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/requests",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "period": "7d",
    },
)

data = response.json()
for label, count in zip(data["labels"], data["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({
    period: "7d",
  }),
});

const data = await response.json();
data.labels.forEach((label, i) => console.log(`${label}: ${data.data[i]} requests`));
payload := strings.NewReader(`{
  "period": "7d"
}`)

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 result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["labels"], result["data"])
Response 200
{
  "labels": ["2026-01-14", "2026-01-15", "2026-01-16"],
  "data": [1500, 2300, 1800]
}
POST /v1/requests/period-total Requires Auth

Get Requests Period Total

Get Requests Period Total

Retrieve the total number of requests made during the specified time period.

Request Body
Name Type Required Description
period string Required The time period to query. One of "24h", "7d", "30d", or "custom".
start_date string Optional Start date in YYYY-MM-DD format. Required when period is "custom".
end_date string Optional End date in YYYY-MM-DD format. Required when period is "custom".
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 '{
    "period": "30d"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/requests/period-total",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "period": "30d",
    },
)

data = response.json()
print(f"Total requests: {data[\"total\"]}")
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({
    period: "30d",
  }),
});

const data = await response.json();
console.log(`Total requests: ${data.total}`);
payload := strings.NewReader(`{
  "period": "30d"
}`)

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 map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Total requests: %v\n", result["total"])
Response 200
{
  "total": 5600
}
POST /v1/domain-breakdown Requires Auth

Get Domain Breakdown

Get Domain Breakdown

Retrieve a breakdown of traffic usage and request counts grouped by target domain for the specified time period. Useful for identifying which domains consume the most bandwidth.

Request Body
Name Type Required Description
period string Required The time period to query. One of "24h", "7d", "30d", or "custom".
start_date string Optional Start date in YYYY-MM-DD format. Required when period is "custom".
end_date string Optional End date in YYYY-MM-DD format. Required when period is "custom".
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 '{
    "period": "7d"
  }'
import requests

response = requests.post(
    "https://api.proxyhat.com/v1/domain-breakdown",
    headers={
        "Authorization": "Bearer __API_KEY__",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "period": "7d",
    },
)

data = response.json()
for item in data["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({
    period: "7d",
  }),
});

const data = await response.json();
data.items.forEach(item => {
  console.log(`${item.domain}: ${item.bandwidth} bytes, ${item.requests} requests`);
});
payload := strings.NewReader(`{
  "period": "7d"
}`)

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 map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["items"])
Response 200
{
  "items": [
    {
      "domain": "example.com",
      "bandwidth": 1073741824,
      "requests": 15000
    },
    {
      "domain": "api.service.io",
      "bandwidth": 536870912,
      "requests": 8200
    }
  ]
}