Getting a traffic report for a type and period
Note
This endpoint is only available to organisations with traffic reports enabled and requires admin-level access rights.
Note
SOC accounts cannot call this endpoint with a personal access token. There is no corresponding organisation-related token. Use access through the web application (session authentication) instead.
Sends a GET request to the endpoint /traffic-reports/{type}/{date}.
Description
The Get-Traffic-Report request returns the entries of the traffic report for a specified type and period.
Requirements
Values of the request: Report type {type}; Period {date}
Objects: none
Request
To request the traffic report, add the Report type {type} and the Period {date} to the path of the request.
Report type {type} defines the granularity of the report. The following values are available:
| Attributes | Description | Values |
|---|---|---|
daily |
Returns traffic data aggregated by day for the specified month. | |
monthly |
Returns traffic data aggregated by month for the specified month. |
Period {date} defines the report period. The value must be YYYY-MM-DD for daily granularity and YYYY-MM for monthly granularity.
As a result, the user gets one or more objects TrafficReportVO with the requested information.
The object provides the following information:
| Attributes | Description | Values |
|---|---|---|
ip |
The IP address of the host. | string |
cidr |
The CIDR block to which the IP address belongs. | string |
period_start |
The start of the report period in UTC. | string($date) |
period_end |
The end of the report period in UTC. | string($date) |
traffic |
The total traffic for the period in bytes. | number($float) |
packets |
The total number of packets for the period. | number($float) |
Example
Example response:
{
"data": [
{
"ip": "192.0.2.1",
"cidr": "192.0.2.0/24",
"period_start": "2026-04-01",
"period_end": "2026-04-01",
"traffic": 1234567,
"packets": 8910
}
],
"links": {
"first": "https://datahub-api.com/api/networks?page=1",
"last": "https://datahub-api.com/api/networks?page=5",
"prev": null,
"next": "https://datahub-api.com/api/networks?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"links": [
{
"url": "https://datahub-api.com/api/networks?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://datahub-api.com/api/networks",
"per_page": 15,
"to": 15,
"total": 64
}
}
Responses
The following responses are available:
| STATUS CODE | DESCRIPTION |
|---|---|
| 200 | The request has succeeded. |
| 401 | The request has not succeeded because the user authentication was incorrect. |
| 403 | The request has not succeeded because the user does not have the right permissions. |
| 404 | The request was unsuccessful because the requested resource was not found. |