Analytics API

FonProxy analytics endpoints: traffic charts, request counts, concurrency, domain breakdown, errors, and websites.

Updated 2026-04-09 16:13:00
Analytics API

For authentication and common headers, see API General.

All chart and breakdown endpoints accept from and to as ISO 8601 date strings (max 2 month range). Optional filters: domain (exact match), orderId (ID).

Ingestion

Ingest Logs Auth required

POST /analytics/ingest

Push pre-aggregated request logs from proxy workers.

Request Body

{
  "logs": [
    {
      "ts": "2026-03-15 10:15:00",
      "user_id": 1,
      "order_id": 3,
      "port": 443,
      "protocol": "HTTPS",
      "ip_out": "185.199.100.10",
      "ip_from": "78.100.50.12",
      "peer_id": "peer-001",
      "worker": "worker-01",
      "domain": "google.com",
      "error": "",
      "count": 12,
      "bytes_sent": 10240,
      "bytes_received": 524800,
      "error_count": 0,
      "duration_ms": 15000,
      "max_concurrency": 5
    },
    ...
  ]
}

Response

204 No Content

Charts

Traffic Chart Auth required

GET /analytics/traffic

Chart data β€” bytes sent/received over time.

Query Parameters

NameTypeDescriptionRequired
fromstringStart date (ISO 8601)Yes
tostringEnd date (ISO 8601)Yes
domainstringFilter by exact domainNo
orderIdstringFilter by orderNo

Response

{
  "data": [
    {
      "bucket": "2026-03-15 00:00:00",
      "total_bytes_sent": "1048576",
      "total_bytes_received": "52428800",
      "bytes_total": "53477376",
      "total_count": "1542"
    },
    ...
  ]
}

Requests Chart Auth required

GET /analytics/requests

Chart data β€” request count over time.

Query Parameters

Same as Traffic Chart.

Response

{
  "data": [
    {
      "bucket": "2026-03-15 00:00:00",
      "total_count": "1542",
      "total_errors": "23"
    },
    ...
  ]
}

Concurrency Chart Auth required

GET /analytics/concurrency

Chart data β€” concurrency over time.

Query Parameters

Same as Traffic Chart.

Response

{
  "data": [
    {
      "bucket": "2026-03-15 00:00:00",
      "max_concurrency": "48",
      "total_count": "1542"
    },
    ...
  ]
}

Breakdowns

Domain Breakdown Auth required

GET /analytics/domains

Top domains by bytes or request count.

Query Parameters

NameTypeDescriptionRequired
fromstringStart date (ISO 8601)Yes
tostringEnd date (ISO 8601)Yes
sortBystringSort by: bytes or count. Default bytesNo
limitnumberMax results (1–100). Default 30No
orderIdstringFilter by orderNo

Response

{
  "data": [
    {
      "domain": "google.com",
      "total_count": "5420",
      "bytes_total": "268435456",
      "total_bytes_sent": "5242880",
      "total_bytes_received": "263192576",
      "total_errors": "12"
    },
    ...
  ]
}

Error Breakdown Auth required

GET /analytics/errors

Error breakdown grouped by error type.

Query Parameters

NameTypeDescriptionRequired
fromstringStart date (ISO 8601)Yes
tostringEnd date (ISO 8601)Yes
domainstringFilter by exact domainNo
orderIdstringFilter by orderNo
limitnumberMax results (1–100). Default 50No

Response

{
  "data": [
    {
      "error": "ECONNREFUSED",
      "total_errors": "142",
      "first_seen": "2026-02-01 08:15:00",
      "last_seen": "2026-03-19 22:45:00",
      "sample_domains": ["google.com", "facebook.com", "github.com"]
    },
    ...
  ]
}

Websites

Websites List Auth required

GET /analytics/websites

Visited websites β€” paginated list of distinct domains.

Query Parameters

NameTypeDescriptionRequired
fromstringStart date (ISO 8601)Yes
tostringEnd date (ISO 8601)Yes
domainstringFilter by exact domainNo
orderIdstringFilter by orderNo
pagenumberPage number. Default 1No
limitnumberItems per page (1–100). Default 25No

Response

{
  "data": [
    {
      "domain": "google.com",
      "total_count": "5420",
      "bytes_total": "268435456",
      "first_visit": "2026-02-01 08:15:00",
      "last_visit": "2026-03-19 22:45:00"
    },
    ...
  ],
  "page": 1,
  "limit": 25,
  "total": 48,
  "totalPages": 2
}
Analytics API β€” FonProxy Traffic, Requests & Domain Stats