v1

latestOpenAPI 3.0.02026-08-0645003.8 MB
Insights Service

Get Costs per Account

Retrieve costs up to one year back per specified account over a specified time period.

get/aws/costs

Query parameters

accountIdstring

ID of the account associated with your token

fromDatestring

Date can be either in ISO-8601 date format (yyyy-mm-dd) or in Unix Timestamp format (e.g. 1494751821472). *Minimum from date can be one year ago.

toDatestring

Date can be either in ISO-8601 date format (yyyy-mm-dd) or in Unix Timestamp format (e.g. 1494751821472). *Data is shown until the past day (Does not include today's costs)

aggregationPeriodstring

Optional. The time period over which data is aggregated. Can only be "daily". For example, the figures in each data set are per day

Response

Costs Per Account Response

Example response

{
  "request": {
    "id": "67582d0c-108b-4ef7-9fdc-d39678a30844",
    "url": "/aws/costs",
    "method": "GET",
    "timestamp": "2018-01-07T07:30:58.622Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:aws:costs",
    "items": [
      [
        {
          "timestamp": "2020-03-06T00:00:00.000Z",
          "spot": {
            "runningHours": 1470.8,
            "actualCosts": 107.3,
            "potentialCosts": 378.41,
            "savingsPercentage": 71.64
          }
        }
      ]
    ],
    "count": 1
  }
}