# 「キーワード別広告トラフィック」タスクの設定

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/keywords_data/google_ads/ad_traffic_by_keywords/task_post`

**Tags:** DataForSEO

指定した `bid` と `match` タイプで `keywords` のクリック、インプレッション、支出の予測をキューに登録し、タスク `id` を返します。`search_partners` は Google のパートナーネットワークを含みます。DataForSEO のエンベロープに包まれます。データは `tasks[0].result`、結果は `tasks[0].status_code` に格納され、拒否されたリクエストでも HTTP 200 が返ります。ここで唯一ライブ版のない Google Ads エンドポイントです。予測は常にキュー経由になります。`get_dataforseo_keywords_gads_ad_traffic_fetch` で取得します。

### 料金の参考情報

- 計量方式：報告されたレスポンスコスト。
- 参考リクエスト見積もり：0.09 USD。
- 参照用の顧客乗数：1.0。確定済みの顧客金額に再適用しないでください。

参照用のメタデータのみであり、アカウントへの見積もり、保証された価格、支出上限ではありません。リソースクレジットは Felo クレジットではありません。最終的な請求は Felo の請求記録に従います。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "<em>キーワード</em><br><strong>必須フィールド</strong><br>指定できるキーワードの最大数：1000<br>各キーワードの最大文字数：80<br>各キーワードフレーズの最大語数：10<br>指定したキーワードは小文字形式に変換されます<br><strong>注意 1：</strong><a href=\"https://dataforseo.com/help-center/no-search-volume-data-for-some-keywords\" target=\"_blank\" rel=\"noopener noreferrer\">Google Ads は特定のキーワードグループについてデータを返さない場合があります</a>；<br><strong>注意 2：</strong><a href=\"https://dataforseo.com/help-center/sv-broad-exact-phrase-match\" target=\"_blank\" rel=\"noopener noreferrer\">Google Ads は類似したキーワードグループに対して合算された検索ボリューム値を提供します</a><br>類似キーワードの検索ボリュームを取得するには、それらのキーワードを個別のリクエストで送信することをお勧めします；<br><strong>注意 3：</strong>Google Ads では特定の記号や文字（UTF 記号、絵文字など）を使用できないため、タスクを設定するときにこれらを使用できません；<br>使用できる記号や文字の詳細については、<a href=\"https://dataforseo.com/help-center/using-symbols-in-keywords-when-setting-a-google-ads-task\" target=\"_blank\" rel=\"noopener noreferrer\">こちらの記事</a>を参照してください<p>DataForSEO API における <code>keyword</code> および <code>keywords</code> フィールドのルールと制限については、こちらの<a href=\"https://dataforseo.com/help-center/rules-and-limitations-of-keyword-and-keywords-fields-in-dataforseo-apis\" rel=\"noopener noreferrer\" target=\"_blank\">ヘルプセンター記事</a>を参照してください"
          },
          "bid": {
            "type": "number",
            "description": "<em>カスタム入札額の上限</em><br><strong>必須フィールド</strong><br>収集されるデータはこの値に基づきます<br>広告に対して支払ってもよい価格を表します。ここで指定する値が大きいほど、返される指標の値も大きくなります<br><a href=\"https://dataforseo.com/help-center/configuring-bid\">こちらのヘルプセンター記事</a>で詳しく確認できます"
          },
          "match": {
            "type": "string",
            "description": "<em>キーワードのマッチタイプ</em><br><strong>必須フィールド</strong><br>次の値を指定できます：<code>exact</code>、<code>broad</code>、<code>phrase</code>"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>検索エンジンのロケーションの正式名称</em><br>任意フィールド<br>ロケーションを指定しない場合、利用可能なすべてのロケーションを対象としたグローバルな結果が返されます；<br><strong>このフィールドを使用する場合、<code>location_code</code> または <code>location_coordinate</code> を指定する必要はありません</strong><br>別途 <code>https://api.dataforseo.com/v3/keywords_data/google_ads/locations</code> にリクエストを送信すると、検索エンジンの利用可能なロケーションとその <code>location_name</code> の一覧を取得できます<br>例：<br><code class=\"long-string\">London,England,United Kingdom</code>"
          },
          "location_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>検索エンジンのロケーションコード</em><br>任意フィールド<br>ロケーションを指定しない場合、利用可能なすべてのロケーションを対象としたグローバルな結果が返されます；<br><strong>このフィールドを使用する場合、<code>location_name</code> または <code>location_coordinate</code> を指定する必要はありません</strong>；<br>別途 <code>https://api.dataforseo.com/v3/keywords_data/google_ads/locations</code> にリクエストを送信すると、検索エンジンの利用可能なロケーションとその <code>location_code</code> の一覧を取得できます<br>例：<br><code class=\"long-string\">2840</code>"
          },
          "location_coordinate": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ロケーションの GPS 座標</em><br>任意フィールド<br>ロケーションを指定しない場合、利用可能なすべてのロケーションを対象としたグローバルな結果が返されます；<br><strong>このフィールドを使用する場合、<code>location_name</code> または <code>location_code</code> を指定する必要はありません</strong>；<br><code>location_coordinate</code> パラメーターは <em>\"latitude,longitude\"</em> 形式で指定する必要があります；<br><strong>指定した座標が属する国・地域のデータが提供されます</strong>；<br>例：<br><code class=\"long-string\">52.6178549,-155.352142</code>"
          },
          "language_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>検索エンジンの言語の正式名称</em><br>任意フィールド<br>別途 <code>https://api.dataforseo.com/v3/keywords_data/google_ads/languages</code> にリクエストを送信すると、検索エンジンの利用可能な言語とその <code>language_name</code> の一覧を取得できます<br>例：<br><code class=\"long-string\">English</code>"
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>検索エンジンの言語コード</em><br>任意フィールド<br>別途 <code>https://api.dataforseo.com/v3/keywords_data/google_ads/languages</code> にリクエストを送信すると、検索エンジンの利用可能な言語とその <code>language_code</code> の一覧を取得できます<br>例：<br><code class=\"long-string\">en</code>"
          },
          "date_from": {
            "type": "string",
            "description": "<em>予測期間の開始日</em><br><strong><code>date_to</code> を指定する場合は必須フィールド</strong><br><strong><code>date_from</code> と <code>date_to</code> を指定する場合、<code>date_interval</code> を指定する必要はありません</strong><br>最小値は明日の日付です<br><code>date_from</code> に指定する値は <code>date_to</code> より後にできません<br>日付形式：<code>\"yyyy-mm-dd\"</code><br>例：<br><code>\"2021-10-30\"</code><a href=\"/v3/keywords_data/google_ads/status/\" target=\"_blank\" rel=\"noopener noreferrer\">Status エンドポイント</a> が <code>actual_data</code> フィールドで <code>false</code> を返す場合、<code>date_from</code> は先々月以前に設定できます；<br><a href=\"/v3/keywords_data/google_ads/status/\" target=\"_blank\" rel=\"noopener noreferrer\">Status エンドポイント</a> が <code>actual_data</code> フィールドで <code>true</code> を返す場合、<code>date_from</code> は先月以前に設定できます"
          },
          "date_to": {
            "type": "string",
            "description": "<em>予測期間の終了日</em><br><strong><code>date_from</code> を指定する場合は必須フィールド</strong><br><strong><code>date_from</code> と <code>date_to</code> を指定する場合、<code>date_interval</code> を指定する必要はありません</strong><br>最小値は <code>date_from</code> +1 日です<br>最大値は翌年の同じ日付（現在の日付の月と日）です<br>日付形式：<code>\"yyyy-mm-dd\"</code><br>例：<br><code>\"2022-10-30\"</code>"
          },
          "date_interval": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>予測の日付間隔</em><br>任意フィールド<br><strong><code>date_interval</code> を指定する場合、<code>date_from</code> と <code>date_to</code> を指定する必要はありません</strong><br>指定可能な値：<code>next_week</code>、<code>next_month</code>、<code>next_quarter</code><br>デフォルト値：<code>next_month</code>"
          },
          "sort_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>結果の並べ替えパラメーター</em><br>任意フィールド<br>これらのパラメーターを使用して、<code>relevance</code>、<code>average_cpc</code>、<code>cost</code>、<code>clicks</code> で結果を降順に並べ替えられます<br>デフォルト値：<code>relevance</code>"
          },
          "postback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>タスク結果送信用の URL</em><br>任意フィールド<br>タスクが完了すると、結果を <code>gzip</code> 形式で圧縮し、指定した <code>postback_url</code> に POST リクエストを送信します<br>‘$id’ 文字列を <code>$id</code> 変数として、‘$tag’ を URL エンコードされた <code>$tag</code> 変数として使用できます。リクエストの送信前に必要な値を設定します。<br>例:<br><code>http://your-server.com/postbackscript?id=$id</code><br><code>http://your-server.com/postbackscript?id=$id&amp;tag=$tag</code><br><strong>注意:</strong> <code>postback_url</code> 内の特殊文字は URL エンコードされます<br>たとえば、<code>#</code> 文字は <code>%23</code> にエンコードされます<p>詳細については、<a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">ヘルプセンター</a>を参照してください"
          },
          "pingback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>タスク完了通知の URL</em><br>任意フィールド<br>タスクが完了すると、指定した URL に GET リクエストを送信して通知します<br>‘$id’ 文字列を <code>$id</code> 変数として、‘$tag’ を URL エンコードされた <code>$tag</code> 変数として使用できます。リクエストの送信前に必要な値を設定します。<br>例:<br><code>http://your-server.com/pingscript?id=$id</code><br><code>http://your-server.com/pingscript?id=$id&amp;tag=$tag</code><br><strong>注意:</strong> <code>pingback_url</code> 内の特殊文字は URL エンコードされます<br>たとえば、<code>#</code> 文字は <code>%23</code> にエンコードされます<p>詳細については、<a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">ヘルプセンター</a>を参照してください"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ユーザー定義のタスク識別子</em><br>任意フィールド<br><em>文字数上限は 255 です</em><br>このパラメーターを使ってタスクを識別し、結果と照合できます<br>指定した <code>tag</code> の値は、レスポンスの <code>data</code> オブジェクトに含まれます"
          }
        },
        "example": [
          {
            "language_code": "en",
            "location_code": 2840,
            "bid": 999,
            "match": "exact",
            "keywords": [
              "seo marketing"
            ]
          }
        ]
      }
    ]
  },
  "example": [
    {
      "language_code": "en",
      "location_code": 2840,
      "bid": 999,
      "match": "exact",
      "keywords": [
        "seo marketing"
      ]
    }
  ]
}
```

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — Felo サポートに問い合わせる際に伝えるリクエスト識別子。

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostResponseInfo"
    }
  ]
}
```

### 400 — リクエストを処理できませんでした。リクエストパラメータを確認してください。

### 401 — 有効な Felo API キーが必要です。

### 402 — 請求要件が満たされていないため、リクエストを続行できません。

### 403 — このアカウントにはこの操作を行う権限がありません。

### 429 — リクエストまたは支出の上限に達しました。

### 502 — サービスがリクエストを完了できませんでした。

### 503 — API または請求サービスが一時的に利用できません。

### 504 — リクエストの処理中にサービスがタイムアウトしました。

### default — エラーレスポンス。上流のパススルーレスポンスはプロバイダーの形式を使用する場合があります

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API の現在のバージョン"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "一般的なステータスコード\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "一般的な情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "合計実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 配列内のタスク数",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エラーで返された tasks 配列内のタスク数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスク識別子\n当社システム内で UUID 形式の一意のタスク識別子"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "タスクのステータスコード\nDataForSEO によって生成され、次の範囲の値になります: 10000-60000\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスクの情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 配列内の要素数",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL パス"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "POST リクエストで指定したものと同じパラメーターを含みます"
    }
  }
}
```

### Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostResponseInfo

`#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostTaskInfo"
              }
            ]
          },
          "description": "<em>タスクの配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostTaskInfo

`#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsAdTrafficByKeywordsTaskPostTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "object",
            "null"
          ],
          "description": "<em>結果の配列</em><br>この場合、値は <code>null</code> になります"
        }
      }
    }
  ]
}
```
