Getting price list files using the Amazon Price List Bulk API - Amazon Billing
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Getting price list files using the Amazon Price List Bulk API

To provide feedback about Amazon 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 Amazon Web Services.

  • Consume product and pricing information with a high throughput for an Amazon Web 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 Amazon 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 Amazon 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 Amazon Web 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 Amazon Web Services.

aws pricing describe-services --region cn-northwest-1

The Amazon Web Services 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 Amazon SDKs in the Amazon 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 Amazon Web Services 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 Amazon Web Services Regions

If you don't specify the --region-code parameter, the API operation returns price list file references from all available Amazon Web Services 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:cn:pricing:::price-list/cn/AmazonRDS/USD/20230328234721/cn-northwest-1", "RegionCode": "cn-northwest-1" }, { "CurrencyCode": "USD", "FileFormats": [ "json", "csv" ], "PriceListArn": "arn:cn:pricing:::price-list/cn/AmazonRDS/USD/20230328234721/cn-northwest-1", "RegionCode": "cn-northwest-1" }, ... ] }
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 cn-northwest-1 --effective-date "2023-04-03 00:00"

Response

{ "PriceLists": [ { "CurrencyCode": "USD", "FileFormats": [ "json", "csv" ], "PriceListArn": "arn:cn:pricing:::price-list/cn/AmazonRDS/USD/20230328234721/cn-northwest-1", "RegionCode": "cn-northwest-1" } ] }

For more information about this API operation, see ListPriceLists and language-specific Amazon SDKs in the Amazon 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:cn:pricing:::price-list/cn/AmazonRDS/USD/20230328234721/cn-northwest-1 --file-format json --region cn-northwest-1

Response

{ "Url": "https://pricing.cn-northwest-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/20230328234721/cn-northwest-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: