Get traffic/usage report
unifi_get_traffic_reportRetrieve historical UniFi traffic and client-count time series in 5-minute to monthly buckets for sites, gateways, access points, or individual clients.
Instructions
Get historical time-series statistics in buckets of 5 minutes to a month. scope=site for whole-site traffic and client counts, gw for gateway CPU/memory/WAN traffic, ap for per-AP traffic, user for per-client traffic (pass macs). For traffic by application use unifi_get_dpi_stats.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scope": "<scope>"
},
"name": "unifi_get_traffic_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macs | No | Limit to these device/client MACs (ap and user scopes) | |
| site | No | Site name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites. | |
| attrs | No | Override the attributes to fetch, e.g. ['rx_bytes','tx_bytes','time'] | |
| hours | No | Look back this many hours (default: 12 for 5minutes, 168 for hourly, 720 for daily, 8760 for monthly) | |
| scope | Yes | What to report on | |
| interval | No | Bucket size (default hourly) |