LogoLogo
Contact Us
  • Finout Documentation
  • Get Started with Finout
    • Introduction to Finout's Suite of Features
    • Onboarding New Users to Your Finout Account
    • Single Sign-On (SSO) Setup
    • Enterprise Discount Program (EDP)
    • Cost and Usage Types
      • FairShare Cost
      • List Cost
  • Integrations
    • Cloud Services
      • Connect to AWS
      • Connect to Azure
      • Connect to Oracle
      • Connect to GCP
    • Third Party
      • Connect to Confluent
      • Connect to Databricks
      • Connect to Snowflake
      • Connect to Jira
      • Connect to Datadog
        • Datadog API Cost Calculation
        • Datadog Integration Levels
        • Datadog Usage Attribution Tags (UAT)
      • Connect to Microsoft Teams
      • Connect to ServiceNow
      • Custom Cost Centers
      • Credentials Vault
    • Telemetry
      • S3 Telemetry Integration
      • Setting Up a Datadog - Finout Metrics Integration (Export)
    • Kubernetes
      • Connect to Kubernetes Prometheus
      • Kubernetes - How Finout Calculates K8s Costs
      • Kubernetes MegaBill
      • Kubernetes Budgeting
      • Kubernetes Anomaly Detection
      • Kubernetes Custom Dashboards
      • Kubernetes Predefined Dashboards
      • Ensure Compatibility of Your Kubernetes Monitoring with Finout
  • User Guide
    • Inform
      • MegaBill
      • Custom Drilldown
      • Custom Cost Input
      • Virtual Tags
        • Relational Virtual Tags
      • Shared Cost Reallocation
        • How to Use Shared Cost Reallocation
      • FinOps Dashboards
      • Financial Plans
      • Data Explorer
    • Optimize
      • My Commitments
      • Commitments Log
      • Anomalies
      • CostGuard
        • CostGuard - Scans
        • Connect CostGuard for AWS
        • Connect CostGuard for GCP
    • Operate
      • Reports
      • Tag Governance
  • Configuration
    • Finout API
      • Generate an API Token
      • Filter Object Definition
      • Cost API
      • Query Language API
      • Virtual Tags API
      • CostGuard API
      • Endpoint API
      • Virtual Tag Metadata API
    • Role-Based Access Control (RBAC)
      • Role Permissions
      • Managing Roles
        • Creating a Custom Role
        • Permissions List
        • Managing a Role and its Permissions
      • Managing Users
        • Inviting a User
        • Edit a User's Roles
      • Data Access Control
      • Groups
        • Create a New Group
        • Edit Group Data Access
        • Delete a group
        • Edit Group Users and SAML Groups
      • RBAC FAQs
    • Endpoints
      • Slack Notification Endpoint
  • Common Features
    • List of Common Features
      • ACL Permissions
      • Saved Views
Powered by GitBook

Still need help? Please feel free to reach out to our team at support@finout.io.

On this page
  • GET/Views
  • POST /Query by view
Export as PDF
  1. Configuration
  2. Finout API

Cost API

PreviousFilter Object DefinitionNextQuery Language API

Last updated 1 month ago

Finout Cost API enables you to query and analyze costs using user-defined . 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

Prerequisites

  • from Finout to add in Headers.

  • You must create a view in the MegaBill before querying the GET view. There is currently no 'Create View' API option.

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"
}

400

Bad Request

401

Unauthorized

429

Too many requests

503

Server unavailable

504

Gateway Timeout

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

Prerequisites

  • You must first GET the view you want to query

  • Add the GET view ID to the body of the POST query. Example:

    ​{
    "viewId": "6244e453-e8b8-4f1f-9a96-4ba1ae5d48f7"
    }

  • You must either specify dates or delete them completely. The query won't work when blank dates are still present. Example:

    ​​{
         "viewId": "6244e453-e8b8-4f1f-9a96-4ba1ae5d48f7",
         "date": {
             "unixTimeMillSecondsStart": 1719824738,
             "unixTimeMillSecondsEnd": 1719911138
         },
         "costType": "netAmortizedCost"
       }

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

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"
}
{
  "data": [
    {
      "name": "Total",
      "data": [
        {
          "time": 1716768000000,
          "cost": 150
        },
        {
          "time": 1719100800000,
          "cost": 220
        }
      ]
    },
    {
      "name": "AmazonS3",
      "data": [
        {
          "time": 1716768000000,
          "cost": 50
        },
        {
          "time": 1719100800000,
          "cost": 20
        }
      ]
    },
    {
      "name": "AmazonEC2",
      "data": [
        {
          "time": 1716768000000,
          "cost": 100
        },
        {
          "time": 1719100800000,
          "cost"
        },
        {
          "time": 1719878400000,
          "cost": 0.04230358709842744
        }
            ]
        }
    ],
    "request": {
        "viewId": "b17c9716-31dc-4520-adf8-6d9cd7c00776",
        "date": {
            "unixTimeMillSecondsStart": 1719824738000,
            "unixTimeMillSecondsEnd": 1719911138000
        },
        "costType": "netAmortizedCost"
    },
    "requestId": "9a7a3d42-8215-43f1-8c6b-b66198ef4013"
}

400

Bad Request

401

Unauthorized

429

Too many requests

503

Server unavailable

504

Gateway Timeout

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

from Finout to add in Headers.

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

Finout Views
Finout Views.
Generate a Client ID and Secret Key
Finout Views
Generate a Client ID and Secret Key
Cost and Usage Types