tencent cloud

TencentDB for MySQL

DocumentationTencentDB for MySQL

DescribeDBPrice

Download
Focus Mode
Font Size
Last updated: 2026-06-09 16:30:52

1. API Description

Domain name for API request: cdb.intl.tencentcloudapi.com.

This API is used to query the price of purchasing or renewing a cloud database instance. It supports querying the price of pay-as-you-go or yearly/monthly subscription. You can input instance type, purchase period, purchase quantity, memory size, disk capacity and availability zone information to query instance price. You can input instance name to query instance renewal price.

Note: To request a price for a certain region, please use the access point of the corresponding region. For access point information, please refer to the service address document. For example, to request a price for the Guangzhou region, send the request to: cdb.ap-guangzhou.tencentcloudapi.com. Likewise, for the Shanghai region, send the request to: cdb.ap-shanghai.tencentcloudapi.com.

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: DescribeDBPrice.
Version Yes String Common Params. The value used for this API: 2017-03-20.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Period Yes Integer

Instance duration, in months, minimum value 1, maximum value 36. This field is invalid when querying the pay-as-you-go rate.

Zone No String

AZ information, in the format of "ap-guangzhou-2". For available values, query the DescribeDBZoneConfig api. This parameter is required when InstanceId is empty.

GoodsNum No Integer

Instance count. Default value is 1, minimum value 1, maximum value 100. This parameter is required when InstanceId is empty.

Memory No Integer

Instance memory size, measurement unit: MB. Required when InstanceId is empty. To ensure the input value is valid, please use the obtain the purchasable specifications of cloud databases API to obtain the saleable instance memory size range.

Volume No Integer

Instance disk size, unit: GB. This parameter is required when InstanceId is empty. To ensure the input value is valid, please use the obtain the purchasable specifications of cloud databases API to get the saleable disk size range.

InstanceRole No String

Instance type, defaults to master. Supported values include: master - primary instance, ro - read-only instance, dr - disaster recovery instance. Required when InstanceId is empty.

PayType No String

Payment type. Supported values: PRE_PAID (yearly/monthly subscription) and HOUR_PAID (pay-as-you-go). This parameter is required when InstanceId is empty.

ProtectMode No Integer

Data replication method, defaults to 0. Supported values include: 0 - means async replication, 1 - means semi-sync replication, 2 - means strong sync replication.

DeviceType No String

Instance isolation type.

Enumeration value:

  • UNIVERSAL: General-purpose instance
  • EXCLUSIVE: Dedicated instance
  • CLOUD_NATIVE_CLUSTER: Standard type of cloud disk edition
  • CLOUD_NATIVE_CLUSTER_EXCLUSIVE: Enhanced type of cloud disk edition
  • CLOUD_NATIVE_CLUSTER_ULTRA: Flagship type of cloud disk edition

Default value: UNIVERSAL

If needed to query the price of a single-node instance of cloud disk edition, set up this parameter as CLOUD_NATIVE_CLUSTER and specify parameter InstanceNodes as 1.

InstanceNodes No Integer

Number of instance nodes.
1. When querying the price of a read-only instance or a single-node instance, the value of this field is 1.
2. When querying the price of a dual-node instance, the value of this field is 2.
3. When querying the price of a three-node instance, the value of this field is 3.
4. When querying the price of a cloud disk edition instance, the value range of this field can be 2 - 6. A value of 2 means the cloud disk edition instance has 1 read-write node + 1 read-only node. A value of 6 means the cloud disk edition instance has 1 read-write node + 5 read-only nodes. For other values (3 - 5), the rule is 1 read-write node + (value - 1) read-only nodes.

Cpu No Integer

The number of CPU cores of the price-query instance, measurement unit: core. To ensure the validity of the input CPU value, please use the obtain the purchasable specifications of cloud databases API acquisition to get the saleable number of cores. When this value is not specified, a default value will be padded based on the Memory size.

InstanceId No String

Query the ID of the instance to be renewed. If needed, fill in InstanceId and Period to query instance renewal price.

Ladder No Integer

Usage-based billing tier. Valid only when PayType=HOUR_PAID. Supported values include: 1, 2, 3. For step duration, see https://www.tencentcloud.com/document/product/236/18335.?from_cn_redirect=1

DiskType No String

Disk Type. Specify this parameter when querying the price of CLOUD disk edition or single-node instance of CLOUD disk edition. Default value: SSD CLOUD Block Storage.
Supported values include:
"CLOUD_SSD" - SSD CLOUD Block Storage.
"CLOUD_HSSD" - Enhanced SSD CLOUD Disk.
"CLOUD_PREMIUM" - High-performance CLOUD Block Storage.

3. Output Parameters

Parameter Name Type Description
Price Integer

Instance price, unit: cent.

OriginalPrice Integer

Original price of instance. Measurement unit: cent.

Currency String

Currency unit. CNY - RMB, USD - USD.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying the Price for Purchasing Database Instances

Query database instance purchase price

Input Example

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

{
    "Zone": "ap-guangzhou-1",
    "GoodsNum": 1,
    "PayType": "PRE_PAID",
    "Period": 24,
    "Volume": 25,
    "Memory": 1000
}

Output Example

{
    "Response": {
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
        "Currency": "CNY",
        "Price": 48000,
        "OriginalPrice": 460800
    }
}

Example2 Querying the Renewal Price for Database Instances

Query database instance renewal price

Input Example

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

{
    "InstanceId": "cdb-6no119yd",
    "Period": 24
}

Output Example

{
    "Response": {
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
        "Currency": "CNY",
        "Price": 48000,
        "OriginalPrice": 460800
    }
}

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
InternalError.CauthError Authentication failed.
InternalError.DatabaseAccessError Internal database error.
InternalError.TradeError Transaction system error.
InternalError.UndefinedError Unknown error
InvalidParameter Parameter error.
InvalidParameter.InstanceNotFound The instance does not exist.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback