tencent cloud

文档反馈

DescribeSubdomainAnalytics

最后更新时间:2023-04-27 15:39:09

1. API Description

Domain name for API request: dnspod.tencentcloudapi.com.

This API is used to collect statistics on the DNS query volume of a subdomain. It helps you understand the traffic and time period distribution and allows you to view statistics in the last three months. It is available only for domains under a paid plan.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeSubdomainAnalytics.
Version Yes String Common Params. The value used for this API: 2021-03-23.
Region No String Common Params. This parameter is not required for this API.
Domain Yes String The domain of the DNS query volume to be queried
StartDate Yes String Query start date in the format of YYYY-MM-DD
EndDate Yes String Query end date in the format of YYYY-MM-DD
Subdomain Yes String The subdomain of the DNS query volume to be queried
DnsFormat No String DATE: Daily. HOUR: Hourly
DomainId No Integer The domain ID. DomainId takes priority over Domain. If DomainId is passed in, Domain is ignored. You can view all Domain and DomainId values via the DescribeDomainList API.

3. Output Parameters

Parameter Name Type Description
Data Array of DomainAnalyticsDetail DNS query volume in the current statistical dimension
Info SubdomainAnalyticsInfo Statistics on the DNS query volume of a subdomain
AliasData Array of SubdomainAliasAnalyticsItem DNS query volume of the subdomain alias
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Collecting statistics on the DNS query volume of a subdomain

This example shows you how to collect statistics on the DNS query volume of a subdomain.

Input Example

POST / HTTP/1.1
Host: dnspod.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeSubdomainAnalytics
<Common request parameters>

{
    "Domain": "example.com",
    "StartDate": "2022-06-14",
    "EndDate": "2022-06-14",
    "Subdomain": "test"
}

Output Example

{
    "Response": {
        "AliasData": [],
        "Data": [
            {
                "DateKey": "20221201",
                "HourKey": null,
                "Num": 0
            }
        ],
        "Info": {
            "DnsFormat": "DATE",
            "DnsTotal": 0,
            "Domain": "zhaodapian.com",
            "EndDate": "2022-12-01",
            "StartDate": "2022-12-01",
            "Subdomain": "test"
        },
        "RequestId": "b4aca3e1-c134-4a31-bc07-408d78551449"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.DomainIsSpam You cannot perform this operation on a banned domain.
FailedOperation.DomainNotInService Unable to get the DNS query volume because the current domain has not used the DNSPod service.
FailedOperation.TemporaryError The number of requests is currently unavailable. Try again later.
FailedOperation.UnknowError The operation has no response. Try again later.
InvalidParameter.DomainInvalid The domain is incorrect. Enter a top-level domain such as dnspod.cn.
InvalidParameter.DomainIsAliaser This domain is an alias of another domain.
InvalidParameterValue.DomainGradeInvalid The domain level is incorrect.
InvalidParameterValue.DomainNotExists The current domain is incorrect. Return to the previous step and try again.
OperationDenied.DomainOwnerAllowedOnly Only the domain owner can perform this operation.