

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Price List Bulk API を使用した AWS 料金表ファイルの取得
<a name="using-the-aws-price-list-bulk-api"></a>


|  | 
| --- |
| に関するフィードバックを提供するには AWS の料金表、この[簡単なアンケート](https://amazonmr.au1.qualtrics.com/jfe/form/SV_cO0deTMyKyFeezA)に回答してください。回答者は匿名になります。**注:** このアンケートは英語にのみ対応しています。 | 

以下のタスクを実行する場合は、Price List Bulk API を使用することをお勧めします。
+  AWS のサービスの製品情報や料金情報を大量に処理する。
+ 一括処理など、 AWS のサービスで高スループットで製品および料金情報を処理する。

また、Price List Query API ではユースケースに十分なスループットとクォータが得られない場合も、Price List Bulk API を使用します。<a name="using-the-aws-price-list-bulk-api-fetching-price-list-files"></a>

 AWS Price List Bulk API を使用して、プログラムで料金表ファイルを検索およびダウンロードすることをお勧めします。料金表ファイルの URL を取得するには、次の手順を参照してください。

 AWS Price List Bulk API を使用しない場合は、料金表ファイルを手動でダウンロードできます。詳細については、「[料金表ファイルの手動取得](using-the-aws-price-list-bulk-api-fetching-price-list-files-manually.md)」を参照してください。

### ステップ 1: 利用可能な検出結果 AWS のサービス
<a name="price-bulk-api-step-1-find-available-services"></a>

`DescribeServices` API オペレーションを使用して、Price List Bulk API がサポートする利用可能な AWS のサービス をすべて検索します。この API オペレーションは、サービスのリストから `ServiceCode` 値を返します。後でこの値を使用して、関連する料金表ファイルを検索します。

**Example 例: 利用可能なサービスの検索**  
次のコマンドは、利用可能な AWS のサービスの検索方法を示しています。  

```
aws pricing describe-services --region us-east-1
```
 AWS リージョン は Price List Bulk API の API エンドポイントです。エンドポイントは製品やサービスの属性とは関係ありません。  
**レスポンス**  

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

この API オペレーションの詳細については、 API *AWS Billing and Cost Management リファレンス*の[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)「」および[「言語固有の AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html#API_pricing_DescribeServices_SeeAlso)」を参照してください。

**注記**  
API は現在 Savings Plans `serviceCodes`に戻りませんが、後続の `DescribeServices` API コールで Savings Plans `serviceCodes` を使用するには以下が必要です。  


| ServiceCode | SavingsPlanCode | 
| --- | --- | 
| ComputeSavingsPlans | AWSComputeSavingsPlan | 
| MachineLearningSavingsPlans | AWSMachineLearningSavingsPlans | 
| DatabaseSavingsPlans | AWSDatabaseSavingsPlans | 
`ListPriceLists` および `GetPriceListFileUrl` API オペレーションを使用する場合は、 `ServiceCode`値を使用します。`SavingsPlanCode` は、 APIs を使用する代わりに料金表ファイルを手動でダウンロードする場合にのみ必要です。

### ステップ 2: 利用可能な の料金表ファイルを検索する AWS のサービス
<a name="price-list-bulk-api-step-2-find-available-price-list-files"></a>

`ListPriceLists` API オペレーションを使用して、表示権限のある料金表参照リストを取得します。結果を絞り込む場合は、`ServiceCode`、`CurrencyCode`、および `EffectiveDate` パラメータを指定します。

 AWS リージョン は Price List Bulk API の API エンドポイントです。エンドポイントは製品やサービスの属性とは関係ありません。

#### 料金表ファイルの検索例
<a name="price-list-bulk-api-examples-find-price-list-files"></a>

**Example 例: すべての の料金表ファイルを検索する AWS リージョン**  
`--region-code` パラメータを指定しない場合、API オペレーションは利用可能なすべての AWS リージョンから料金表ファイル参照を返します。  

```
aws pricing list-price-lists --service-code AmazonRDS --currency-code USD --effective-date "2023-04-03 00:00"
```
**レスポンス**  

```
{
   "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 例: 特定リージョンの料金表ファイルを検索する**  
`RegionCode` パラメータを指定すると、API オペレーションは、そのリージョンのみの料金表ファイル参照を返します。過去の料金表ファイルを検索するには、`EffectiveDate` パラメータを使用します。例えば、過去の日付を指定して特定の料金表ファイルを検索できます。  
レスポンスから得た `PriceListArn` 値を [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 オペレーションで使用して、目的の料金表ファイルを取得できます。  

```
aws pricing list-price-lists --service-code AmazonRDS --currency-code USD --region-code us-west-2 --effective-date "2023-04-03 00:00"
```
**レスポンス**  

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

この API オペレーションの詳細については、 API *AWS Billing and Cost Management リファレンス*の[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)「」および[「言語固有の AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html#API_pricing_ListPriceLists_SeeAlso)」を参照してください。

### ステップ 3: 特定の料金表ファイルの取得
<a name="price-list-bulk-api-step-3-getting-specific-price-list"></a>

`GetPriceListFileUrl` API オペレーションを使用して、料金表ファイルの URL を取得します。この URL は、[ステップ 1](#price-bulk-api-step-1-find-available-services) と[ステップ 2](#price-list-bulk-api-step-2-find-available-price-list-files) の `ListPriceLists` レスポンスから取得した `PriceListArn` と `FileFormats` の値に基づいています。

**Example 例: 特定の料金表ファイルを取得する**  
次のコマンドは、Amazon RDS の特定の料金表ファイルの URL を取得します。  

```
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
```
**レスポンス**  

```
{
    "Url": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonRDS/20230328234721/us-east-1/index.json"
}
```
レスポンスから取得した URL を使用して料金表ファイルをダウンロードできます。

この API オペレーションの詳細については、次のトピックを参照してください。
+  [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) *AWS Billing and Cost Management API* [リファレンスの および言語固有の AWS SDKs](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html#API_pricing_GetPriceListFileUrl_SeeAlso) 
+ [料金表ファイルの読み取り](bulk-api-reading-price-list-files.md)