Help Center/ Content Delivery Network/ API Reference/ API/ Analytics/ Querying Daily Client Access Details by Domain Name
Updated on 2025-09-05 GMT+08:00

Querying Daily Client Access Details by Domain Name

Function

  • This API is used to query daily client access details by domain name.

  • You can query data within the past 90 days.

  • The ip_num query covers up to one day, while the uv query spans only 5 minutes.

  • The start time and end time must be both specified. For example, if the start time is 2022-07-12 00:00:00 and end time is 2022-07-13 00:00:00, the statistics in [2022-07-12 00:00:00, 2022-07-13 00:00:00) are queried.

  • The start time and end time of the ip_num query must be timestamps in milliseconds. They must be 00:00:00. Otherwise, the returned data may not be the expected data.

  • For the uv query, only exact 5-minute intervals are allowed, for example, 0 minutes, 5 minutes, 10 minutes, and 15 minutes. If the values are not exact 5-minute intervals, the returned data may not be the expected data.

Calling Method

For details, see Calling APIs.

URI

GET /v1.0/cdn/statistics/domain-client-stats

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.

stat_type

Yes

String

  • Types of client access metrics:

  • ip_num (number of unique IP addresses)

  • uv (number of unique visitors within 5 minutes. Each unique IP address is counted as a unique visitor.)

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.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

service_area

String

Area.

result

Array of Map<String,Object> objects

Daily client access details by domain name.

Status code: default

Table 3 Response body parameters

Parameter

Type

Description

error

ErrMsg object

Error code and error message.

Table 4 ErrMsg

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Querying client access details

GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/domain-client-stats?&start_time=1577808000000&end_time=1577894400000&domain_name=www.test1.com&stat_type=ip_num

Example Responses

None

Status Codes

Status Code

Description

200

Success response.

default

Error response.

Error Codes

See Error Codes.