Appearance
Related Keywords (Live) Fresh
The Related Keywords endpoint returns keywords from the "searches related to" section at the bottom of Google SERPs. It uses a depth-first search algorithm — starting from the seed keyword, it recursively traverses related keywords up to a specified depth.
Endpoint: POST https://api.dataforseo.com/v3/dataforseo_labs/google/related_keywords/live
Datasource: DataForSEO SERPs Database
How the Algorithm Works
Given seed keyword: "keyword research" with depth: 1
Returned related keywords:
"free keyword research""keyword research tools""best free keyword research tool""keyword research tips""seo keyword research tool""keyword research step by step""keyword research google ads"
Each keyword includes search volume, CPC, competition, and 12-month trend data.
Depth and Result Volume
The depth parameter controls how many layers of "related to" traversal are performed:
| Depth | Max keywords returned |
|---|---|
| 0 | 1 (the seed keyword only) |
| 1 | ~8 keywords |
| 2 | ~72 keywords |
| 3 | ~584 keywords |
| 4 | ~4,680 keywords |
Default depth is 1. Use depth 4 for exhaustive topic mapping.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Seed keyword. UTF-8. Converted to lowercase. |
location_name | string | Conditional | Full location name (e.g., "United States"). Required unless location_code is specified. |
location_code | integer | Conditional | Location code (e.g., 2840). Required unless location_name is specified. |
language_name | string | Conditional | Full language name (e.g., "English"). Required unless language_code is specified. |
language_code | string | Conditional | Language code (e.g., "en"). Required unless language_name is specified. |
depth | integer | No | Traversal depth 0–4. Default: 1. |
include_seed_keyword | boolean | No | Include seed keyword data in seed_keyword_data array. Default: false. |
include_serp_info | boolean | No | Include SERP features and result count per keyword. Default: false. |
include_clickstream_data | boolean | No | Include clickstream search volume and demographic breakdown. Doubles cost. Default: false. |
ignore_synonyms | boolean | No | Exclude highly similar keyword variants. Default: false. |
replace_with_core_keyword | boolean | No | Return SERP and related data for the core synonym of the seed instead of the seed itself. Default: false. |
filters | array | No | Up to 8 filter conditions using standard operators. |
order_by | array | No | Up to 3 sorting rules. Example: ["keyword_data.keyword_info.search_volume,desc"]. |
limit | integer | No | Max results. Default: 100. Max: 1000. |
offset | integer | No | Result offset. Default: 0. |
tag | string | No | Custom task identifier. Max 255 characters. |
Filter Examples
json
["keyword_data.keyword_info.search_volume", ">", 0]json
[
["keyword_data.keyword_info.search_volume", ">", 100],
"and",
[
["keyword_data.keyword_info.cpc", "<", 0.5],
"or",
["keyword_info.high_top_of_page_bid", "<=", 0.5]
]
]Response Structure
| Field | Type | Description |
|---|---|---|
tasks[].result[].seed_keyword | string | Your input keyword |
tasks[].result[].seed_keyword_data | array | Keyword metrics for seed (when include_seed_keyword: true) |
tasks[].result[].total_count | integer | Total related keywords found |
tasks[].result[].items_count | integer | Keywords returned in response |
tasks[].result[].items[] | array | Related keyword objects |
Item Fields
| Field | Type | Description |
|---|---|---|
keyword_data.keyword | string | The related keyword |
keyword_data.keyword_info.search_volume | integer | Average monthly searches |
keyword_data.keyword_info.competition | float | Competition 0–1 |
keyword_data.keyword_info.competition_level | string | LOW, MEDIUM, or HIGH |
keyword_data.keyword_info.cpc | float | Average CPC in USD |
keyword_data.keyword_info.monthly_searches | array | Monthly volume for past 12 months |
keyword_data.keyword_properties.keyword_difficulty | integer | Difficulty score 0–100 |
keyword_data.keyword_properties.core_keyword | string | Core keyword in synonym group |
keyword_data.search_intent_info.main_intent | string | Primary search intent |
keyword_data.avg_backlinks_info.backlinks | float | Avg backlinks among top-10 |
depth | integer | Depth level at which this keyword was found |
related_keywords | array | Further related keywords discovered from this keyword |
cURL Example
bash
curl --request POST \
--url https://api.dataforseo.com/v3/dataforseo_labs/google/related_keywords/live \
--header 'Authorization: Basic BASE64(login:password)' \
--header 'Content-Type: application/json' \
--data '[
{
"keyword": "roofing contractor",
"location_code": 2840,
"language_code": "en",
"depth": 2,
"include_seed_keyword": true,
"filters": [["keyword_data.keyword_info.search_volume", ">", 50]],
"order_by": ["keyword_data.keyword_info.search_volume,desc"],
"limit": 100
}
]'Python Example
python
import requests
from requests.auth import HTTPBasicAuth
import json
def related_keywords(seed, location_code=2840, language_code="en", depth=2, min_volume=10):
payload = [{
"keyword": seed,
"location_code": location_code,
"language_code": language_code,
"depth": depth,
"include_seed_keyword": True,
"filters": [["keyword_data.keyword_info.search_volume", ">", min_volume]],
"order_by": ["keyword_data.keyword_info.search_volume,desc"],
"limit": 1000
}]
response = requests.post(
"https://api.dataforseo.com/v3/dataforseo_labs/google/related_keywords/live",
auth=HTTPBasicAuth("your_login", "your_password"),
headers={"Content-Type": "application/json"},
data=json.dumps(payload)
)
data = response.json()
items = data["tasks"][0]["result"][0]["items"]
return [
{
"keyword": item["keyword_data"]["keyword"],
"search_volume": item["keyword_data"]["keyword_info"]["search_volume"],
"cpc": item["keyword_data"]["keyword_info"]["cpc"],
"competition_level": item["keyword_data"]["keyword_info"]["competition_level"],
"difficulty": item["keyword_data"]["keyword_properties"]["keyword_difficulty"],
"depth_found": item["depth"]
}
for item in items
]
# Usage — exhaustive topic map at depth 3
results = related_keywords("local seo services", depth=3, min_volume=50)
print(f"Found {len(results)} related keywords")
for kw in results[:10]:
print(f"[depth {kw['depth_found']}] {kw['keyword']} | Vol: {kw['search_volume']}")Notes
- Both
location_name/location_codeandlanguage_name/language_codeare required fields for this endpoint. Unlike Keyword Suggestions, you cannot omit location to get global results. - At depth 4, up to 4,680 keywords can be returned. Use
limitandoffsetor filters to narrow results. - The
replace_with_core_keywordparameter is useful when your seed keyword is a non-standard variant and you want data mapped to the canonical version. - Clickstream data (
include_clickstream_data: true) adds gender and age breakdowns for each keyword but doubles the request cost.