# Setting ‘Ad Traffic By Keywords’ Tasks

**API:** Data API

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

**Tags:** DataForSEO

Queues a forecast of clicks, impressions and spend for `keywords` at a given `bid` and `match` type, returning a task `id`. `search_partners` includes Google's partner network. Wrapped in DataForSEO's envelope: data in `tasks[0].result`, outcome in `tasks[0].status_code` - a rejected request still returns HTTP 200. This is the only Google Ads endpoint here with no live variant - forecasting always queues. Retrieve with `get_dataforseo_keywords_gads_ad_traffic_fetch`.

### Pricing reference

- Metering: Reported response cost.
- Reference request estimate: USD 0.09.
- Reference customer multiplier: 1.0. Do not apply it again to a settled customer amount.

Reference metadata only, not an account quote, a guaranteed price or a spending cap. Resource credits are not Felo credits. Final charges follow Felo billing records.

## 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>keywords</em><br><strong>required field</strong><br>The maximum number of keywords you can specify: 1000<br>The maximum number of characters for each keyword: 80<br>The maximum number of words for each keyword phrase: 10<br>the keywords you specify will be converted to a lowercase format<br><strong>Note #1:</strong> <a href=\"https://dataforseo.com/help-center/no-search-volume-data-for-some-keywords\" target=\"_blank\" rel=\"noopener noreferrer\">Google Ads may return no data for certain groups of keywords</a>;<br><strong>Note #2:</strong> <a href=\"https://dataforseo.com/help-center/sv-broad-exact-phrase-match\" target=\"_blank\" rel=\"noopener noreferrer\">Google Ads provides combined search volume values for groups of similar keywords</a><br>to obtain search volume for similar keywords, we recommend submitting such keywords in separate requests;<br><strong>Note #3:</strong> Google Ads doesn't allow using certain symbols and characters (e.g., UTF symbols, emojis), so you can't use them when setting a task;<br>to learn more about which symbols and characters can be used, please refer to <a href=\"https://dataforseo.com/help-center/using-symbols-in-keywords-when-setting-a-google-ads-task\" target=\"_blank\" rel=\"noopener noreferrer\">this article</a><p>learn more about rules and limitations of <code>keyword</code> and <code>keywords</code> fields in DataForSEO APIs in this <a href=\"https://dataforseo.com/help-center/rules-and-limitations-of-keyword-and-keywords-fields-in-dataforseo-apis\" rel=\"noopener noreferrer\" target=\"_blank\">Help Center article</a>"
          },
          "bid": {
            "type": "number",
            "description": "<em>the maximum custom bid</em><br><strong>required field</strong><br>the collected data will be based on this value<br>it stands for the price you are willing to pay for an ad; the higher value you specify here, the higher values you will get in the returned metrics<br>learn more in <a href=\"https://dataforseo.com/help-center/configuring-bid\">this help center article</a>"
          },
          "match": {
            "type": "string",
            "description": "<em>keywords match-type</em><br><strong>required field</strong><br>can take the following values: <code>exact</code>, <code>broad</code>, <code>phrase</code>"
          },
          "location_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>full name of search engine location</em><br>optional field<br>if you do not indicate the location, you will receive worldwide results, i.e., for all available locations;<br><strong>if you use this field, you don't need to specify <code>location_code</code> or <code>location_coordinate</code></strong><br>you can receive the list of available locations of the search engine with their <code>location_name</code> by making a separate request to <code>https://api.dataforseo.com/v3/keywords_data/google_ads/locations</code><br>example:<br><code class=\"long-string\">London,England,United Kingdom</code>"
          },
          "location_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>search engine location code</em><br>optional field<br>if you do not indicate the location, you will receive worldwide results, i.e., for all available locations;<br><strong>if you use this field, you don't need to specify <code>location_name</code> or <code>location_coordinate</code></strong>;<br>you can receive the list of available locations of the search engines with their <code>location_code</code> by making a separate request to <code>https://api.dataforseo.com/v3/keywords_data/google_ads/locations</code><br>example:<br><code class=\"long-string\">2840</code>"
          },
          "location_coordinate": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>GPS coordinates of a location</em><br>optional field<br>if you do not indicate the location, you will receive worldwide results, i.e., for all available locations;<br><strong>if you use this field, you don't need to specify <code>location_name</code> or <code>location_code</code></strong>;<br><code>location_coordinate</code> parameter should be specified in the <em>\"latitude,longitude\"</em> format;<br><strong>the data will be provided for the country the specified coordinates belong to</strong>;<br>example:<br><code class=\"long-string\">52.6178549,-155.352142</code>"
          },
          "language_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>full name of search engine language</em><br>optional field<br>you can receive the list of available languages of the search engine with their <code>language_name</code> by making a separate request to <code>https://api.dataforseo.com/v3/keywords_data/google_ads/languages</code><br>example:<br><code class=\"long-string\">English</code>"
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>search engine language code</em><br>optional field<br>you can receive the list of available languages of the search engine with their <code>language_code</code> by making a separate request to <code>https://api.dataforseo.com/v3/keywords_data/google_ads/languages</code><br>example:<br><code class=\"long-string\">en</code>"
          },
          "date_from": {
            "type": "string",
            "description": "<em>starting date of the forecasting time range</em><br>required field if you specify <code>date_to</code><br><strong>if you indicate <code>date_from</code> and <code>date_to</code>, you don't need to specify <code>date_interval</code></strong><br>minimum value is tomorrow's date<br>the value you specify in <code>date_from</code> shouldn't be further than <code>date_to</code><br>date format: <code>\"yyyy-mm-dd\"</code><br>example:<br><code>\"2021-10-30\"</code>if <a href=\"/v3/keywords_data/google_ads/status/\" target=\"_blank\" rel=\"noopener noreferrer\">Status endpoint</a> returns <code>false</code> in the <code>actual_data</code> field, <code>date_from</code> can be set to the month before last and prior;<br>if <a href=\"/v3/keywords_data/google_ads/status/\" target=\"_blank\" rel=\"noopener noreferrer\">Status endpoint</a> returns <code>true</code> in the <code>actual_data</code> field, <code>date_from</code> can be set to the last month and prior"
          },
          "date_to": {
            "type": "string",
            "description": "<em>ending date of the forecasting time range</em><br>required field if you specify <code>date_from</code><br><strong>if you indicate <code>date_from</code> and <code>date_to</code>, you don't need to specify <code>date_interval</code></strong><br>minimum value is <code>date_from</code> +1 day<br>maximum value is current day and month of the next year<br>date format: <code>\"yyyy-mm-dd\"</code><br>example:<br><code>\"2022-10-30\"</code>"
          },
          "date_interval": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>forecasting date interval</em><br>optional field<br><strong>if you specify <code>date_interval</code>, you don't need to indicate <code>date_from</code> and <code>date_to</code></strong><br>possible values: <code>next_week</code>, <code>next_month</code>, <code>next_quarter</code><br>default value: <code>next_month</code>"
          },
          "sort_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>results sorting parameters</em><br>optional field<br>Use these parameters to sort the results by <code>relevance</code>, <code>average_cpc</code>, <code>cost</code>, or <code>clicks</code> in the descending order<br>default value: <code>relevance</code>"
          },
          "postback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>URL for sending task results</em><br>optional field<br>once the task is completed, we will send a POST request with its results compressed in the <code>gzip</code> format to the <code>postback_url</code> you specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request.<br>example:<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>Note:</strong> special characters in <code>postback_url</code> will be urlencoded;<br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>"
          },
          "pingback_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>notification URL of a completed task</em><br>optional field<br>when a task is completed we will notify you by GET request sent to the URL you have specified<br>you can use the ‘$id’ string as a <code>$id</code> variable and ‘$tag’ as urlencoded <code>$tag</code> variable. We will set the necessary values before sending the request.<br>example:<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>Note:</strong> special characters in <code>pingback_url</code> will be urlencoded;<br>i.a., the <code>#</code> character will be encoded into <code>%23</code><p>learn more on our <a href=\"https://dataforseo.com/help-center/pingbacks-postbacks-with-dataforseo-api\" target=\"_blank\" rel=\"noopener noreferrer\">Help Center</a>"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>user-defined task identifier</em><br>optional field<br><em>the character limit is 255</em><br>you can use this parameter to identify the task and match it with the result<br>you will find the specified <code>tag</code> value in the <code>data</code> object of the response"
          }
        },
        "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 — Successful operation

