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=residentialjson
{
"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
| Parameter | Type | Notes |
|---|---|---|
| from / to | date or timestamp | Defaults to the last 24 hours |
| group_by | csv | day, hour, country, city, product, proxy_user |
| product | string | residential, datacenter, mobile, isp, dedicated |
| proxy_user | string | Restrict to one sub-user |
| country | string | ISO alpha-2 |
| granularity | string | hour 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 rowsSomething inaccurate?Tell support