Getting price list files using the AWS Price List Bulk API - AWS Billing

Getting price list files using the AWS Price List Bulk API

Note

To provide feedback about AWS Price List, complete this short survey. Your responses will be anonymous. Note: This survey is in English only.

We recommend that you use the Price List Bulk API when you want to do the following tasks:

  • Consume large amounts of product and pricing information for AWS services.

  • Consume product and pricing information with a high throughput for an AWS service, such as processing in bulk.

Also, when the Price List Query API doesn't provide sufficient throughput and quotas for your use case, use the Price List Bulk API.

We recommend that you use the AWS Price List Bulk API to find and download price list files programmatically. To get the URL of the price list files, see the following steps.

If you don't want to use the AWS Price List Bulk API, you can download the price list files manually. For more information, see Getting price list files manually.

Use the DescribeServices API operation to find all available AWS services that the Price List Bulk API supports. This API operation returns the ServiceCode value from the list of services. You use this value later to find relevant price list files.

Example: Find available services

The following command shows how to find available AWS services.

aws pricing describe-services --region us-east-1

The AWS Region is the API endpoint for the Price List Bulk API. The endpoints aren't related to product or service attributes.

Response

{ "FormatVersion": "aws_v1", "NextToken": "abcdefg123", "Services": [ { "AttributeNames": [ "volumeType", "maxIopsvolume", "instanceCapacity10xlarge", "locationType", "operation" ], "ServiceCode": "AmazonEC2" }, { "AttributeNames": [ "productFamily", "volumeType", "engineCode", "memory" ], "ServiceCode": "AmazonRDS" }, {...} ] }

For more information about this API operation, see DescribeServices and language-specific AWS SDKs in the AWS Billing and Cost Management API Reference

Use the ListPriceLists API operation to get a list of price list references that you have permission to view. To filter your results, you can specify the ServiceCode, CurrencyCode, and EffectiveDate parameters.

The AWS Region is the API endpoint for the Price List Bulk API. The endpoints aren't related to product or service attributes.

Examples to find price list files

Example: Find price list files for all AWS Regions

If you don't specify the --region-code parameter, the API operation returns price list file references from all available AWS Regions.

aws pricing list-price-lists --service-code AmazonRDS --currency-code USD --effective-date "2023-04-03 00:00"

Response

{ "NextToken": "abcd1234", "PriceLists": [ { "CurrencyCode": "USD", "FileFormats": [ "json", "csv" ], "PriceListArn": "arn:aws:pricing:::price-list/aws/AmazonRDS/USD/20230328234721/us-east-1", "RegionCode": "us-east-1" }, { "CurrencyCode": "USD", "FileFormats": [ "json", "csv" ], "PriceListArn": "arn:aws:pricing:::price-list/aws/AmazonRDS/USD/20230328234721/us-west-2", "RegionCode": "us-west-2" }, ... ] }
Example: Find price list files for a specific Region

If you specify the RegionCode parameter, the API operation returns price list file references that are specific to that Region. To find historical price list files, use the EffectiveDate parameter. For example, you can specify a date in the past to find a specific price list file.

From the response, you can then use the PriceListArn value with the GetPriceListFileUrl API operation to get your preferred price list files.

aws pricing list-price-lists --service-code AmazonRDS --currency-code USD --region-code us-west-2 --effective-date "2023-04-03 00:00"

Response

{ "PriceLists": [ { "CurrencyCode": "USD", "FileFormats": [ "json", "csv" ], "PriceListArn": "arn:aws:pricing:::price-list/aws/AmazonRDS/USD/20230328234721/us-west-2", "RegionCode": "us-west-2" } ] }

For more information about this API operation, see ListPriceLists and language-specific AWS SDKs in the AWS Billing and Cost Management API Reference.

Use the GetPriceListFileUrl API operation to get a URL for a price list file. This URL is based on the PriceListArn and FileFormats values that you retrieved from the ListPriceLists response in step 1 and step 2

Example: Get a specific price list file

The following command gets the URL for a specific price list file for Amazon RDS.

aws pricing get-price-list-file-url --price-list-arn arn:aws:pricing:::price-list/aws/AmazonRDS/USD/20230328234721/us-east-1 --file-format json --region us-east-1

Response

{ "Url": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/20230328234721/us-east-1/index.json" }

From the response, you can use the URL to download the price list file.

For more information about this API operation, see the following topics: