You can call the DescribeDomainTrafficData operation to query the network traffic data of the specified CDN domains. The network traffic is measured in bytes.

  • If you do not specify the StartTime or EndTime parameters, the data within the last 24 hours is queried.
  • If you specify both the StartTime and EndTime parameters, the data within the specified time range is queried.
Note
  • You can query network traffic data for multiple CDN domains and use a comma (,) to separate two domain names.
  • You can query the data of up to the last 90 days.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String  Yes The operation that you want to perform. Set this parameter to DescribeDomainTrafficData.
DomainName String No
  • If you do not specify this parameter, the data of all your CDN domains is queried.
  • Specify the name of the CDN domain of which the data is queried.
  • You can specify multiple domain names and separate them with commas (,).
StartTime String No The beginning of the time range where the data is queried.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.
  • The minimum sampling interval is 5 minutes. If you do not specify this parameter, the data generated within the last 24 hours is queried.
EndTime String No
  • The end of the time range where the data is queried. The end time must be later than the start time.
  • Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.
  • The time must be in UTC.
Interval String No
  • The data sampling interval. Unit: seconds. The valid values depend on the specified time range.
  • Less than 3 days: 300 (default), 3600, and 86400
  • 3 to 31 (exclusive) days: 3600 (default) and 86400
  • No less than 31 days: 86400 (default)
  • If you do not specify this parameter or if you specify an invalid value, the default value applies.
LocationNameEn String No The English name of the region. To query region names, call the DescribeCdnRegionAndIsp operation. If you do not specify this parameter, the network traffic data of the CDN domains in all regions is queried.
IspNameEn String No The English name of the network provider. To query network provider names, call the DescribeCdnRegionAndIsp operation. If you do not specify this parameter, the network traffic data of CDN domains for all network providers is queried.

Response parameters

Parameter Type Description
DomainName String The name of the CDN domain.
DataInterval String The data sampling interval, in seconds.
StartTime DateTime The beginning of the time range where the data was queried.
EndTime DateTime The end of the time range where the data was queried.
TrafficDataPerInterval DataModule[] The network traffic data for each sampling interval.

Parameters in DataModule

Parameter Type Description
TimeStamp String The timestamp of the data.
Value String The total amount of network traffic.
DomesticValue String The amount of network traffic in Mainland China.
OverseasValue String The amount of network traffic outside Mainland China.
HttpsValue String The total amount of HTTPS network traffic on level 1 (L1) nodes.
HttpsDomesticValue String The amount of HTTPS network traffic on L1 nodes in Mainland China.
HttpsOverseasValue String The amount of HTTPS network traffic on L1 nodes outside Mainland China.

Examples

Sample request

http://cdn.aliyuncs.com?Action=DescribeDomainTrafficData&DomainName=example.com
&StartTime=2015-12-10T20:00:00Z
&EndTime=2015-12-10T21:00:00Z
&<Common request parameters>

Sample success response

JSON format

{
    "DomainName": "example.com",
    "DataInterval": "300",
    "TrafficDataPerInterval": {
        "DataModule": [
            {
                "TimeStamp": "2015-12-10T20:00:00Z",
                "Value": "423304182",
                "DomesticValue": "0",
                "OverseasValue": "0",
                "HttpsValue": "423304182",
                "HttpsDomesticValue": "0",
                "HttpsOverseasValue": "0"
            },
            {
                "TimeStamp": "2015-12-10T20:05:00Z",
                "Value": "454680793",
                "DomesticValue": "0",
                "OverseasValue": "0",
                "HttpsValue": "423304182",
                "HttpsDomesticValue": "0",
                "HttpsOverseasValue": "0"
            },
            {
                "TimeStamp": "2015-12-10T20:10:00Z",
                "Value": "501718342",
                "DomesticValue": "0",
                "OverseasValue": "0",
                "HttpsValue": "423304182",
                "HttpsDomesticValue": "0",
                "HttpsOverseasValue": "0"
            }
        ]
    },
    "RequestId": "B955107D-E658-4E77-B913-E0AC3D31693E",
    "StartTime": "2015-12-10T20:00:00Z",
    "EndTime": "2015-12-10T21:00:00Z"
}

Error codes

Error code Error message HTTP status code Description
Throttling Request was denied due to request throttling. 503 The error message returned when the request was denied due to throttling.
IllegalOperation Illegal domain, operation is not permitted. 403 The error message returned because the specified domain name is invalid.
OperationDenied Your account does not open CDN service yet. 403 The error message returned because CDN has not been activated for your account.
OperationDenied Your CDN service is suspended. 403 The error message returned because CDN has been suspended for your account.
InvalidDomain.NotFound The domain provided does not belong to you. 404 The error message returned because the specified domain does not exist or does not belong to you.
InvalidDomain.Offline The domain provided is offline. 404 The error message returned because the specified domain is disabled.
ServiceBusy The specified Domain is configuring, please retry later. 403 The error message returned because the specified domain is being configured. Try again later.
InvalidDomain.Configure_failed Failed to configure the provided domain. 500 The error message returned because the system has failed to configure the specified domain.
MissingParameter StartTime and EndTime can not be single. 400 The error message returned because you must specify both the StartTime and EndTime parameters.
InvalidStartTime.Malformed Specified start time is malformed. 400 The error message returned because the specified StartTime parameter is invalid.
InvalidEndTime.Malformed Specified end time is malformed. 400 The error message returned because the specified EndTime parameter is invalid.
InvalidEndTime.Mismatch Specified end time does not math the specified start time. 400 The error message returned because the specified EndTime parameter is earlier than the specified StartTime parameter.
InvalidStartTime.ValueNotSupported Specified end time does not math the specified start time. 400 The error message returned because the time range specified by the EndTime and StartTime parameters exceeds the maximum value of 90 days.