NAVNavbar
Logo
php python csharp java

Keyword Ideas


The Keyword Ideas endpoint provides search terms that are relevant to the product or service categories of the specified keywords. The algorithm selects the keywords which fall into the same categories as the seed keywords specified in a POST array.

As a result, you will get a list of relevant keyword ideas for up to 200 seed keywords.

Along with each keyword idea, you will get its search volume rate for the last month, search volume trend for the previous 12 months, as well as current cost-per-click and competition values. Moreover, this endpoint supplies minimum, maximum and average values of daily impressions, clicks and CPC for each result.

Datasource: DataForSEO Keyword Database segmented by product categories.
Search algorithm: relevance-based search for terms that fall into the same category as specified seed keywords.
Examples:
Note: no additional sorting parameters applied, "closely_variants" set to false
Specified seed keywords:
“keyword research”, “content marketing”
Resulting keyword ideas:
•”free adword tools”,
•”find longtail keywords”,
•”how to do keywords research”,
•”seo keyword research template”

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard

<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
$client = new RestClient($api_url, null, 'login', 'password');

$post_array = array();
// simple way to set a task
$post_array[] = array(
   "keywords" => [
      "phone",
      "watch"
   ],
   "language_name" => "English",
   "location_code" => 2840,
   "filters" => [
      ["impressions_info.ad_position_average", ">", 0],
      "and",
      [
         ["impressions_info.cpc_max", ">", 0.5],
         "or",
         ["impressions_info.daily_clicks_max", ">=", 10]
      ]
   ]
);
try {
   // POST /v3/dataforseo_labs/keyword_ideas/live
   $result = $client->post('/v3/dataforseo_labs/keyword_ideas/live', $post_array);
   print_r($result);
   // do something with post result
} catch (RestClientException $e) {
   echo "\n";
   print "HTTP code: {$e->getHttpCode()}\n";
   print "Error code: {$e->getCode()}\n";
   print "Message: {$e->getMessage()}\n";
   print  $e->getTraceAsString();
   echo "\n";
}
$client = null;
?>

The above command returns JSON structured like this:

