- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Instances
DescribeSpotAdvice - Queries the average release rate of spot instances over the past 30 days
Instances
DescribeSpotAdvice - Queries the average release rate of spot instances over the past 30 days
DescribeSpotAdvice - Queries the average release rate of spot instances over the past 30 days
Call the DescribeSpotAdvice operation to query information such as the average release rate and average discount rate of spot instances over the past 30 days.
Usage notes
- For data on instance type, vCPU count, memory, and other metrics, see Instance types.
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, please refer to Common parameters. Action string required Sample value: DescribeSpotAdvice
The operation that you want to perform. Valid value: DescribeSpotAdvice.
Version string required Sample value: 2020-04-01
The version of the API. Valid value: 2020-04-01.
Cpus integer Optional Sample value: 2
The number of vCPUs for the instance type.
If you configure both Cpus and MinCpus, Cpus takes effect.
Gpu.Count integer Optional Sample value: 2
Gpu.ProductName string Optional Sample value: Tesla A100
The type of the GPU computing card.
- Valid values: For detailed information on GPU computing cards of each instance, see GPU instance types.
- Default value: None (that is, all types will be queried).
- When a non-existent GPU computing card type is passed in, the return value is empty.
InstanceTypeFamily string Optional Sample value: ecs.g2i
The instance type family.
InstanceTypeIds.N string[] Optional Sample value: InstanceTypeIds.1=ecs.r2a.xlarge&InstanceTypeIds.2=ecs.g2a.xlarge
Instance type.
- Parameter - N: This specifies the serial number of the instance type. Valid value: 1–10.
- Multiple instance types are separated by &.
tip
If you configure both InstanceTypeFamily and InstanceTypeIds.N, InstanceTypeIds.N takes effect.
MaxResults integer Optional Sample value: 100
The number of entries returned on each page in a pagination query.
MemorySize integer Optional Sample value: 32768
The memory size of the instance type. Unit: MiB.
If you configure both MemorySize and MinMemorySize, MemorySize takes effect.
MinCpus integer Optional Sample value: 2
The minimum number of vCPUs for the instance type.
- You can configure this parameter to perform a fuzzy query. For example, if you set MinCpus to 2, spot instances with two or more vCPUs in this availability zone are queried.
- If you configure both Cpus and MinCpus, Cpus takes effect.
MinMemorySize integer Optional Sample value: 32768
The minimum memory size of the instance type. Unit: MiB.
- You can configure this parameter to perform a fuzzy query. For example, if you set MinMemorySize to 8, spot instances with memory capacity greater than or equal to 8 MiB in this availability zone are queried.
- If you configure both MemorySize and MinMemorySize, MemorySize takes effect.
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.
ZoneId string Optional Sample value: cn-beijing-a
The availability zone ID of the instance type.
You can call the DescribeZones operation to query the availability zones in the same region.
Response parameters
The table below lists only the response parameters specific to this operation. For more information, refer to Response structure. AvailableSpotResources object[] Sample value: --
The array consisting of information such as the release rate and discount rate of spot instances over the past 30 days.
AverageSpotDiscount integer Sample value: 20
The discount rate of the average price of spot instances in the past 30 days compared to the price of pay-as-you-go instances. Unit: %
- You can calculate the average price of spot instances based on this value. For example, if the price of a pay-as-you-go instance is 1 and the return value is 40 (that is, 40%), then the average price of spot instances over the past 30 days is 0.4.
InstanceType string Sample value: ecs.g2i.large
Instance type
InterruptionRate integer Sample value: 0
The average release rate of spot instances over the past 30 days. Unit: %
InterruptionRateRange string Sample value: 0-3%
The range of the average release rate of spot instances over the past 30 days, corresponding to the return value of InterruptionRate. Possible values:
ZoneId string Sample value: cn-beijing-a
The ID of the availability zone where the instance is located.
NextToken string Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******
The query credentials value returned by this call. If null is returned, this page is the last page.
Sample request
Sample response
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