Reports
Get Data Usage Report
GET /residential/data-usage-report
Returns a data usage report as a CSV file for the given residential user or sub-user. The hash must belong to the authenticated caller's account. An empty date range returns a CSV with headers only.
Query Parameters
hash
String
The app_hash of the residential user or sub-user to generate the report for
date_from
String
Start date of the report range in Y-m-d format
date_to
String
End date of the report range in Y-m-d format. Must be on or after date_from
measurement_unit
String
Unit for traffic values. One of: B, KB, MB, GB
rounding_decimal
Integer
Number of decimal places for traffic values (must be 0 or greater)
time_zone
String
Optional. IANA timezone name used to bucket traffic by date (e.g. Europe/London, America/New_York, UTC). Case-insensitive. When omitted, the default timezone is used
All parameters except time_zone are required.
Example request:
curl -X GET "https://resi-api.iproyal.com/v1/residential/data-usage-report?hash=asd48w4f5c1s2a5w4f8h5t6r1v&date_from=2026-01-01&date_to=2026-01-31&measurement_unit=GB&rounding_decimal=2" \
-H "Authorization: Bearer <your_api_token>" \
-o data-usage-report.csv<?php
$query = http_build_query([
'hash' => 'asd48w4f5c1s2a5w4f8h5t6r1v',
'date_from' => '2026-01-01',
'date_to' => '2026-01-31',
'measurement_unit' => 'GB',
'rounding_decimal' => 2,
]);
$ch = curl_init("https://resi-api.iproyal.com/v1/residential/data-usage-report?{$query}");
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer <your_api_token>']);
curl_setopt($ch, CURLOPT_FILE, fopen('data-usage-report.csv', 'w'));
curl_exec($ch);
curl_close($ch);import requests
params = {
"hash": "asd48w4f5c1s2a5w4f8h5t6r1v",
"date_from": "2026-01-01",
"date_to": "2026-01-31",
"measurement_unit": "GB",
"rounding_decimal": 2,
}
headers = {"Authorization": "Bearer <your_api_token>"}
response = requests.get(
"https://resi-api.iproyal.com/v1/residential/data-usage-report",
params=params,
headers=headers,
stream=True,
)
with open("data-usage-report.csv", "wb") as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)Response
The endpoint returns a CSV file as an attachment.
Response headers:
Example response:
Last updated
Was this helpful?