{
  "version": "0.1.20200312",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.4468 sec.",
  "cost": 0.0001,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "03121703-0696-0127-0000-963dbb24873c",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.3848 sec.",
      "cost": 0.0001,
      "result_count": 1,
      "path": [
        "v3",
        "dataforseo_labs",
        "keyword_ideas",
        "live"
      ],
      "data": {
        "api": "dataforseo_labs",
        "function": "keyword_ideas",
        "keywords": [
          "phone",
          "watch"
        ],
        "language_name": "English",
        "location_code": 2840,
        "filters": [
          [
            "impressions_info.ad_position_average",
            ">",
            0
          ],
          "and",
          [
            [
              "impressions_info.cpc_max",
              ">",
              0.5
            ],
            "or",
            [
              "impressions_info.daily_clicks_max",
              ">=",
              10
            ]
          ]
        ],
        "limit": 5
      },
      "result": [
        {
          "seed_keywords": [
            "phone",
            "watch"
          ],
          "location_code": 2840,
          "language_code": "en",
          "total_count": 128557,
          "items_count": 5,
          "items": [
            {
              "keyword": "tmobile",
              "location_code": 2840,
              "language_code": "en",
              "keyword_info": {
                "last_updated_time": "2020-03-03T01:41:08",
                "competition": 0.1836588312089556,
                "cpc": 0.461629,
                "search_volume": 7480000,
                "categories": [
                  10007,
                  10019,
                  10167,
                  10878,
                  11511,
                  12161,
                  13054,
                  13381,
                  13419
                ],
                "monthly_searches": [
                  {
                    "year": 2020,
                    "month": 1,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 12,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 11,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 10,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 9,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 8,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 7,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 6,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 5,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 4,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 3,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 2,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 1,
                    "search_volume": 6120000
                  }
                ]
              },
              "impressions_info": {
                "last_updated_time": "2020-03-01T22:49:29",
                "bid": 999,
                "match_type": "exact",
                "ad_position_min": 1.11,
                "ad_position_max": 1,
                "ad_position_average": 1.06,
                "cpc_min": 3.24,
                "cpc_max": 3.96,
                "cpc_average": 3.6,
                "daily_impressions_min": 37515.37,
                "daily_impressions_max": 45852.12,
                "daily_impressions_average": 41683.75,
                "daily_clicks_min": 3493.61,
                "daily_clicks_max": 4269.97,
                "daily_clicks_average": 3881.79,
                "daily_cost_min": 12573.25,
                "daily_cost_max": 15367.3,
                "daily_cost_average": 13970.27
              }
            },
            {
              "keyword": "t mobil",
              "location_code": 2840,
              "language_code": "en",
              "keyword_info": {
                "last_updated_time": "2020-03-02T16:14:20",
                "competition": 0.1836588312089556,
                "cpc": 0.461629,
                "search_volume": 7480000,
                "categories": [
                  10007,
                  10019,
                  10167,
                  10878,
                  11511,
                  12161,
                  13054,
                  13381,
                  13419
                ],
                "monthly_searches": [
                  {
                    "year": 2020,
                    "month": 1,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 12,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 11,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 10,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 9,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 8,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 7,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 6,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 5,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 4,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 3,
                    "search_volume": 7480000
                  },
                  {
                    "year": 2019,
                    "month": 2,
                    "search_volume": 6120000
                  },
                  {
                    "year": 2019,
                    "month": 1,
                    "search_volume": 6120000
                  }
                ]
              },
              "impressions_info": {
                "last_updated_time": "2020-03-01T21:52:32",
                "bid": 999,
                "match_type": "exact",
                "ad_position_min": 1.11,
                "ad_position_max": 1,
                "ad_position_average": 1.06,
                "cpc_min": 134.8,
                "cpc_max": 164.75,
                "cpc_average": 149.78,
                "daily_impressions_min": 1.59,
                "daily_impressions_max": 1.95,
                "daily_impressions_average": 1.77,
                "daily_clicks_min": 0.24,
                "daily_clicks_max": 0.29,
                "daily_clicks_average": 0.27,
                "daily_cost_min": 36.08,
                "daily_cost_max": 44.1,
                "daily_cost_average": 40.09
              }
            }
          ]
        }
      ]
    }
  ]
}

All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute.

You can specify the number of results you want to retrieve and sort them.

Below you will find a detailed description of the fields you can use for setting a task.

Description of the fields for setting a task:

Field name Type Description
keywords array keywords
required field
all %## will be decoded (plus symbol ‘+’ will be decoded to a space character)
The maximum number of keywords you can specify: 200.
The minimum number of characters for each keyword: 3.
all keywords will be converted to lowercase format
location_name string full name of the location
optional field if you specify location_code
if you use this field, you don’t need to specify location_code
you can receive the list of available locations with their location_name by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
example:
United Kingdom
location_code integer unique location identifier
optional field if you specify location_name
if you use this field, you don’t need to specify location_name
you can receive the list of available locations with their location_code by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
example:
2840
language_name string full name of the language
optional field if you specify language_code
if you use this field, you don’t need to specify language_code
you can receive the list of available languages with their language_name by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
example:
English
language_code string unique language identifier
optional field if you specify language_name
if you use this field, you don’t need to specify language_name
you can receive the list of available languages with their language_code by making a separate request to the https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages
example:
en
closely_variants boolean search mode
optional field
if set to true the results will be based on the phrase-match search algorithm
if set to false the results will be based on the broad-match search algorithm
default value: false
limit ineger the maximum number of keywords in the results array
optional field
default value: 700
maximum value: 1000
filters array array of results filtering parameters
optional field
you can add several filters at once (8 filters maximum)
you should set a logical operator and, or between the conditions
the following operators are supported:
<, <=, >, >=, =, <>, in, not_in, like, not_like
you can use the % operator with like and not_like to match any string of zero or more characters
example:
["keyword_info.search_volume",">",0]

[["impressions_info.daily_impressions_average","in",[0,1000]],
"and",
["impressions_info.ad_position_average","<",3]]

