# Setting ‘Keywords For Site’ Tasks

**API:** Data API

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

**Tags:** DataForSEO

Queues a Google Ads keywords-for-site task, returning a task `id`. Wrapped in DataForSEO's envelope: data in `tasks[0].result`, outcome in `tasks[0].status_code` - a rejected request still returns HTTP 200. 🔴 The result is the same 7.2 MB order as the live twin. Retrieve with `get_dataforseo_keywords_gads_kw_for_site_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": {
          "target": {
            "type": "string",
            "description": "<em>domain or page</em><br><strong>required field</strong><br>the domain name of the target website or the url of the target page;<br><strong>note:</strong> to obtain keywords for the target website, use the <code>target_type</code> parameter"
          },
          "target_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>search keywords for site or url</em><br>optional field<br>possible values: <code>site</code>, <code>page</code>;<br>default value: <code>page</code><br>if set to <code>site</code>, keywords will be provided for the entire site;<br>if set to <code>page</code>, keywords will be provided for the specified webpage"
          },
          "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>"
          },
          "search_partners": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>include Google search partners</em><br>optional field<br>if you specify <code class=\"prettyprint\">true</code>, the results will be delivered for owned, operated, and syndicated networks across <a href=\"https://support.google.com/google-ads/answer/1722047?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">Google and partner sites</a> that host Google search;<br>default value: <code>false</code> - results are returned for Google search sites"
          },
          "date_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>starting date of the time range</em><br>optional field<br>date format: <code>\"yyyy-mm-dd\"</code><br>minimal value: 4 years from the current date<br>by default, data is returned for the past 12 months;<br><strong>Note</strong>: the indicated date cannot be greater than that specified in <code>date_to</code> and/or yesterday's date;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",
              "null"
            ],
            "description": "<em>ending date of the time range</em><br>optional field<br><strong>Note:</strong> the indicated date cannot be greater than yesterday's date;<br>if you don't specify this field, yesterday's date will be used by default<br>date format: <code>\"yyyy-mm-dd\"</code><br>example:<br><code>\"2022-11-30\"</code>"
          },
          "include_adult_keywords": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>include keywords associated with adult content</em><br>optional field<br>if set to <code>true</code>, adult keywords will be included in the response<br>default value: <code>false</code><br><strong>note</strong> that the API may return no data for such keywords due to <a href=\"https://support.google.com/adspolicy/answer/6008942?hl=en\" target=\"_blank\" rel=\"noopener noreferrer\">Google Ads restrictions</a>"
          },
          "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>search_volume</code>, <code>competition_index</code>, <code>low_top_of_page_bid</code>, or <code>high_top_of_page_bid</code> in 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": [
          {
            "location_code": 2840,
            "target": "dataforseo.com"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "location_code": 2840,
      "target": "dataforseo.com"
    }
  ]
}
```

## 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_KeywordsDataGoogleAdsKeywordsForSiteTaskPostResponseInfo"
    }
  ]
}
```

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

`#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsKeywordsForSiteTaskPostResponseInfo`

```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_KeywordsDataGoogleAdsKeywordsForSiteTaskPostTaskInfo"
              }
            ]
          },
          "description": "<em>array of tasks</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_KeywordsDataGoogleAdsKeywordsForSiteTaskPostTaskInfo

`#/components/schemas/Response36Afe1097B20_KeywordsDataGoogleAdsKeywordsForSiteTaskPostTaskInfo`

```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>"
        }
      }
    }
  ]
}
```
