Get ISP Metrics
GET
/ea/isp-metrics/{type}

Description

Retrieves ISP metrics data for all sites linked to the UI account’s API key. 5-minute interval metrics are available for at least 24 hours, and 1-hour interval metrics are available for at least 30 days.

Parameters

type
string
Required
path
Specifies whether metrics are returned using 5m or 1h intervals
beginTimestamp
string
Optional
query
The earliest timestamp to retrieve data from (RFC3339 format)
endTimestamp
string
Optional
query
The latest timestamp to retrieve data up to (RFC3339 format)
duration
string
Optional
query
Specifies the time range of metrics to retrieve, starting from when the request is made. Supports 24h for 5-minute metrics, and 7d or 30d for 1-hour metrics. This parameter cannot be used with beginTimestamp or endTimestamp.
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: API_KEY'

Responses

200
ok
data
array
Generic response data, specific schema depends on the endpoint
metricType
string
periods
array
data
object
wan
object
avgLatency
integer
download_kbps
integer
downtime
integer
ispAsn
string
ispName
string
maxLatency
integer
packetLoss
integer
upload_kbps
integer
uptime
integer
metricTime
string
date-time
version
string
hostId
string
siteId
string
httpStatusCode
integer
HTTP status code
traceId
string
Request trace identifier
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
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
  "code": "parameter_invalid",
  "httpStatusCode": 400,
  "message": "invalid beginTimestamp format: 2024-06-30",
  "traceId": "a7dc15e0eb4527142d7823515b15f87d"
}

Responses

401
unauthorized
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
  "code": "unauthorized",
  "httpStatusCode": 401,
  "message": "unauthorized",
  "traceId": "a7dc15e0eb4527142d7823515b15f87d"
}

Responses

429
rate limit
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier

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
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
  "code": "server_error",
  "httpStatusCode": 500,
  "message": "failed to get ISP metrics",
  "traceId": "a7dc15e0eb4527142d7823515b15f87d"
}

Responses

502
bad gateway
code
Error code from upstream
httpStatusCode
integer
HTTP status code
message
string
Error message
traceId
string
Request trace identifier
Example Response
{
  "code": "bad_gateway",
  "httpStatusCode": 502,
  "message": "bad gateway",
  "traceId": "a7dc15e0eb4527142d7823515b15f87d"
}