You can call the DescribeDomainPvData operation to query page view (PV) statistics. The minimum data sampling interval is 1 hour.

  • 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 data for one domain or all domains under your account.
  • You can query 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 DescribeDomainPvData.
DomainName String Yes The name of the CDN domain to query the PV data for. You can specify only one domain name. If you do not specify this parameter, the PV data of all your CDN domains is queried.
StartTime String No The beginning of the time range where the PV 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 data sampling is 1 hour. 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.

Response parameters

Parameter Type Description
RequestId String The ID of the request.
DomainName String The name of the CDN domain.
DataInterval String The sampling interval of the PV data. The interval is fixed at one hour or one day.
StartTime DateTime The beginning of the time range where the PV data was queried.
EndTime DateTime The end of the time range where the PV data was queried.
PvDataInterval UsageData[] The number of PVs for each interval.

Parameters in UsageData

Parameter Type Description
TimeStamp String The timestamp of the data.
Value String The number of PVs.

Examples

Sample request

http://cdn.aliyuncs.com?Action=DescribeDomainPvData&DomainName=example.com &StartTime=2015-11-28T00:00:00Z &EndTime=2015-11-29T00:00:00Z &<Common request parameters>

Sample success response

JSON format

{
    "DataInterval": "3600",
    "RequestId": "BCD7D917-76F1-442F-BB75-C810DE34C761",
    "DomainName": "example.com",
    "EndTime": "2015-11-29T00:00:00Z",
    "PvDataInterval": {
        "UsageData": [
            {
                "TimeStamp": "2015-11-28T03:00:00Z",
                "Value": "9292"
            },
            {
                "TimeStamp": "2015-11-28T23:00:00Z",
                "Value": "9239"
            },
            {
                "TimeStamp": "2015-11-28T07:00:00Z",
                "Value": "9464"
            },
            {
                "TimeStamp": "2015-11-28T12:00:00Z",
                "Value": "9379"
            },
            {
                "TimeStamp": "2015-11-28T22:00:00Z",
                "Value": "9243"
            },
            {
                "TimeStamp": "2015-11-28T10:00:00Z",
                "Value": "10063"
            },
            {
                "TimeStamp": "2015-11-28T15:00:00Z",
                "Value": "9068"
            },
            {
                "TimeStamp": "2015-11-28T14:00:00Z",
                "Value": "9353"
            },
            {
                "TimeStamp": "2015-11-28T04:00:00Z",
                "Value": "9513"
            },
            {
                "TimeStamp": "2015-11-28T02:00:00Z",
                "Value": "9377"
            },
            {
                "TimeStamp": "2015-11-28T08:00:00Z",
                "Value": "9579"
            },
            {
                "TimeStamp": "2015-11-28T20:00:00Z",
                "Value": "9109"
            },
            {
                "TimeStamp": "2015-11-28T09:00:00Z",
                "Value": "10631"
            },
            {
                "TimeStamp": "2015-11-28T06:00:00Z",
                "Value": "9587"
            },
            {
                "TimeStamp": "2015-11-28T01:00:00Z",
                "Value": "9108"
            },
            {
                "TimeStamp": "2015-11-28T16:00:00Z",
                "Value": "9454"
            },
            {
                "TimeStamp": "2015-11-28T21:00:00Z",
                "Value": "9285"
            },
            {
                "TimeStamp": "2015-11-28T19:00:00Z",
                "Value": "9059"
            },
            {
                "TimeStamp": "2015-11-28T00:00:00Z",
                "Value": "9470"
            },
            {
                "TimeStamp": "2015-11-28T05:00:00Z",
                "Value": "11830"
            },
            {
                "TimeStamp": "2015-11-28T13:00:00Z",
                "Value": "9992"
            },
            {
                "TimeStamp": "2015-11-28T17:00:00Z",
                "Value": "9529"
            },
            {
                "TimeStamp": "2015-11-28T18:00:00Z",
                "Value": "9203"
            },
            {
                "TimeStamp": "2015-11-28T11:00:00Z",
                "Value": "9604"
            }
        ]
    },
    "StartTime": "2015-11-28T00: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 because 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 StartTime is malformed. 400 The error message returned because the specified StartTime parameter is invalid.
InvalidEndTime.Malformed Specified EndTime 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.
InvalidDomainName.ValueNotSupported The specified value of parameter DomainName only support one or empty value. 400 The error message returned because you cannot specify more than one domain name for the DomainName parameter.