

 Amazon Forecast は新規顧客には利用できなくなりました。Amazon Forecast の既存のお客様は、通常どおりサービスを引き続き使用できます。[詳細はこちら](https://aws.amazon.com/blogs/machine-learning/transition-your-amazon-forecast-usage-to-amazon-sagemaker-canvas/)

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

# Amazon Forecast クエリサービス
<a name="API_Operations_Amazon_Forecast_Query_Service"></a>

次のアクションは、Amazon Forecast Query Service でサポートされています:
+  [QueryForecast](API_forecastquery_QueryForecast.md) 
+  [QueryWhatIfForecast](API_forecastquery_QueryWhatIfForecast.md) 

# QueryForecast
<a name="API_forecastquery_QueryForecast"></a>

指定された基準でフィルタリングされた、単一の項目の予測を取得します。

基準は、キーバリューペアです。キーは、`TARGET_TIME_SERIES` データセットからの `item_id` (もしくは同等の非タイムスタンプ、非ターゲットフィールド)、または `FeaturizationConfig` オブジェクトの一部として指定された予測ディメンションの 1 つです。

デフォルトでは、`QueryForecast` は、フィルタリングされた予測の完全な日付範囲を返します。特定の日付範囲をリクエストできます。

完全な予測を取得するには、[CreateForecastExportJob](https://docs.aws.amazon.com/en_us/forecast/latest/dg/API_CreateForecastExportJob.html) オペレーションを使用します。

**注記**  
Amazon Forecast によって生成された予測は、予測子の作成に使用されたデータセットと同じタイムゾーンにあります。

## リクエストの構文
<a name="API_forecastquery_QueryForecast_RequestSyntax"></a>

```
{
   "EndDate": "string",
   "Filters": { 
      "string" : "string" 
   },
   "ForecastArn": "string",
   "NextToken": "string",
   "StartDate": "string"
}
```

## リクエストパラメーター
<a name="API_forecastquery_QueryForecast_RequestParameters"></a>

リクエストは以下のデータを JSON 形式で受け入れます。

 ** [EndDate](#API_forecastquery_QueryForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryForecast-request-EndDate"></a>
予測の終了日。次の形式を使用して日付を指定します: yyyy-MM-dd'T'HH:mm:ss (ISO 8601 の形式)。例: 2015-01-01T20:00:00。  
タイプ: 文字列  
必須: いいえ

 ** [Filters](#API_forecastquery_QueryForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryForecast-request-Filters"></a>
予測の取得時に適用するフィルター条件。例えば、電力使用量データセットの `client_21` についての予測を取得するには、次のように指定します。  
 `{"item_id" : "client_21"}`   
完全な予測を取得するには、[CreateForecastExportJob](https://docs.aws.amazon.com/en_us/forecast/latest/dg/API_CreateForecastExportJob.html) オペレーションを使用します。  
タイプ: 文字列間のマッピング  
マップエントリ: 項目の最大数は 50 です。  
キーの長さの制限: 最大長は 256 です。  
キーパターン: `^[a-zA-Z0-9\_\-]+$`   
値の長さの制限: 最大長は 256 です。  
必須: はい

 ** [ForecastArn](#API_forecastquery_QueryForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryForecast-request-ForecastArn"></a>
クエリする予測の Amazon リソースネーム (ARN)。  
タイプ: 文字列  
長さの制約: 最大長は 256 です。  
パターン: `arn:([a-z\d-]+):forecast:.*:.*:.+`   
必須: はい

 ** [NextToken](#API_forecastquery_QueryForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryForecast-request-NextToken"></a>
前のリクエストの結果が切り捨てられた場合、レスポンスには `NextToken` が含まれます。次の結果セットを取得するには、次のリクエストでトークンを使用します。トークンの有効期間は 24 時間です。  
タイプ: 文字列  
長さの制約: 最小長は 1 です。最大長は 3000 です。  
必須: いいえ

 ** [StartDate](#API_forecastquery_QueryForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryForecast-request-StartDate"></a>
予測の開始日。次の形式を使用して日付を指定します: yyyy-MM-dd'T'HH:mm:ss (ISO 8601 の形式)。例: 2015-01-01T08:00:00。  
タイプ: 文字列  
必須: いいえ

## レスポンスの構文
<a name="API_forecastquery_QueryForecast_ResponseSyntax"></a>

```
{
   "Forecast": { 
      "Predictions": { 
         "string" : [ 
            { 
               "Timestamp": "string",
               "Value": number
            }
         ]
      }
   }
}
```

## レスポンス要素
<a name="API_forecastquery_QueryForecast_ResponseElements"></a>

アクションが成功すると、サービスは HTTP 200 レスポンスを返します。

サービスから以下のデータが JSON 形式で返されます。

 ** [Forecast](#API_forecastquery_QueryForecast_ResponseSyntax) **   <a name="forecast-forecastquery_QueryForecast-response-Forecast"></a>
予測。  
型: [Forecast](API_forecastquery_Forecast.md) オブジェクト

## エラー
<a name="API_forecastquery_QueryForecast_Errors"></a>

 ** InvalidInputException **   
値が無効であるか、長すぎます。  
HTTP ステータスコード: 400

 ** InvalidNextTokenException **   
トークンが無効です。トークンの有効期間は 24 時間です。  
HTTP ステータスコード: 400

 ** LimitExceededException **   
1 秒あたりのリクエスト数の上限を超えています。  
HTTP ステータスコード: 400

 ** ResourceInUseException **   
指定されたリソースは使用中です。  
HTTP ステータスコード: 400

 ** ResourceNotFoundException **   
そのリソースを見つけることができません。入力した情報を確認して、再試行してください。  
HTTP ステータスコード: 400

## 以下の資料も参照してください。
<a name="API_forecastquery_QueryForecast_SeeAlso"></a>

言語固有の AWS SDKs のいずれかでこの API を使用する方法の詳細については、以下を参照してください。
+  [AWS コマンドラインインターフェイス V2](https://docs.aws.amazon.com/goto/cli2/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/forecastquery-2018-06-26/QueryForecast) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/forecastquery-2018-06-26/QueryForecast) 

# QueryWhatIfForecast
<a name="API_forecastquery_QueryWhatIfForecast"></a>

What-If 予想を取得します。

## リクエストの構文
<a name="API_forecastquery_QueryWhatIfForecast_RequestSyntax"></a>

```
{
   "EndDate": "string",
   "Filters": { 
      "string" : "string" 
   },
   "NextToken": "string",
   "StartDate": "string",
   "WhatIfForecastArn": "string"
}
```

## リクエストパラメーター
<a name="API_forecastquery_QueryWhatIfForecast_RequestParameters"></a>

リクエストは以下のデータを JSON 形式で受け入れます。

 ** [EndDate](#API_forecastquery_QueryWhatIfForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-request-EndDate"></a>
What-If 予想の終了日。次の形式を使用して日付を指定します: yyyy-MM-dd'T'HH:mm:ss (ISO 8601 の形式)。例: 2015-01-01T20:00:00。  
タイプ: 文字列  
必須: いいえ

 ** [Filters](#API_forecastquery_QueryWhatIfForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-request-Filters"></a>
予測の取得時に適用するフィルター条件。例えば、電力使用量データセットの `client_21` についての予測を取得するには、次のように指定します。  
 `{"item_id" : "client_21"}`   
完全な What-If 予想を取得するには、[CreateForecastExportJob](https://docs.aws.amazon.com/en_us/forecast/latest/dg/API_CreateWhatIfForecastExport.html) オペレーションを使用します。  
タイプ: 文字列間のマッピング  
マップエントリ: 項目の最大数は 50 です。  
キーの長さの制限: 最大長は 256 です。  
キーパターン: `^[a-zA-Z0-9\_\-]+$`   
値の長さの制限: 最大長は 256 です。  
必須: はい

 ** [NextToken](#API_forecastquery_QueryWhatIfForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-request-NextToken"></a>
前のリクエストの結果が切り捨てられた場合、レスポンスには `NextToken` が含まれます。次の結果セットを取得するには、次のリクエストでトークンを使用します。トークンの有効期間は 24 時間です。  
タイプ: 文字列  
長さの制約: 最小長は 1 です。最大長は 3000 です。  
必須: いいえ

 ** [StartDate](#API_forecastquery_QueryWhatIfForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-request-StartDate"></a>
What-If 予想の開始日。次の形式を使用して日付を指定します: yyyy-MM-dd'T'HH:mm:ss (ISO 8601 の形式)。例: 2015-01-01T08:00:00。  
タイプ: 文字列  
必須: いいえ

 ** [WhatIfForecastArn](#API_forecastquery_QueryWhatIfForecast_RequestSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-request-WhatIfForecastArn"></a>
クエリする What-If 予想の Amazon リソースネーム (ARN)。  
タイプ: 文字列  
長さの制限: 最大長は 300 です。  
パターン: `arn:([a-z\d-]+):forecast:.*:.*:.+`   
必須: はい

## レスポンスの構文
<a name="API_forecastquery_QueryWhatIfForecast_ResponseSyntax"></a>

```
{
   "Forecast": { 
      "Predictions": { 
         "string" : [ 
            { 
               "Timestamp": "string",
               "Value": number
            }
         ]
      }
   }
}
```

## レスポンス要素
<a name="API_forecastquery_QueryWhatIfForecast_ResponseElements"></a>

アクションが成功すると、サービスは HTTP 200 レスポンスを返します。

サービスから以下のデータが JSON 形式で返されます。

 ** [Forecast](#API_forecastquery_QueryWhatIfForecast_ResponseSyntax) **   <a name="forecast-forecastquery_QueryWhatIfForecast-response-Forecast"></a>
予測に関する情報を提供します。[QueryForecast](API_forecastquery_QueryForecast.md) レスポンスの一部として返されます。  
型: [Forecast](API_forecastquery_Forecast.md) オブジェクト

## エラー
<a name="API_forecastquery_QueryWhatIfForecast_Errors"></a>

 ** InvalidInputException **   
値が無効であるか、長すぎます。  
HTTP ステータスコード: 400

 ** InvalidNextTokenException **   
トークンが無効です。トークンの有効期間は 24 時間です。  
HTTP ステータスコード: 400

 ** LimitExceededException **   
1 秒あたりのリクエスト数の上限を超えています。  
HTTP ステータスコード: 400

 ** ResourceInUseException **   
指定されたリソースは使用中です。  
HTTP ステータスコード: 400

 ** ResourceNotFoundException **   
そのリソースを見つけることができません。入力した情報を確認して、再試行してください。  
HTTP ステータスコード: 400

## 以下の資料も参照してください。
<a name="API_forecastquery_QueryWhatIfForecast_SeeAlso"></a>

言語固有の AWS SDKs のいずれかでこの API を使用する方法の詳細については、以下を参照してください。
+  [AWS コマンドラインインターフェイス V2](https://docs.aws.amazon.com/goto/cli2/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/forecastquery-2018-06-26/QueryWhatIfForecast) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/forecastquery-2018-06-26/QueryWhatIfForecast) 