GET
/analytics/traffic Retrieve traffic data
Returns traffic data for a specific IP address over a given time period.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
ip | string | query | The IP address to retrieve traffic data for |
unit* | mbps | pps | query | The unit of measurement for traffic data (megabits per second or packets per second) |
time* | integer | query | The time period in seconds for which to retrieve traffic data |
Response
200
400
dataobjectintervalintegerThe number of minutes between each data point
trafficarrayArray of traffic data points [timestamp, allowed traffic, dropped traffic]
successbooleanRequest
curl -X GET "https://shield.royalehosting.net/api/v2/analytics/traffic" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-organization-id: YOUR_ORG_ID"Request
const response = await fetch("https://shield.royalehosting.net/api/v2/analytics/traffic", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
},
});
const data = await response.json();Request
import requests
response = requests.get(
"https://shield.royalehosting.net/api/v2/analytics/traffic",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
}
)
print(response.json())Response
{
"data": {
"interval": 1,
"traffic": [
[
1724781300,
40023,
0
],
[
1724781360,
744910,
0
]
]
},
"success": true
}