Cost API

Finout Cost API enables you to query and analyze costs using user-defined Finout Views. You can easily get a list of your views and retrieve the costs for a specified view. You can query the costs for any date range of up to 90 days specified in UTC timestamps. The results are returned in JSON format for easy processing.

Note: Only cost data is returned when querying a view via the Cost API.

GET/Views

Description

Gets a list of all your account views. For more information on views, see Finout Views.

Request https://app.finout.io/v1/view

Response

{
    "data": [
        {
            "name": "Cost Ratio - Weightings by Group Name",
            "id": "25568bb9-7d9b-4b72-9361-07abcb4e5f29"
        },
        {
            "name": "Shared Services - Support, Marketplace, Security",
            "id": "08252cda-3f70-4779-822c-cf4bdf65cc28"
        },

        {
            "name": "K8s by App_Component",
            "id": "f76be053-1138-431f-a6e1-9f6d1852398b"
        }
    ],
    "requestId": "05ac7c0f-2e85-4af0-8ef7-3ace11e420d7"
}

Returns a JSON object with the following properties:

  • name: The names of your account's views.

  • id: The unique identifier of your account's views.

POST /Query by view

Description

Return all costs for a specified view and date range for up to 90 days. For more information on views, see Finout Views.

Request

https://app.finout.io/v1/cost/query-by-view

{
    "viewId": "9c0344f2-94d6-4b9a-b1d5-e57353c117ee",
    "date": {
        "unixTimeMillSecondsStart": 1719824738,
        "unixTimeMillSecondsEnd": 1719911138
    },
    "costType": "netAmortizedCost"
}

Body of Request

Parameter
Type
Description

viewId

string

The ID of the view that the user queries

date

object

“unixTimeMillSecondsStart” and “unixTimeMillSecondsEnd” keys

unixTimeMillSecondsStart

Numeric

Start Date represented in Unix Epoch time

unixTimeMillSecondsEnd

Numeric

End Date represented in Unix Epoch time

costType

String

Types of costs: - blendedCost - unblendedCost - netUnblendedCost - amortizedCost - netAmortizedCost See Cost and Usage Types for an explanation of each cost.

Response

{
    "data": [
        {
            "name": "Total",
            "data": [
                {
                    "time": 1641600000,
                    "cost": 0
                }
            ]
        }
    ],
    "request": {
        "viewId": "9c0344f2-94d6-4b9a-b1d5-e57353c117ee",
        "date": {
            "unixTimeMillSecondsStart": 1719824738,
            "unixTimeMillSecondsEnd": 1719911138
        },
        "costType": "netAmortizedCost"
    },
    "requestId": "629f36f0-191b-4c36-b8dd-13fd8ad7f37d"
}

Last updated

Was this helpful?