Help Center/ Content Delivery Network/ API Reference/ API/ Analytics/ Querying Top User Agent Statistics of a Domain Name
Updated on 2025-09-05 GMT+08:00

Querying Top User Agent Statistics of a Domain Name

Function

  • This API is used to query top user agent statistics of a domain name.

Calling Method

For details, see Calling APIs.

URI

GET /v1.0/cdn/statistics/top-uas

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

start_time

Yes

Long

  • Start timestamp of the query. This parameter must be specified together with the end timestamp. The query interval is left-closed and right-open.

  • If the value of interval is 300, set this parameter to a multiple of 5 minutes, for example, 1631240100000 (2021-09-10 10:15:00).

  • If the value of interval is 3600, set this parameter to the top of an hour, for example, 1631239200000 (2021-09-10 10:00:00).

  • If the value of interval is 86400, set this parameter to 00:00:00 (GTM+08:00), for example, 1631203200000 (2021-09-10 00:00:00).

end_time

Yes

Long

  • End timestamp of the query. This parameter must be specified together with the start timestamp. The query interval is left-closed and right-open.

  • If the value of interval is 300, set this parameter to a multiple of 5 minutes, for example, 1631243700000 (2021-09-10 11:15:00).

  • If the value of interval is 3600, set this parameter to the top of an hour, for example, 1631325600000 (2021-09-11 10:00:00).

  • If the value of interval is 86400, set this parameter to 00:00:00 (GTM+08:00), for example, 1631376000000 (2021-09-12 00:00:00).

domain_name

Yes

String

Domain name list. Use commas (,) to separate multiple domain names, for example, www.test1.com,www.test2.com.

all indicates that all domain names are queried. If no data is available for a domain name within the query period, no information about the domain name is returned.

group_by

No

String

Data grouping mode. This parameter can be set to domain. By default, data is not grouped.

stat_type

Yes

String

  • Statistics types. Possible values: flux (traffic) and req_num (total requests).

service_area

No

String

Region. Possible values: mainland_china (Chinese mainland, default) and outside_mainland_china (outside the Chinese mainland).

enterprise_project_id

No

String

ID of the enterprise project to which the resource belongs. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

include_ratio

No

Boolean

Whether the percentage data is included. The default value is false.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

top_ua_summary

Array of TopUaSummary objects

Detailed data.

Table 3 TopUaSummary

Parameter

Type

Description

ua

String

User agent value.

value

Long

Return value of a query. Traffic unit: byte.

ratio

Double

Proportion of the traffic (or number of requests) from this user agent to the total traffic (or number of requests) in this query. The value is accurate to four decimal places.

Status code: default

Table 4 Response body parameters

Parameter

Type

Description

error

ErrMsg object

Error code and error message.

Table 5 ErrMsg

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Querying top user agent statistics of a domain name

GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/top-uas?&start_time=1577808000000&end_time=1577894400000&domain_name=www.test1.com&stat_type=flux

Example Responses

None

Status Codes

Status Code

Description

200

Success response.

default

Error response.

Error Codes

See Error Codes.