# Google Ads 検索 SERP タスクの設定

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/serp/google/ads_search/task_post`

**Tags:** DataForSEO

Google でキーワードに対して配信されている広告をキューに登録し、`tasks[0].id` でタスク `id` を返します。DataForSEO のエンベロープに包まれます。データは `tasks[0].result`、結果は `tasks[0].status_code` に格納され、拒否されたリクエストでも HTTP 200 が返ります。ライブ版は即座に応答するため、単一のクエリにはこちらの方が簡単です。バッチが 1 回のツール呼び出しより長引く場合はキューを使用してください。

### 料金の参考情報

- 計測方法：報告されたレスポンスコスト。
- 参考リクエスト見積もり：0.02 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": {
          "advertiser_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "<p><em>広告主識別子</em><p><strong><code>target</code> を指定しない場合は必須フィールド</strong></p><br><p>この配列には最大 25 個の値を指定できます。<p>このパラメータの <code>advertiser_ids</code> の値は、<a href=\"http://docs.dataforseo.com/v3/serp/google/ads_advertisers/task_get/advanced/\" rel=\"noopener noreferrer\" target=\"_blank\">Google Ads Advertisers</a> エンドポイントで確認できます。</p>"
          },
          "target": {
            "type": "string",
            "description": "<p><em>ドメイン名</em><p><strong><code>advertiser_ids</code> を指定しない場合は必須フィールド</strong><p>広告主アカウントに関連付けられたドメイン名</p>"
          },
          "location_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>検索エンジンのロケーションコード</em><p>任意フィールド<p><strong>このフィールドを使用する場合、<code>location_name</code> または <code>location_coordinate</code> を指定する必要はありません</strong><p><code>https://api.dataforseo.com/v3/serp/google/ads_search/locations</code> に個別にリクエストすると、検索エンジンで利用可能なロケーションとその <code>location_code</code> の一覧を取得できます<p>例：<p><code class=\"long-string\">2840</code></p><br><p><strong>注意：</strong><code>location_name</code>、<code>location_code</code>、<code>location_coordinate</code> を指定しない場合、広告は利用可能なすべてのロケーションで検索されます</p>"
          },
          "depth": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>解析の深さ</em><p>任意フィールド<p>SERP の結果数<p>デフォルト値：<code>40</code><p>最大値：<code>700</code></p><br><strong>アカウントは、最大 40 件の結果を含む SERP ごとに課金されます。</strong><p>深さを 40 より大きく設定すると、<a href=\"https://dataforseo.com/help-center/how-many-results-scraped\" rel=\"noopener noreferrer\" target=\"_blank\">検索エンジンが 40 件を超える結果を返した場合</a>に追加料金が発生することがあります。<p>コストは<a title=\"Pricing\" href=\"https://dataforseo.com/pricing/serp/google-ads-search-serp-api\" target=\"_blank\" rel=\"noopener noreferrer\">料金</a>ページで計算できます。"
          },
          "priority": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<p><em>タスクの優先度</em><p>任意フィールド<p>次の値を指定できます：<p>1 – 通常の実行優先度（デフォルトで設定）<p>2 – 高い実行優先度</p><br>実行優先度の高いタスクには追加料金が発生します。<p>コストは<a title=\"Pricing\" href=\"https://dataforseo.com/pricing/serp/google-ads-search-serp-api\" target=\"_blank\" rel=\"noopener noreferrer\">料金</a>ページで計算できます。"
          },
          "pingback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>完了したタスクの通知 URL</em><p>任意フィールド<p>タスクが完了すると、指定した URL に GET リクエストを送信して通知します<p>‘$id’ 文字列を <code>$id</code> 変数として、‘$tag’ を URL エンコードされた <code>$tag</code> 変数として使用できます。リクエストを送信する前に必要な値を設定します。<p>例：<p><code>http://your-server.com/pingscript?id=$id</code><p><code>http://your-server.com/pingscript?id=$id&amp;tag=$tag</code><p><strong>注意：</strong><code>pingback_url</code> の特殊文字は URL エンコードされます；<p>たとえば、<code>#</code> 文字は <code>%23</code> にエンコードされます</p><br><p>詳細は<a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">ヘルプセンター</a>をご覧ください</p>"
          },
          "postback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>タスク結果送信用の URL</em><p>任意フィールド<p>タスクが完了すると、結果を <code>gzip</code> 形式で圧縮し、指定した <code>postback_url</code> に POST リクエストを送信します<p>‘$id’ 文字列を <code>$id</code> 変数として、‘$tag’ を URL エンコードされた <code>$tag</code> 変数として使用できます。リクエストの送信前に必要な値を設定します。<p>例:<p><code>http://your-server.com/postbackscript?id=$id</code><p><code>http://your-server.com/postbackscript?id=$id&amp;tag=$tag</code><p><strong>注意:</strong> <code>postback_url</code> 内の特殊文字は URL エンコードされます<p>たとえば、<code>#</code> 文字は <code>%23</code> にエンコードされます</p><br><p>詳細については、<a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">ヘルプセンター</a>を参照してください</p>"
          },
          "postback_data": {
            "type": "string",
            "description": "<p><em>postback_url のデータ型</em><p><strong><code>postback_url</code> を指定する場合は必須フィールド</strong><p>タスクの設定に使用した関数に対応します<p>指定可能な値：<p><code>advanced</code></p>"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>検索エンジンのロケーションの正式名</em><p>任意フィールド<p><strong>このフィールドを使用する場合、<code>location_code</code> または <code>location_coordinate</code> を指定する必要はありません</strong><p><code>https://api.dataforseo.com/v3/serp/google/ads_search/locations</code> に個別にリクエストすると、検索エンジンで利用可能なロケーションとその <code>location_name</code> の一覧を取得できます<p>例：<p><code class=\"long-string\">London,England,United Kingdom</code></p><br><p><strong>注意：</strong><code>location_name</code>、<code>location_code</code>、<code>location_coordinate</code> を指定しない場合、広告は利用可能なすべてのロケーションで検索されます</p>"
          },
          "location_coordinate": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>ロケーションの GPS 座標</em><p>任意フィールド<p><strong>このフィールドを使用する場合、<code>location_name</code> または <code>location_code</code> を指定する必要はありません</strong><p>例：<p><code class=\"long-string\">52.6178549,-155.352142</code></p><br><p><strong>注意：</strong><code>location_name</code>、<code>location_code</code>、<code>location_coordinate</code> を指定しない場合、広告は利用可能なすべてのロケーションで検索されます</p>"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>ユーザー定義のタスク識別子</em><p>任意フィールド<p><em>文字数上限は 255 です</em><p>このパラメータを使ってタスクを識別し、結果と照合できます<p>指定した <code>tag</code> の値は、レスポンスの <code>data</code> オブジェクトに含まれます</p>"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>広告プラットフォーム</em><p>任意フィールド<p>使用可能な値：<code>all</code>、<code>google_play</code>、<code>google_maps</code>、<code>google_search</code>、<code>google_shopping</code>、<code>youtube</code><p>デフォルト値：<code>all</code></p>"
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "<p><em>広告フォーマット</em><p>任意フィールド<p>使用可能な値：<code>all</code>、<code>text</code>、<code>image</code>、<code>video</code></p>"
          },
          "date_from": {
            "type": "string",
            "description": "<p><em>時間範囲の開始日</em><p>任意フィールド<p><code>date_to</code> を指定する場合は必須フィールドです。 </p><br><p>日付形式：<code>\"yyyy-mm-dd\"</code><p>最小値：2018-05-31<p>最大値：今日の日付<p>例：<p><code>\"2020-01-01\"</code></p>"
          },
          "date_to": {
            "type": "string",
            "description": "<p><em>時間範囲の終了日</em><p>任意フィールド<p><code>date_from</code> を指定する場合は必須フィールドです。 </p><br><p>日付形式：<code>\"yyyy-mm-dd\"</code><p>最小値：2018-05-31<p>最大値：今日の日付<p>例：<p><code>\"2020-01-01\"</code></p>"
          }
        },
        "example": [
          {
            "location_code": 2840,
            "platform": "google_search",
            "advertiser_ids": [
              "AR13752565271262920705",
              "AR02439908557932462081"
            ]
          }
        ]
      }
    ]
  },
  "example": [
    {
      "location_code": 2840,
      "platform": "google_search",
      "advertiser_ids": [
        "AR13752565271262920705",
        "AR02439908557932462081"
      ]
    }
  ]
}
```

## Responses

### 200 — 操作成功

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

**application/json**

Schema: object | null

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

### 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_SerpGoogleAdsSearchTaskPostResponseInfo

`#/components/schemas/Response36Afe1097B20_SerpGoogleAdsSearchTaskPostResponseInfo`

```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_SerpGoogleAdsSearchTaskPostTaskInfo"
              }
            ]
          },
          "description": "<em>タスクの配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_SerpGoogleAdsSearchTaskPostTaskInfo

`#/components/schemas/Response36Afe1097B20_SerpGoogleAdsSearchTaskPostTaskInfo`

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