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 NameDescription
idAn ID for response
accountIdAccount ID
accountNameAccount name
resourceIdResource ID
cloudProviderCloud provider (AWS / GCP / Azure)
instanceIdInstance ID
instanceTypeInstance type
regionRegion
useCaseK8S, Load Balancing and etc.
lifeCycleExcess capacity (Spot / preemptible), On-Demand
productInstance product
launchTimeInstance launch time
terminationTimeInstance termination time
runningHoursInstance run time (in hours)
odHourlyPriceInstance hourly cost if it ran on OD
odCostInstance cost if it ran on OD
actualCostInstance actual cost
savingsDollar amount saved for the instance
reservationIdIndicates 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 
}
AttributeTypeDescription
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,