Help Center/ Content Delivery Network/ API Reference/ API/ Analytics/ Querying Country-Level Statistics of a Domain Name
Updated on 2025-11-27 GMT+08:00

Querying Country-Level Statistics of a Domain Name

Function

This API is used to query the country-level statistics of a domain name.

Calling Method

For details, see Calling APIs.

URI

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

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

action

Yes

String

  • Action name. Possible values are summary and detail.

  • summary: querying summary data.

  • detail: querying data details.

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

  • Network resource consumption statistics:

    • bw (bandwidth)

    • flux (traffic)

  • Access statistics:

    • req_num (number of requests)

  • HTTP status code statistics (one or more types can be returned):

    • http_code_2xx (status codes 2xx)

    • http_code_3xx (status codes 3xx)

    • http_code_4xx (status codes 4xx)

    • http_code_5xx (status codes 5xx)

    • status_code_2xx (details of status codes 2xx)

    • status_code_3xx (details of status codes 3xx)

    • status_code_4xx (details of status codes 4xx)

    • status_code_5xx (details of status codes 5xx)

country

No

String

  • Country and region codes, which are separated by commas (,). The value all indicates all codes. For details about the values, see the appendix.

  • This parameter cannot be set when carrier statistics are queried.

  • This parameter cannot be set when top URL statistics are queried.

  • When accessing regional data, set this parameter to cn (China).

group_by

No

String

Data grouping mode. Use commas (,) to separate multiple groups. Available data groups are domain, country, province, and isp. By default, data is not grouped.

user_domain_id

No

String

Domain ID of the domain name's owner.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

action

String

Definition

Rule action.

Constraints

N/A

start_time

Long

Query start time. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

end_time

Long

Query end time. The value is the number of milliseconds since the UNIX epoch (Jan 1, 1970).

stat_type

String

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

result

Array

Detailed data.

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

None

Example Responses

None

Status Codes

Status Code

Description

200

Success response.

default

Error response.

Error Codes

See Error Codes.