AWS API to get free tier amount for each service

106 Views Asked by At

Is there an AWS API to get free tier amount for each service?

I'm using the AWS Cost Explorer API to get usage of each AWS service.

GetCostAndUsage API: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetCostAndUsage.html

But this API return all usage, including free tier amount.

I need to subtract the free tier amount, but didn't find any filter or another API that return this information.

Is there an API for that?

What I need is basically the free tier information shown in this page: https://aws.amazon.com/free

But provided in an API, with JSON format.

My current Cost Explorer API request is like that:

{
    "TimePeriod": {
        "Start": startDate,
        "End": endDate
    },
    "Granularity": "MONTHLY",
    "GroupBy":[
        {
            "Type":"DIMENSION",
            "Key":"SERVICE"
        },
        {
            "Type":"DIMENSION",
            "Key":"USAGE_TYPE"
        }
    ],
    "Metrics": ["UsageQuantity"]
}
0

There are 0 best solutions below