Related Keywords (related_keywords)
related_keywords — method gives you a comprehensive list of related keywords whose SERP is similar to the one the requested keyword has
This method finds related keywords according to the similarity of their top-20 search results. If two keywords have the highest connection strength (20) — this means they share identical URLs in their top-20 search results. Specify the figure of the keywords connection strength to narrow the report down.
Parameter “weight” stands for the “Connection strength” which implies the degree of keywords similarity.
Pagination
Following parameters can be used for pagination:
- page_size : number of results per page (default: 100, max: 1000);
- page number (set to the 1st page by default).
To sort the results apply the following parameters:
- field that needs to be sorted;
- order - (asc -ascending, desc - descending).
Metrics | Description |
result | Encapsulates the answer |
total | Number of found related keywords |
keyword | Related keyword |
region_queries_count | Search volume in selected search engine database |
cost |
|
concurrency | Keyword competition in PPC (0-100) |
geo_names | List of in the array (if are present in the keywords) |
types | A list of special elements shown in (for example, video, carousel or map) |
right_spelling | Proposed correction for a keyword with a spelling error |
weight | The degree of keywords similarity |
status_msg | Response "OK" or "Error" report on a successful or unsuccessful request |
status_code | Response code "200" — successful request. Errors occur when limits are exceeded (number of simultaneous requests or account limits) |
left_lines | Number of remaining API queries |
Part of the API response, for which 1 limit is charged:
{
"keyword": "example dictionary",
"region_queries_count": 70,
"cost": 0,
"concurrency": 0,
"geo_names": [
],
"types": [
"pic",
"refine_by_brand",
"related_search",
"also_asks"
],
"right_spelling": null,
"weight": 6
}
{
"result": {
"total": 105,
"hits": [
{
"keyword": "example dictionary",
"region_queries_count": 70,
"cost": 0,
"concurrency": 0,
"geo_names": [
],
"types": [
"pic",
"refine_by_brand",
"related_search",
"also_asks"
],
"right_spell": null,
"right_spelling": null,
"weight": 6
},
{
"keyword": "dictionary and examples",
"region_queries_count": 30,
"cost": 0.14,
"concurrency": 7,
"geo_names": [
],
"types": [
"refine_by_brand",
"pic",
"related_search",
"a_box_fsnippet",
"also_asks"
],
"right_spelling": null,
"weight": 6
}
]
},
"status_msg": "OK",
"status_code": 200,
"left_lines": 344287
}
<?php
// This example works on serpstat-sdk only
// https://github.com/SerpstatGlobal/serpstat-sdk
require_once __DIR__ . '/../vendor/autoload.php';
// configure your application
$config = [
'token' => '19666fc1ae1724da1d5ea2f3a99d5f5a',
];
$keywords = 'keywords';
// init client with your serpstat api token
$apiClient = new \Serpstat\Sdk\Core\ApiGuzzleHttpClient($config['token']);
// create instance of any api method class
// list of methods classes in folder src\Methods
$apiMethod = new \Serpstat\Sdk\Methods\RelatedKeywordsMethod(
$keywords,
\Serpstat\Sdk\Methods\RelatedKeywordsMethod::WEIGHT_MIN,
\Serpstat\Sdk\Interfaces\IApiClient::SE_GOOGLE_RU
);
try {
// try call api method
$response = $apiClient->call($apiMethod);
} catch (\Exception $e) {
// catch api error
$response = $e->getMessage();
}
import codecs
import json
import pprint
import urllib.request as urlrequest
from urllib.parse import urlencode
host = 'http://api.serpstat.com/v3'
method = 'related_keywords'
params = {
'query': 'buy%20laptop', # string for get info
'se': 'g_us', # string search engine
'token': 'ijmiom4f5m34905g03um8342dm04923lre3w', # string personal token
}
api_url = "{host}/{method}?{params}".format(
host=host,
method=method,
params=urlencode(params)
)
try:
json_data = urlrequest.urlopen(api_url).read()
except Exception as e0:
print("API request error: {error}".format(error=e0))
data = json.loads(json_data)
pprint.pprint(data)