Usage API

Query traffic, requests and success rates programmatically.

bash
curl -G https://api.wproxy.io/v1/usage \
  -H "Authorization: Bearer $WPROXY_API_KEY" \
  -d from=2026-08-01 \
  -d to=2026-08-31 \
  -d group_by=day,country \
  -d product=residential
json
{
  "from": "2026-08-01T00:00:00Z",
  "to": "2026-08-31T23:59:59Z",
  "totals": {
    "bytes": 412_884_221_952,
    "requests": 18_402_113,
    "success_rate": 0.9941,
    "median_latency_ms": 631
  },
  "series": [
    {
      "date": "2026-08-01",
      "country": "us",
      "bytes": 8_120_443_392,
      "requests": 402_118,
      "success_rate": 0.9962
    }
  ],
  "next_cursor": null
}

Parameters

ParameterTypeNotes
from / todate or timestampDefaults to the last 24 hours
group_bycsvday, hour, country, city, product, proxy_user
productstringresidential, datacenter, mobile, isp, dedicated
proxy_userstringRestrict to one sub-user
countrystringISO alpha-2
granularitystringhour or day; hour is retained for 30 days

Retention

Hourly resolution is kept for 30 days and daily resolution for 24 months. Aggregate totals are never deleted, so historical invoicing always reconciles.

Streaming to your own warehouse

python
import os, requests, datetime as dt

KEY = os.environ["WPROXY_API_KEY"]

def pull(day: dt.date):
    cursor, rows = None, []
    while True:
        r = requests.get(
            "https://api.wproxy.io/v1/usage",
            headers={"Authorization": f"Bearer {KEY}"},
            params={"from": day, "to": day, "group_by": "hour,proxy_user",
                    "cursor": cursor},
            timeout=30,
        ).json()
        rows += r["series"]
        cursor = r.get("next_cursor")
        if not cursor:
            return rows
Something inaccurate?Tell support