[["impressions_info.ad_position_average",">",0],
"and",
[["impressions_info.cpc_max","<",0.5],"or",["impressions_info.daily_clicks_max",">=",10]]]

for more information about filters, please refer to Dataforseo Labs – Filters

order_by array results sorting rules
optional field
you can use the same values as in the filters array to sort the results
possible sorting types:
asc – results will be sorted in the ascending order
desc – results will be sorted in the descending order
you should use a comma to set up a sorting parameter
example:
["keyword_info.competition,desc"]
default rule:
["relevance,desc"]
note that you can set no more than three sorting rules in a single request
you should use a comma to separate several sorting rules
example:
["keyword_info.search_volume,desc","keyword_info.cpc,desc"]
tag string user-defined task identifier
optional field
the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data array of the response

As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer general status code
you can find the full list of the response codes here
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array returned with an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path
        data array contains the same parameters that you specified in the POST request
        result array array of results
            seed_keywords array keywords in a POST array
keywords are returned with decoded %## (plus symbol ‘+’ will be decoded to a space character)
            location_code integer location code in a POST array
            language_code string language code in a POST array
            items_count integer the number of results returned in the items array
            items array contains keyword ideas and related data
                keyword string returned keyword idea
                location_code integer location code in a POST array
                language_code string language code in a POST array
                keyword_info array keyword data for the returned keyword idea
                    last_updated_time string date and time when keyword data was updated
in the format: “year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes”
example:
2019-11-15 12:57:46 +00:00
                    competition float competition
represents the relative amount of competition associated with the given keyword. This value is based on Google Ads data and can be between 0 and 1 (inclusive)
                    cpc float cost-per-click
represents the average cost per click (USD) historically paid for the keyword
                    search_volume integer average monthly search volume rate
represents the (approximate) number of searches for the given keyword idea on google.com
                    categories array product and service categories
you can download the full list of possible categories
                    monthly_searches array monthly searches
represents the (approximate) number of searches on this keyword idea (as available for the past twelve months), targeted to the specified geographic locations
                        year integer year
                        month integer month
                        search_volume integer monthly average search volume rate
                impressions_info array impressions data for the returned keyword idea
if there is no data, then the value is null
                    last_updated_time string date and time when impressions data was updated
in the format: “year-month-date:minutes:UTC_difference_hours:UTC_difference_minutes”
example:
2019-11-15 12:57:46 +00:00
                    bid integer the maximum bid
it stands for the price you are willing to pay for an ad
the higher the value, the higher positions and price you will get
we return the results for the 999 bid value to provide the most relevant impressions data
                    match string keyword match-type
can take the following values: exact, broad, phrase
                    ad_position_min float the minimum ad position
represents the minimum position of the advertisement
                    ad_position_max float the maximum ad position
represents the maximum position of the advertisement
                    ad_position_average float the average ad position
represents the average position of the advertisement
                    cpc_min float the minimum value of cost-per-click
represents the minimum cost-per-click (USD) historically paid for the keyword
                    cpc_max float the maximum value of cost-per-click
represents the maximum cost-per-click (USD) historically paid for the keyword
                    cpc_average float the average value of cost-per-click
represents the average cost-per-click (USD) historically paid for the keyword
                    daily_impressions_min float the minimum value of daily impressions
represents the minimum number of daily impressions of the advertisement
                    daily_impressions_max float the maximum value of daily impressions
represents the maximum number of daily impressions of the advertisement
                    daily_impressions_average float the average value of daily impressions
represents the average number number of daily impressions of the advertisement
                    daily_clicks_min float the minimum value of daily clicks
represents the minimum number of daily clicks on the advertisement
                    daily_clicks_max float the maximum value of daily clicks
represents the maximum number of daily clicks on the advertisement
                    daily_clicks_average float the average value of daily clicks
represents the average number of daily clicks on the advertisement
                    daily_cost_min float the minimum daily cost
represents the minimum daily cost of the advertisement
                    daily_cost_max float the maximum daily cost
represents the maximum daily cost of the advertisement
                    daily_cost_average float the average daily cost
represents the average daily cost of the advertisement

‌‌