Skip to content

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.

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.

Terminal window
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.

The fastest way to answer “how much have I used lately”.

Terminal window
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.

Terminal window
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 }
]
}
}

Identical data, ready to open in a spreadsheet.

Terminal window
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.csv
traffic_date,total_value
2026-08-01,12.44
2026-08-02,9.87

Residential only. The other products return 404 here.

Terminal window
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.

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.

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.

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.

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.

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")

Was this page helpful?