

# Getting price list files using the AWS Price List Bulk API
<a name="using-the-aws-price-list-bulk-api"></a>


|  | 
| --- |
| To provide feedback about AWS Price List, complete this [short survey](https://amazonmr.au1.qualtrics.com/jfe/form/SV_cO0deTMyKyFeezA). 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.<a name="using-the-aws-price-list-bulk-api-fetching-price-list-files"></a>

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](using-the-aws-price-list-bulk-api-fetching-price-list-files-manually.md).

### Step 1: Finding available AWS services
<a name="price-bulk-api-step-1-find-available-services"></a>

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 [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html) and [language-specific AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html#API_pricing_DescribeServices_SeeAlso) in the *AWS Billing and Cost Management API Reference*

**Note**  
While the `DescribeServices` API currently doesn't return `serviceCodes` for Savings Plans, you will need the following `serviceCodes` to use Savings Plans in subsequent API calls:  


| ServiceCode | SavingsPlanCode | 
| --- | --- | 
| ComputeSavingsPlans | AWSComputeSavingsPlan | 
| MachineLearningSavingsPlans | AWSMachineLearningSavingsPlans | 
| DatabaseSavingsPlans | AWSDatabaseSavingsPlans | 
Use the `ServiceCode` values when working with the `ListPriceLists` and `GetPriceListFileUrl` API operations. The `SavingsPlanCode` is only needed if you are downloading price list files manually instead of using the APIs.

### Step 2: Finding price list files for an available AWS service
<a name="price-list-bulk-api-step-2-find-available-price-list-files"></a>

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
<a name="price-list-bulk-api-examples-find-price-list-files"></a>

**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 [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html) 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 [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html) and [language-specific AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html#API_pricing_ListPriceLists_SeeAlso) in the *AWS Billing and Cost Management API Reference*.

### Step 3: Getting a specific price list file
<a name="price-list-bulk-api-step-3-getting-specific-price-list"></a>

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](#price-bulk-api-step-1-find-available-services) and [step 2](#price-list-bulk-api-step-2-find-available-price-list-files) 

**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:
+  [https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html) and [language-specific AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html#API_pricing_GetPriceListFileUrl_SeeAlso) in the *AWS Billing and Cost Management API Reference*
+ [Reading the price list files](bulk-api-reading-price-list-files.md)