Get ISP Metrics
GET
/ea/isp-metrics/{type}
Description
Retrieve ISP metrics data for all sites linked to the UI account’s API key. 5-minute metrics are available for at least 24 hours, and 1-hour metrics for at least 30 days.Parameters
type
string
Required
path
Specify whether metrics are returned using
5m
or 1h
intervals.beginTimestamp
string
Optional
query
The earliest timestamp to start retrieving data from.
endTimestamp
string
Optional
query
The latest timestamp up to which data will be retrieved.
duration
string
Optional
query
Specifies the time range of metrics to be retrieved, starting from when the request is made. Supports
24h
for 5-minute metrics, and 7d
or 30d
for 1-hour metrics. This cannot be used with beginTimestamp
or endTimestamp
.X-API-KEY
string
Required
header
API key
Example
curl -X GET 'https://api.ui.com/ea/isp-metrics/{type}?beginTimestamp=2024-06-30T13:35:00Z&endTimestamp=2024-06-30T15:35:00Z' \
-H 'Accept: application/json' \
-H 'X-API-KEY: dnF8hQgEXlkG5ipcb3pbWwTNV9MZk0Nx'
Responses
200
ok
code
Optional
data
array
Optional
hostId
string
Optional
metricType
string
Optional
periods
array
Optional
data
object
Optional
wan
object
Optional
avgLatency
integer
Optional
download_kbps
integer
Optional
downtime
integer
Optional
ispAsn
string
Optional
ispName
string
Optional
maxLatency
integer
Optional
packetLoss
integer
Optional
upload_kbps
integer
Optional
uptime
integer
Optional
metricTime
string
Optional
date-time
version
string
Optional
siteId
string
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Example Response
{
"data": [
{
"metricType": "5m",
"periods": [
{
"data": {
"wan": {
"avgLatency": 1,
"download_kbps": 0,
"downtime": 0,
"ispAsn": "12578",
"ispName": "ISP",
"maxLatency": 2,
"packetLoss": 0,
"upload_kbps": 0,
"uptime": 100
}
},
"metricTime": "2024-06-30T13:35:00Z",
"version": "1"
}
],
"hostId": "900A6F00301100000000074A6BA90000000007A3387E0000000063EC9853:123456789",
"siteId": "661900ae6aec8f548d49fd54"
}
],
"httpStatusCode": 200,
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
400
invalid parameter
code
Optional
data
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Example Response
{
"code": "parameter_invalid",
"httpStatusCode": 400,
"message": "invalid beginTimestamp format: 2024-06-30",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
401
unauthorized
code
Optional
data
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Example Response
{
"code": "unauthorized",
"httpStatusCode": 401,
"message": "unauthorized",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
429
rate limit
code
Optional
data
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Headers
Retry-After
string
example: 5
Example Response
{
"code": "rate_limit",
"httpStatusCode": 429,
"message": "rate limit exceeded, retry after 5.372786998s",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
500
failed to get ISP metrics
code
Optional
data
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Example Response
{
"code": "server_error",
"httpStatusCode": 500,
"message": "failed to get ISP metrics",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}
Responses
502
bad gateway
code
Optional
data
Optional
httpStatusCode
integer
Optional
message
string
Optional
traceId
string
Optional
Example Response
{
"code": "bad_gateway",
"httpStatusCode": 502,
"message": "bad gateway",
"traceId": "a7dc15e0eb4527142d7823515b15f87d"
}