Headers:
- `X-Request-Id` (string) — Request identifier to include when contacting Felo support.

**application/json**

Schema: object | null

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

### 400 — The request could not be processed. Check the request parameters.

### 401 — A valid Felo API key is required.

### 402 — The request cannot proceed because a billing requirement is not met.

### 403 — The account is not permitted to perform this operation.

### 429 — A request or spending limit has been reached.

### 502 — The service could not complete the request.

### 503 — The API or billing service is temporarily unavailable.

### 504 — The service timed out while processing the request.

### default — Error response; upstream passthrough responses may use provider formats

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "the current version of the API"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "general status code\nyou can find the full list of the response codes here"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "general informational message\nyou can find the full list of general informational messages here"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "total execution time, seconds"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "total tasks cost, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "the number of tasks in the tasks array",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "the number of tasks in the tasks array returned with an error",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "task identifier\nunique task identifier in our system in the UUID format"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "status code of the task\ngenerated by DataForSEO, can be within the following range: 10000-60000\nyou can find the full list of the response codes here"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "informational message of the task\nyou can find the full list of general informational messages here"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "execution time, seconds"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "total tasks cost, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "number of elements in the result array",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL path"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "contains the same parameters that you specified in the POST request"
    }
  }
}
```

### 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>array of tasks</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>array of results</em><br>in this case, the value will be <code>null</code>"
        }
      }
    }
  ]
}
```
