The Cloud Pricing API is a GraphQL-based API that includes all public prices from AWS, Azure and Google; it contains over 3 million prices! The prices

infracost / cloud-pricing-api

submited by
Style Pass
2021-08-25 14:30:05

The Cloud Pricing API is a GraphQL-based API that includes all public prices from AWS, Azure and Google; it contains over 3 million prices! The prices are automatically updated via a weekly job. This API is used by the Infracost CLI, thus you do not need to interact with it directly, however, you can also use it independently.

If you'd like to use the API independently, pass the above API key using the X-Api-Key: xxxx HTTP header when calling https://pricing.api.infracost.io/graphql. The following example curl fetches the latest price for an AWS EC2 m3.large instance in us-east-1. More examples can be found in ./examples/queries.

The GraphQL Playground can also be used with something like the modheader browser extension so you can set the custom HTTP header X-Api-Key to your Infracost API key.

The pricing DB dump is downloaded from Infracost's API as that simplifies the task of keeping prices up-to-date. We have created one job that you can run once a week to download the latest prices. This provides you with:

Leave a Comment
Related Posts