You can call the DescribeDomainUvData operation to query unique visitor (UV) statistics. The data sampling interval is 1 hour.

  • If you do not set the StartTime and EndTime parameters, the data within the last 24 hours is queried.
  • If you set both the StartTime and EndTime parameters, the data within the specified time range is queried.
Note
  • You can query either one domain name or all domain names under your account.
  • The maximum time range that you can specify is 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 DescribeDomainUvData.
DomainName String Yes The name of the CDN domain to query the UV data for. You can specify only one domain name. If you do not specify this parameter, the UV data of all your CDN domains is queried.
StartTime String No The beginning of the time range where the UV 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 data sampling interval 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 UV 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 UV data, in seconds. The interval is fixed at 1 hour.
StartTime DateTime The beginning of the time range where the UV data was queried.
EndTime DateTime The end of the time range where the UV data was queried.
UvDataInterval UsageData[] The number of UVs for each interval.

Parameters in UsageData

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

Examples

Sample request

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

Sample success response

JSON format

{
    "DataInterval": "3600",
    "RequestId": "E9D3257A-1B7C-414C-90C1-8D07AC47BCAC",
    "DomainName": "example.com",
    "EndTime": "2015-11-30T00:00:00Z",
    "StartTime": "2015-11-29T00:00:00Z",
    "UvDataInterval": {
        "UsageData": [
            {
                "TimeStamp": "2015-11-29T20:00:00Z",
                "Value": "318"
            },
            {
                "TimeStamp": "2015-11-29T18:00:00Z",
                "Value": "318"
            },
            {
                "TimeStamp": "2015-11-29T03:00:00Z",
                "Value": "329"
            },
            {
                "TimeStamp": "2015-11-29T21:00:00Z",
                "Value": "316"
            },
            {
                "TimeStamp": "2015-11-29T07:00:00Z",
                "Value": "319"
            },
            {
                "TimeStamp": "2015-11-29T00:00:00Z",
                "Value": "326"
            },
            {
                "TimeStamp": "2015-11-29T11:00:00Z",
                "Value": "321"
            },
            {
                "TimeStamp": "2015-11-29T10:00:00Z",
                "Value": "313"
            },
            {
                "TimeStamp": "2015-11-29T08:00:00Z",
                "Value": "331"
            },
            {
                "TimeStamp": "2015-11-29T01:00:00Z",
                "Value": "324"
            },
            {
                "TimeStamp": "2015-11-29T04:00:00Z",
                "Value": "330"
            },
            {
                "TimeStamp": "2015-11-29T14:00:00Z",
                "Value": "335"
            },
            {
                "TimeStamp": "2015-11-29T12:00:00Z",
                "Value": "318"
            },
            {
                "TimeStamp": "2015-11-29T23:00:00Z",
                "Value": "310"
            },
            {
                "TimeStamp": "2015-11-29T17:00:00Z",
                "Value": "309"
            },
            {
                "TimeStamp": "2015-11-29T22:00:00Z",
                "Value": "320"
            },
            {
                "TimeStamp": "2015-11-29T16:00:00Z",
                "Value": "309"
            },
            {
                "TimeStamp": "2015-11-29T02:00:00Z",
                "Value": "317"
            },
            {
                "TimeStamp": "2015-11-29T06:00:00Z",
                "Value": "309"
            },
            {
                "TimeStamp": "2015-11-29T19:00:00Z",
                "Value": "308"
            },
            {
                "TimeStamp": "2015-11-29T13:00:00Z",
                "Value": "347"
            },
            {
                "TimeStamp": "2015-11-29T15:00:00Z",
                "Value": "341"
            },
            {
                "TimeStamp": "2015-11-29T05:00:00Z",
                "Value": "347"
            },
            {
                "TimeStamp": "2015-11-29T09:00:00Z",
                "Value": "312"
            }
        ]
    }
}
			

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