Query instance package price
Updated at:2025-10-20
This API queries the pricing details corresponding to instance specifications.
Request structure
Plain Text
1POST /v{version}/instance/price HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "specId": specId,
6 "spec": spec,
7 "paymentTiming": paymentTiming,
8 "zoneName": zoneName,
9 "purchaseCount": purchaseCount,
10 "purchaseLength": purchaseLength
11}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number |
| specId | String | Yes | RequestBody | Instance family |
| spec | String | Yes | RequestBody | Instance package specification |
| paymentTiming | String | Yes | RequestBody | Billing types include Postpaid and Prepaid. |
| zoneName | String | Yes | RequestBody | Availability zone name |
| purchaseCount | int | No | RequestBody | Query the total price of any count of instances under the specified instance package specification, which must be an integer greater than 0 (optional). The default is 1 |
| purchaseLength | int | Yes | RequestBody | Duration, [1,2,3,4,5,6,7,8,9,12,24,36], unit: month |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| price | List<[SpecIdPrices](BCC/API Reference/Appendix.md#SpecIdPrices)> | Price information of instance package specifications |
Request example
Plain Text
1POST /v2/instance/price HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5{
6 "purchaseCount": 1,
7 "purchaseLength": 1,
8 "specId": "lgn1",
9 "paymentTiming": "Prepaid",
10 "zoneName": "cn-bj-b"
11}
12 Or
13{
14 "purchaseCount": 1,
15 "purchaseLength": 1,
16 "spec": "bcc.lgn1.c12m40.1p40",
17 "paymentTiming": "Prepaid",
18 "zoneName": "cn-bj-b"
19}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "price": [
9 {
10 "specId": "lgn1",
11 "specPrices": [
12 {
13 "spec": "bcc.lgn1.c12m40.1p40",
14 "specPrice": "4017.0",
15 "tradePrice": "3213.6",
16 "status": "available"
17 }
18 ]
19 },
20 {
21 "specId": "lgn1",
22 "specPrices": [
23 {
24 "spec": "bcc.lgn1.c24m80.2p40",
25 "specPrice": "8034.0",
26 "tradePrice": "6427.2",
27 "status": "available"
28 }
29 ]
30 },
31 {
32 "specId": "lgn1",
33 "specPrices": [
34 {
35 "spec": "bcc.lgn1.c48m160.4p40",
36 "specPrice": "16068.0",
37 "tradePrice": "12854.4",
38 "status": "available"
39 }
40 ]
41 }
42 ]
43}
44 Or
45{
46 "price": [
47 {
48 "specId": "lgn1",
49 "specPrices": [
50 {
51 "spec": "bcc.lgn1.c12m40.1p40",
52 "specPrice": "4017.0",
53 "tradePrice": "3213.6",
54 "status": "available"
55 }
56 ]
57 }
58 ]
59}
