- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Instances
DescribeSpotPriceHistory - Queries historical prices of spot instances
Instances
DescribeSpotPriceHistory - Queries historical prices of spot instances
DescribeSpotPriceHistory - Queries historical prices of spot instances
Call the DescribeSpotPriceHistory operation to query the historical prices of spot instances within the past 30 days.
Usage notes
For the operation process, precautions, and operation instructions of spot instances, see Spot instance overview. Debugging
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
Request parameters
The table below lists only the request parameters specific to this operation and some common parameters. For more information, refer to Common parameters. Action string required Sample value: DescribeSpotPriceHistory
The operation that you want to perform. Valid value: DescribeSpotPriceHistory.
Version string required Sample value: 2020-04-01
The version of the API. Valid value: 2020-04-01.
InstanceTypeId string required Sample value: ecs.g1ie.xlarge
The instance type.
MaxResults integer Optional Sample value: 20
The number of entries returned on each page in a pagination query.
NextToken string Optional Sample value: --
Pagination token marking the query position. Omit this parameter for initial API requests. In the next query, set the NextToken parameter to the value returned by the previous API call.
TimestampEnd string Optional Sample value: 2021-06-28T18:29:38+08:00
The end time for querying the historical prices of spot instances. This time cannot be later than the current time, nor can it be 30 days ago or earlier.
- The default value is empty, which specifies the current time.
- Time format: YYYY-mm-ddTHH:MM:SSZ or YYYY-mm-ddTHH:MM:SS+ZZ:ZZ.
TimestampStart string Optional Sample value: 2021-06-28T18:29:38+08:00
The start time for querying the historical prices of spot instances. When the specified time is 30 days ago, the default start time is 30 days ago.
- The default value is empty, which specifies 3 hours before the end time.
- Time format: YYYY-mm-ddTHH:MM:SSZ or YYYY-mm-ddTHH:MM:SS+ZZ:ZZ.
ZoneId string Optional Sample value: cn-beijing-a
The ID of the availability zone where the instance type is located.
You can call the DescribeZones operation to query the availability zones in the same region.
Response parameters
Only the response parameters specific to this operation are listed below. For more information, refer to the response structure. NextToken string Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******
The query credential returned by this call. If null is returned, this page is the last page.
SpotPrices object[] Sample value: --
The price details of spot instances.
InstanceTypeId string Sample value: ecs.g1ie.xlarge
The type of spot instances.
SpotPrice float Sample value: 0.036
The price of spot instances. Unit: CNY.
Timestamp string Sample value: 2021-06-28T18:29:38+08:00
The time during which spot instances are at this price.
ZoneId string Sample value: cn-beijing-a
The availability zone ID of spot instances.
Sample request
GET /?Action=DescribeSpotPriceHistory&Version=2020-04-01&ZoneId=cn-beijing-a&InstanceTypeId=ecs.g1ie.xlarge HTTP/1.1
Host: ecs.cn-beijing.volcengineapi.com
Sample response
"RequestId": "20230426113431A57961174C490267****",
"Action": "DescribeSpotPriceHistory",
"Version": "2020-04-01",
"Region": "cn-beijing-a"
"InstanceType": "ecs.g1ie.xlarge",
"Timestamp": "2021-06-28T18:29:38+08:00",
"ZoneId": "cn-beijing-a"
"NextToken": "bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******"
Error codes
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.
Last updated: 2026.06.18 17:48:26