fbpx
POSThttps://api.spotinst.io/insights/instanceCosts/export

Get a summary of your instances costs by given time filter.

The request will result in CSV format on your instances from all given accounts.

Notice that the date range can be up to 180 days.

Response fields are:

Fields Name Description
id An ID for response
accountId Account ID
accountName Account name
resourceId Resource ID
cloudProvider Cloud provider (AWS / GCP / Azure)
instanceId Instance ID
instanceType Instance type
region Region
useCase K8S, Load Balancing and etc.
lifeCycle Excess capacity (Spot / preemptible), On-Demand
product Instance product
launchTime Instance launch time
terminationTime Instance termination time
runningHours Instance run time (in hours)
odHourlyPrice Instance hourly cost if it ran on OD
odCost Instance cost if it ran on OD
actualCost Instance actual cost
savings Dollar amount saved for the instance
reservationId Indicates wheater the instance is a RI (Reserved Instance)

 

Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
    "accountIds": [
        "act-abc12345"
    ],
    "fromDate": 1569950296,
    "toDate": 1570727896 
}
Attribute Type Description
accountIds Array<String>

Comma separated list of account IDs

fromDate String

Date values following either a date format (YYYY-MM-DDTHH:mm:ss.SSSZ ; 2016-01-10T00:00:00.000Z) or Unix seconds Timestamp (1494751821)

toDate String

Date values following either a date format (YYYY-MM-DDTHH:mm:ss.SSSZ ; 2016-01-10T00:00:00.000Z) or Unix seconds Timestamp (1494751821)

Response

Body
Copied!
Downloaded!
id,accountId,accountName,resourceId,cloudProvider,instanceId,instanceType,region,useCase,lifeCycle,product,launchTime,terminationTime,runningHours,odHourlyPrice,odCost,actualCost,savings,reservationId
2439,act-abc12345,Demo,oesg-cc4740e1,AWS,i-00d67d5efc69e938d,r4.large,us-west-2,K8S,EXCESS,LINUX,2019-10-05T02:59:40.000Z,2019-10-05T03:15:12.000Z,1,0.133,0.133,0.0337,0.0993,
2576,act-abc12345,Demo,oesg-5feb10ab,AWS,i-01086811aefdc4959,c4.large,us-west-2,K8S,EXCESS,LINUX,2019-10-06T10:13:03.000Z,2019-10-06T19:07:05.000Z,9,0.1,0.9,0.279,0.621,
1760,act-abc12345,Demo,oesg-cc4740e1,AWS,i-01797b0ac578198fa,c3.large,us-west-2,K8S,EXCESS,LINUX,2019-08-27T06:41:14.000Z,2019-10-05T02:57:30.000Z,23.9997,0.105,2.52,0.7008,1.8192,
1761,act-abc12345,Demo,oesg-cc4740e1,AWS,i-02e460584769b3c28,r4.large,us-west-2,K8S,EXCESS,LINUX,2019-08-20T22:23:54.000Z,,23.9997,0.133,3.192,0.8088,2.3832,