Help Center/ Content Delivery Network/ API Reference/ API/ Analytics/ Creating an Asynchronous Statistics Export Task
Updated on 2025-11-27 GMT+08:00

Creating an Asynchronous Statistics Export Task

Function

This API is used to create an asynchronous statistics export task. SDR data and top URL statistics can be exported.

Calling Method

For details, see Calling APIs.

URI

POST /v1/cdn/statistics/export-tasks

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

action

No

String

Definition

Rule action.

Constraints

N/A

domain_name

No

String

List of subscribed domain names, which are separated by commas (.). If this parameter is set to all, operations reports are subscribed to for all domain names under the account.

start_time

No

Long

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

end_time

No

Long

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

group_by

No

String

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

interval

No

Long

Query interval, in seconds.

service_area

No

String

Definition

Service area of the domain name.

Constraints

If the service area is Chinese mainland or global, the domain name must be licensed by the MIIT.

Value Range

  • mainland_china: Chinese mainland.

  • outside_mainland_china: outside the Chinese mainland.

  • global: global.

Default Value

mainland_china

stat_type

No

String

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

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).

province

No

String

Province code. This parameter is valid when country is set to cn (China). Use commas (,) to separate multiple codes. all indicates all provinces are queried. For details about the values, see the appendix.

isp

No

String

Carrier. If the state/province of the IP address is unknown, null is returned.

language

No

String

Language. The value can be zh (Chinese, default value) or en (English).

Response Parameters

Status code: 200

Success response.

Status code: default

Table 2 Response body parameters

Parameter

Type

Description

error

ErrMsg object

Error code and error message.

Table 3 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.