主题
Google Related Keywords 实时接口
接口说明
该接口用于获取 Google 搜索结果页中“搜索(searches related to)”模块出现的。
通过设置 depth,最多可扩展获取 4680 个建议。每个可返回以下数据:
- 产品/服务分类
- 最近一个月搜索量
- 过去 12 个月搜索量趋势
- 当前 CPC
- 竞争度
- 难度
- SERP 信息
- 平均外链数据
- 搜索意图
- 可选的点击流指标
数据源: 本平台 SERP 数据库 搜索算法: 基于指定种子词,对 SERP 中“搜索”结果执行深度优遍历
示例说明
当 depth=1 且种子词为 keyword research 时,可能返回如下词:
free keyword researchkeyword research toolsbest free keyword research toolkeyword research tipsseo keyword research toolkeyword research step by stephow to do keyword research 2019keyword research google ads
请求方式
POST https://api.seermartech.cn/v3/dataforseo_labs/google/related_keywords/live
计费说明
该接口按请求计费。
原文未给出固定单价,因此无法直接换算人民币。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
调用限制
- 每分钟最多 2000 次 API 调用
- 最大并发请求数:30
请求体格式
所有 POST 数据应使用 UTF-8 编码的 JSON 格式提交。 请求体为 JSON 数组:
json
[
{
"keyword": "phone",
"location_code": 2840,
"language_name": "English",
"limit": 3
}
]你可以通过以下能力控制返回结果:
- 限制返回数量
- 过滤结果
- 排序结果
- 控制搜索深度
- 选择是否附带 SERP / 点击流等附加信息
请求参数
基础参数
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | ,填。使用 UTF-8 编码。系统会自动转换为小写。 |
location_name | string | 地区名。如果未传 location_code,则此字段填。location_name 与 location_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区。示例:United Kingdom |
location_code | integer | 地区编码。如果未传 location_name,则此字段填。location_name 与 location_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区。示例:2840 |
language_name | string | 语言名。如果未传 language_code,则此字段填。language_name 与 language_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言。示例:English |
language_code | string | 语言编码。如果未传 language_name,则此字段填。language_name 与 language_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言。示例:en |
功能参数
| 字段 | 类型 | 说明 |
|---|---|---|
depth | integer | 搜索深度,可选,默认 1。可设置 0 到 4。返回数量随深度增加而增加。估算上限:0 = 种子词本身;1 = 8 个;2 = 72 个;3 = 584 个;4 = 4680 个。 |
include_seed_keyword | boolean | 是否在响应中附带种子词数据,可选,默认 false。若为 true,种子词数据将出现在 seed_keyword_data 中。 |
include_serp_info | boolean | 是否返回每个对应的 SERP 信息,可选,默认 false。若为 true,响应中会 serp_info。 |
include_clickstream_data | boolean | 是否返回点击流指标,可选,默认 false。若设为 true,响应中会额外返回 clickstream_keyword_info、keyword_info_normalized_with_clickstream、keyword_info_normalized_with_bing。启用后请求费用翻倍。 |
ignore_synonyms | boolean | 是否忽略高度相似,可选,默认 false。若为 true,返回核心。 |
replace_with_core_keyword | boolean | 是否使用所属同义词分组的主返回 serp_info 与 related_keywords,默认 false。若为 true,返回主的数据;若为 false,尽量返回指定本身的数据。 |
结果过滤与排序
| 字段 | 类型 | 说明 |
|---|---|---|
filters | array | 结果过滤条件数组,可选。最多可设置 8 个过滤条件。条件之间可使用逻辑运算符 and、or。支持操作符:regex、not_regex、<、<=、>、>=、=、<>、in、not_in、match、not_match、ilike、not_ilike、like、not_like。 like/not_like/ilike/not_ilike 支持 % 通任意长度字符串。更多规则可参考 /v3/dataforseo_labs/filters。 |
order_by | array | 排序规则数组,可选。可使用与 filters 相同的字段路径。排序方式支持 asc、desc。单次请求最多可设置 3 条排序规则。 |
分页与标识
| 字段 | 类型 | 说明 |
|---|---|---|
limit | integer | 返回的最大数量,可选,默认 100,最大 1000。 |
offset | integer | 返回结果偏移量,可选,默认 0。例如设置为 10 时,前 10 条结果将被跳过。 |
tag | string | 自定义任务标识,可选,最大 255 个字符。可用于将请求与响应结果进行匹,响应中的 data 会回显该值。 |
响应结构
接口返回 JSON 编码数据,顶层 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码,完整错误码见 /v3/appendix/errors |
status_message | string | 通用状态信息 |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 执行出错的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时 |
cost | float | 任务费用,单位 USD |
result_count | integer | result 数组数量 |
path | array | URL 路径 |
data | object | 回显请求参数 |
result | array | 结果数组 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
seed_keyword | string | 请求中提交的种子词 |
seed_keyword_data | array | 种子词数据当 include_seed_keyword=true 时返回,字段结构与 keyword_data 一致 |
location_code | integer | 请求中的地区编码 |
language_code | string | 请求中的语言编码 |
total_count | integer | 数据库中符合条件的总结果数 |
items_count | integer | 当前 items 中返回的结果数量 |
items | array | 结果列表 |
items[] 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
keyword_data | object | 返回的完整数据 |
depth | integer | 当前所在深度层级 |
related_keywords | array | 与当前的查询列表 |
keyword_data 字段
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
keyword | string | |
location_code | integer | 请求中的地区编码 |
language_code | string | 请求中的语言编码 |
keyword_info | object | 基础指标 |
clickstream_keyword_info | object | 点击流指标在 include_clickstream_data=true 时返回 |
keyword_properties | object | 附加属性 |
serp_info | object | SERP 数据,需 include_serp_info=true 才会返回,否则可能为 null |
avg_backlinks_info | object | Top 10 自然结果的平均外链指标 |
search_intent_info | object | 搜索意图信息 |
keyword_info_normalized_with_bing | object | 基于 Bing 数据归一化后的搜索量 |
keyword_info_normalized_with_clickstream | object | 基于点击流数据归一化后的搜索量 |
keyword_info 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
last_updated_time | string | 数据更新时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
competition | float | 竞争度,取值 0 到 1,基于 Google Ads 数据 |
competition_level | string | 竞争等级付费搜索维度。可能值:LOW、MEDIUM、HIGH,未知时为 null |
cpc | float | 平均单次点击成本,单位 USD |
search_volume | integer | 平均月搜索量 |
low_top_of_page_bid | float | 首页顶部广告展示的较低出价参考值 |
high_top_of_page_bid | float | 首页顶部广告展示的较高出价参考值 |
categories | array | 产品和服务分类 |
monthly_searches | array | 过去 12 个月的月度搜索量 |
search_volume_trend | object | 搜索量趋势变化 |
monthly_searches[]
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
search_volume | integer | 当月搜索量 |
search_volume_trend
| 字段 | 类型 | 说明 |
|---|---|---|
monthly | integer | 相比上个月的搜索量变化百分比 |
quarterly | integer | 相比上季度的搜索量变化百分比 |
yearly | integer | 相比上一年的搜索量变化百分比 |
clickstream_keyword_info 字段说明
在 include_clickstream_data=true 时返回。
| 字段 | 类型 | 说明 |
|---|---|---|
search_volume | integer | 基于点击流估算的月均搜索量 |
last_updated_time | string | 点击流数据集更新时间,UTC 格式 |
gender_distribution | object | 性别分布 |
age_distribution | object | 年龄分布 |
monthly_searches | array | 点击流月度搜索量 |
gender_distribution
| 字段 | 类型 | 说明 |
|---|---|---|
female | integer | 女性用户数量 |
male | integer | 男性用户数量 |
age_distribution
| 字段 | 类型 | 说明 |
|---|---|---|
18-24 | integer | 18-24 岁用户数量 |
25-34 | integer | 25-34 岁用户数量 |
35-44 | integer | 35-44 岁用户数量 |
45-54 | integer | 45-54 岁用户数量 |
55-64 | integer | 55-64 岁用户数量 |
keyword_properties 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
core_keyword | string | 同义词分组中的主;若无法识别同义词分组则为 null |
synonym_clustering_algorithm | string | 同义词识别算法。可能值:keyword_metrics、text_processing |
keyword_difficulty | integer | 难度,范围 0-100,表示自然搜索前 10 的难易程度 |
detected_language | string | 系统识别出的语言 |
is_another_language | boolean | 若为 true,表示请求语言与系统识别语言不一致 |
serp_info 字段说明
如果未设置 include_serp_info=true,或数据库中没有对应 SERP 数据,则该字段为 null。
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
check_url | string | 直接访问搜索结果页的校验链接 |
serp_item_types | array | SERP 中出现的结果类型 |
se_results_count | integer | 搜索结果数量 |
last_updated_time | string | 最近一次 SERP 数据更新时间,UTC 格式 |
previous_updated_time | string | 上一次 SERP 数据更新时间,UTC 格式 |
支持的 serp_item_types括但不限于:
answer_box、app、carousel、multi_carousel、featured_snippet、google_flights、google_reviews、third_party_reviews、google_posts、images、jobs、knowledge_graph、local_pack、hotels_pack、map、organic、paid、people_also_ask、related_searches、people_also_search、shopping、top_stories、twitter、video、events、mention_carousel、recipes、top_sights、scholarly_articles、popular_products、podcasts、questions_and_answers、find_results_on、stocks_box、visual_stories、commercial_units、local_services、google_hotels、math_solver、currency_box、product_considerations、found_on_web、short_videos、refine_products、explore_brands、perspectives、discussions_and_forums、compare_sites、courses、ai_overview
注意:结果明细会为
organic、paid、featured_snippet、local_pack返回。
avg_backlinks_info 字段说明
该对象表示当前自然搜索前 10 结果页面的平均外链指标。
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型 |
backlinks | float | 平均外链数 |
dofollow | float | 平均 dofollow 链接数 |
referring_pages | float | 平均引荐页面数 |
referring_domains | float | 平均引荐域名数 |
referring_main_domains | float | 平均主域引荐数 |
rank | float | 平均 Rank 值 |
main_domain_rank | float | 平均主域 Rank 值 |
last_updated_time | string | 外链数据更新时间,UTC 格式 |
search_intent_info 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,可能值:google |
main_intent | string | 主搜索意图,可能值:informational、navigational、commercial、transactional |
foreign_intent | array | 补搜索意图,可能值同上 |
last_updated_time | string | 搜索意图数据更新时间,UTC 格式 |
keyword_info_normalized_with_bing 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 数据集更新时间,UTC 格式 |
search_volume | integer | 当前搜索量 |
is_normalized | boolean | 若为 true,表示数值已基于 Bing 数据归一化 |
monthly_searches | array | 月度搜索量数组 |
keyword_info_normalized_with_clickstream 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 数据集更新时间,UTC 格式 |
search_volume | integer | 当前搜索量 |
is_normalized | boolean | 若为 true,表示数值已基于点击流数据归一化 |
monthly_searches | array | 月度搜索量数组 |
认证方式
请在请求头中使用 Bearer Token:
http
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/dataforseo_labs/google/related_keywords/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "phone",
"language_name": "English",
"location_code": 2840,
"filters": [
["keyword_data.keyword_info.search_volume", ">", 10]
],
"limit": 3
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/google/related_keywords/live"
payload = [
{
"keyword": "phone",
"location_name": "United States",
"language_name": "English",
"filters": [
["keyword_data.keyword_info.search_volume", ">", 10]
],
"limit": 3
}
]
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const postArray = [
{
keyword: "phone",
language_name: "English",
location_code: 2840,
filters: [
["keyword_data.keyword_info.search_volume", ">", 10]
],
limit: 3
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/dataforseo_labs/google/related_keywords/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: postArray
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0995 sec.",
"cost": 0.0103,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "dataforseo_labs",
"function": "related_keywords",
"se_type": "google",
"keyword": "phone",
"language_name": "English",
"location_code": 2840,
"limit": 3
},
"result": [
{
"se_type": "google",
"seed_keyword": "phone",
"location_code": 2840,
"language_code": "en",
"items_count": 3,
"items": [
{
"se_type": "google",
"keyword_data": {
"se_type": "google",
"keyword": "phone",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"se_type": "google",
"last_updated_time": "2024-08-11 13:24:34 +00:00",
"competition": 1,
"competition_level": "HIGH",
"cpc": 3.95,
"search_volume": 368000,
"monthly_searches": [],
"search_volume_trend": {
"monthly": 22,
"quarterly": 22,
"yearly": 0
}
},
"clickstream_keyword_info": null,
"keyword_properties": {
"se_type": "google",
"core_keyword": null,
"synonym_clustering_algorithm": "text_processing",
"keyword_difficulty": 83,
"detected_language": "en",
"is_another_language": false
},
"serp_info": {
"se_type": "google",
"check_url": "https://www.google.com/search?q=phone&num=100&hl=en&gl=US&gws_rd=cr&ie=UTF-8&oe=UTF-8&glp=1&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
"serp_item_types": [],
"se_results_count": 19880000000,
"last_updated_time": "2024-07-15 00:43:34 +00:00",
"previous_updated_time": "2024-05-18 22:29:28 +00:00"
},
"avg_backlinks_info": {
"se_type": "google",
"backlinks": 6835.7,
"dofollow": 3775.6,
"referring_pages": 5352.2,
"referring_domains": 1100.3,
"referring_main_domains": 955.1,
"rank": 369.3,
"main_domain_rank": 681.2,
"last_updated_time": "2024-07-14 21:43:39 +00:00"
},
"search_intent_info": {
"se_type": "google",
"main_intent": "navigational",
"foreign_intent": [],
"last_updated_time": "2023-03-02 03:54:21 +00:00"
},
"keyword_info_normalized_with_bing": {
"last_updated_time": "2024-08-17 01:41:37 +00:00",
"search_volume": 324416,
"is_normalized": true,
"monthly_searches": []
},
"keyword_info_normalized_with_clickstream": {
"last_updated_time": "2024-08-11 13:24:34 +00:00",
"search_volume": 368000,
"is_normalized": true,
"monthly_searches": []
}
},
"depth": 0,
"related_keywords": []
},
{
"se_type": "google",
"keyword_data": {
"se_type": "google",
"keyword": "phone call",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"se_type": "google",
"last_updated_time": "2024-08-08 14:16:10 +00:00",
"competition": 0.07,
"competition_level": "LOW",
"cpc": 4.23,
"search_volume": 27100,
"low_top_of_page_bid": 0.92,
"high_top_of_page_bid": 7.55,
"categories": [],
"monthly_searches": [],
"search_volume_trend": {
"monthly": 22,
"quarterly": 22,
"yearly": 0
}
},
"clickstream_keyword_info": null,
"keyword_properties": {
"se_type": "google",
"core_keyword": "phone calling",
"synonym_clustering_algorithm": "text_processing",
"keyword_difficulty": 57,
"detected_language": "en",
"is_another_language": false
},
"serp_info": {
"se_type": "google",
"check_url": "https://www.google.com/search?q=phone%20call&num=100&hl=en&gl=US&gws_rd=cr&ie=UTF-8&oe=UTF-8&glp=1&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
"serp_item_types": [],
"se_results_count": 25270000000,
"last_updated_time": "2024-08-04 13:21:19 +00:00",
"previous_updated_time": "2024-06-22 22:50:34 +00:00"
},
"avg_backlinks_info": {
"se_type": "google",
"backlinks": 11475.1,
"dofollow": 7174.8,
"referring_pages": 10754.1,
"referring_domains": 884.2,
"referring_main_domains": 765,
"rank": 329.4,
"main_domain_rank": 787.5,
"last_updated_time": "2024-08-04 10:21:19 +00:00"
},
"search_intent_info": {
"se_type": "google",
"main_intent": "commercial",
"foreign_intent": null,
"last_updated_time": "2023-03-02 03:54:30 +00:00"
},
"keyword_info_normalized_with_bing": {
"last_updated_time": "2024-08-16 12:35:38 +00:00",
"search_volume": 19134,
"is_normalized": true,
"monthly_searches": []
},
"keyword_info_normalized_with_clickstream": {
"last_updated_time": "2024-08-08 14:16:10 +00:00",
"search_volume": 27100,
"is_normalized": true,
"monthly_searches": []
}
},
"depth": 1,
"related_keywords": []
},
{
"se_type": "google",
"keyword_data": {
"se_type": "google",
"keyword": "phone app",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"se_type": "google",
"last_updated_time": "2024-08-11 20:06:52 +00:00",
"competition": 0.15,
"competition_level": "LOW",
"cpc": 2.14,
"search_volume": 22200,
"low_top_of_page_bid": 0.46,
"high_top_of_page_bid": 3.16,
"categories": [],
"monthly_searches": [],
"search_volume_trend": {
"monthly": 22,
"quarterly": 22,
"yearly": 0
}
},
"clickstream_keyword_info": null,
"keyword_properties": {
"se_type": "google",
"core_keyword": "phone for apps",
"synonym_clustering_algorithm": "text_processing",
"keyword_difficulty": 66,
"detected_language": "en",
"is_another_language": false
},
"serp_info": {
"se_type": "google",
"check_url": "https://www.google.com/search?q=phone%20app&num=100&hl=en&gl=US&gws_rd=cr&ie=UTF-8&oe=UTF-8&glp=1&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
"serp_item_types": [],
"se_results_count": 25270000000,
"last_updated_time": "2024-08-04 13:51:15 +00:00",
"previous_updated_time": "2024-06-22 23:19:03 +00:00"
},
"avg_backlinks_info": {
"se_type": "google",
"backlinks": 4502.4,
"dofollow": 2513.9,
"referring_pages": 3667.1,
"referring_domains": 984.5,
"referring_main_domains": 855.8,
"rank": 322.6,
"main_domain_rank": 814.6,
"last_updated_time": "2024-08-04 10:51:22 +00:00"
},
"search_intent_info": {
"se_type": "google",
"main_intent": "commercial",
"foreign_intent": [],
"last_updated_time": "2023-03-02 03:54:24 +00:00"
},
"keyword_info_normalized_with_bing": {
"last_updated_time": "2024-08-16 23:26:54 +00:00",
"search_volume": 4979,
"is_normalized": true,
"monthly_searches": []
},
"keyword_info_normalized_with_clickstream": {
"last_updated_time": "2024-08-11 20:06:52 +00:00",
"search_volume": 22200,
"is_normalized": true,
"monthly_searches": []
}
},
"depth": 1,
"related_keywords": []
}
]
}
]
}
]
}错误处理
建议对以下字段进行统一处理:
- 顶层
status_code - 顶层
status_message tasks[].status_codetasks[].status_message
完整错误码请参考 /v3/appendix/errors。 在生产环境中,建议建立统一的异常处理、重试与日志记录机制。
使用建议
- 需要快速扩词时,优调高
depth - 需要控制成本时,不要开启
include_clickstream_data - 需要分析 SERP 结构时,开启
include_serp_info - 需要去重并聚焦主词时,可结合
ignore_synonyms=true - 大规模拉取时,建议合
limit、offset、filters和order_by分批处理
实用场景
- 扩展池:以种子词为中心抓取“搜索”链路中的扩展词,快速补 SEO选题和投放词库。
- 筛选高价值长尾词:结合
search_volume、cpc、competition和keyword_difficulty过滤出更适合自然流量或广告投放的。 - 分析搜索意图结构:利用
search_intent_info区分信息型、商业型、交易型,优化页与落地页布局。 - 评估排名难度:通过
avg_backlinks_info与keyword_difficulty判断前 10 的难度,制定外链与策略。 - 洞察 SERP 版位机会:开启
include_serp_info后识别featured_snippet、local_pack、paid等结果类型,评估是否存在精选摘要、本地或广告位机会。