4min

Billing Data

CloudGraph wraps the AWS Cost Explorer API using GraphQL and extends its functionality to make querying your AWS billing data easy. In order to successfully ingest billing-related data, you must have the Cost Explorer API enabled in your AWS Account. You can view how to do that here. Let's take a look at a few examples of how to use the CloudGraph billing API.

Get the total cost of your AWS Account for the last 30 days, the total cost of your AWS Account month to date, a breakdown of each service and its cost for the last 30 days, and a breakdown of each service and its cost month to date as well as the monthly and month to date average costs:

GraphQL
|

This query will return a JSON payload that looks like this:

JSON
|



Get each EC2 instance in your AWS account along with its daily cost:

GraphQL
|



This query will return a JSON payload that looks like this. All of the following examples will follow suit:

JSON
|



Get each NAT Gateway in your AWS account along with its daily cost:

GraphQL
|







Updated 07 Feb 2022
Did this page help?
Yes
No