Bandwidth API
Query your bandwidth usage from code instead of reading it off a dashboard. Use it to bill your own customers, alert before a balance runs out, or pull usage into your own reporting.
Base URL: https://app.rayobyte.com/api/users/stats/{product}
{product} |
|
|---|---|
residential |
Residential Proxies |
rotating-isp |
Rotating ISP |
rotating-dc |
Rotating DC |
web-unblocker |
Web Unblocker |
The Scraping API is billed per scrape rather than by bandwidth, so it is not available here. Use its own balance endpoint instead.
Authentication
Section titled “Authentication”A bearer token, separate from your proxy password. Generate it in the dashboard under Proxy Access → Stats API, where you can also reveal, copy and rotate it.
curl -H "Authorization: Bearer rbapi_YOUR_TOKEN" \ "https://app.rayobyte.com/api/users/stats/residential/summary"Tokens start with rbapi_. Rotating one invalidates the old value immediately.
The token identifies your account by itself. There is no account or login parameter on any of these endpoints, and you can only ever read your own usage.
Endpoints
Section titled “Endpoints”Summary
Section titled “Summary”The fastest way to answer “how much have I used lately”.
curl -H "Authorization: Bearer rbapi_YOUR_TOKEN" \ "https://app.rayobyte.com/api/users/stats/residential/summary"{ "status": "SUCCESS", "date": "Fri, 21 Aug 2026 09:00:00 GMT", "data": { "product": "residential", "unit": "Gb", "from": "2026-07-23", "to": "2026-08-21", "window_days": 30, "total_value": 412.75, "today_value": 8.31 }}Always a rolling 30 days, always in Gb. It takes no parameters.
Daily bandwidth
Section titled “Daily bandwidth”curl -H "Authorization: Bearer rbapi_YOUR_TOKEN" \ "https://app.rayobyte.com/api/users/stats/residential/bandwidth?from=2026-08-01&to=2026-08-21&unit=Gb"{ "status": "SUCCESS", "data": { "product": "residential", "unit": "Gb", "from": "2026-08-01", "to": "2026-08-21", "series": [ { "traffic_date": "2026-08-01", "total_value": 12.44 }, { "traffic_date": "2026-08-02", "total_value": 9.87 } ] }}Daily bandwidth as CSV
Section titled “Daily bandwidth as CSV”Identical data, ready to open in a spreadsheet.
curl -H "Authorization: Bearer rbapi_YOUR_TOKEN" \ "https://app.rayobyte.com/api/users/stats/residential/bandwidth.csv?from=2026-08-01&to=2026-08-21" \ -o bandwidth.csvtraffic_date,total_value2026-08-01,12.442026-08-02,9.87Per-country breakdown
Section titled “Per-country breakdown”Residential only. The other products return 404 here.
curl -H "Authorization: Bearer rbapi_YOUR_TOKEN" \ "https://app.rayobyte.com/api/users/stats/residential/countries?from=2026-08-01&to=2026-08-21"Use it to see which country targeting is actually
consuming your bandwidth. A country you did not intend to use showing up here
usually means a request went out without a -country- option.
Parameters
Section titled “Parameters”| Parameter | Required | Default | Rules |
|---|---|---|---|
from |
Yes | YYYY-MM-DD, a real calendar date |
|
to |
No | today | YYYY-MM-DD, and not before from |
unit |
No | Gb |
Kb, Mb, Gb or Tb |
from and to are inclusive, and the span cannot exceed 366 days. A longer
range returns 400 rather than being silently truncated, so a “last 12 months”
query always works and an unbounded one never does.
2026-13-99 is rejected. The check is a real calendar date, not a pattern match.
Response envelope
Section titled “Response envelope”Every JSON response carries the same wrapper.
{ "status": "SUCCESS", "date": "...", "data": { } }{ "status": "FAIL", "date": "...", "error": "Range too large: max 366 days" }Check status rather than parsing error strings. The .csv endpoint returns
CSV on success and this JSON envelope on failure, so check the content type
before parsing.
Errors
Section titled “Errors”| Code | Meaning |
|---|---|
400 |
Bad from/to/unit, or a range over 366 days |
401 |
Missing, malformed or rotated token |
403 |
Account suspended |
404 |
Unknown product, or countries on a non-residential product |
429 |
Over the rate limit |
Suspension is re-checked on every request, so a token stops working the moment an account is suspended and starts working again when it is not.
Rate limit
Section titled “Rate limit”60 requests per minute per account, across every endpoint here combined.
That is plenty for reporting and nowhere near enough to poll per proxy request.
Pull a daily series once and read it locally rather than calling summary in a
loop.
Example: alert before you run out
Section titled “Example: alert before you run out”import os, requests
BASE = "https://app.rayobyte.com/api/users/stats"HEADERS = {"Authorization": f"Bearer {os.environ['RAYOBYTE_STATS_TOKEN']}"}
def last_30_days(product="residential"): r = requests.get(f"{BASE}/{product}/summary", headers=HEADERS, timeout=30) r.raise_for_status() body = r.json() if body["status"] != "SUCCESS": raise RuntimeError(body["error"]) return body["data"]
d = last_30_days()print(f"{d['total_value']} {d['unit']} in {d['window_days']} days, " f"{d['today_value']} today")const BASE = 'https://app.rayobyte.com/api/users/stats';
async function last30Days(product = 'residential') { const res = await fetch(`${BASE}/${product}/summary`, { headers: { Authorization: `Bearer ${process.env.RAYOBYTE_STATS_TOKEN}` }, }); const body = await res.json(); if (body.status !== 'SUCCESS') throw new Error(body.error); return body.data;}
const d = await last30Days();console.log(`${d.total_value} ${d.unit} in ${d.window_days} days`);Related
Section titled “Related”- Usage & statistics for the same data in the dashboard
- Billing & bandwidth for topping up and auto-replenish
Was this page helpful?
Thanks — that helps us fix it.