主题
网站查询(旧版)- /v3/dataforseo_labs/keywords_for_site/live
接口说明
该接口用于根据目标域名,返回与该网站主题的一组建议。每个可附带以下数据:
- 分类
- 最近一个月搜索量
- 平均点击成本(CPC)
- 竞争度
- 近月搜索趋势
- 可选的 SERP 信息
数据来源: 本平台数据库,按域名分组,并结合 Google Ads 数据与 SERP 数据补生成。 搜索逻辑: 基于性,查找与目标域名所属主题类别相近的。
例如,指定目标域名后,接口会返回一批与该站点业务、主题或受众意图相近的建议。
容性说明
该接口为**旧版(Legacy)**结构。 平台 API 已于 2022-03-19 更新了 Labs API 的请求与响应结构,但本接口仍继续支持旧版格式。
如需使用新版结构,可参考对应新版接口文档。
请求地址
POST https://api.seermartech.cn/v3/dataforseo_labs/keywords_for_site/live
计费说明
该接口按请求计费。 原文未提供固定单价,因此无法直接换算人民币。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
接口调用频率上限:每分钟最多 2000 次 API 调用
请求格式
- 请求方法:
POST - 编码格式:
JSON(UTF-8) - 请求体为 JSON 数组,格式如下:
json
[
{
"target": "apple.com",
"location_code": 2840,
"language_code": "en"
}
]请求参数
顶层任务对象字段
| 字段 | 类型 | 说明 |
|---|---|---|
target | string | 填。目标网站域名,不要 https:// 或 www. |
location_name | string | 地区名。未传 location_code 时填。location_name 与 location_code 二选一。例如:United Kingdom |
location_code | integer | 地区唯一 ID。未传 location_name 时填。location_name 与 location_code 二选一。例如:2840 |
language_name | string | 语言名。可选。传此字段时无需再传 language_code。忽略该字段则返回所有可用语言的数据。例如:English |
language_code | string | 语言编码。可选。传此字段时无需再传 language_name。忽略该字段则返回所有可用语言的数据。例如:en |
include_serp_info | boolean | 是否在每个中附带 SERP 数据。可选。设为 true 时,将返回 serp_info 对象。默认值:false |
include_subdomains | boolean | 是否将子域名纳分析范围。可选。设为 false 时忽略子域名。默认值:true |
limit | integer | 返回数量上限。可选。默认值:700,最大值:1000 |
offset | integer | 结果偏移量。可选。默认值:0。例如传 10 表示跳过前 10 条结果,从后续结果开始返回 |
offset_token | string | 用于翻页拉取后续结果的偏移令牌。可选。适用于单次请求需获取 10,000 条结果的场景。注意: 若传 offset_token,除 limit 外余参数将被忽略 |
filters | array | 结果过滤条件。可选。最多支持 8 个过滤条件,条件之间需通过 and / or 连接。支持操作符:<, <=, >, >=, =, <>, in, not_in, like, not_like。like 与 not_like 支持 % 通符。注意:不能按 relevance 过滤 |
order_by | array | 排序规则。可选。支持使用与 filters 相同的字段。排序方式:asc 升序、desc 降序。单次请求最多可设置 3 条排序规则 |
tag | string | 用户自定义任务标识。可选。最长 255 个字符。返回结果中会原样带回,便于业务侧请求与结果 |
地区与语言列表
可通过以下接口查询支持的地区与语言:
/v3/dataforseo_labs/locations_and_languages
过滤与排序说明
filters
- 可同时设置多个过滤条件,最多 8 个
- 条件之间使用逻辑运算符连接:
and/or - 支持的运算符:
<, <=, >, >=, =, <>, in, not_in, like, not_like
like/not_like支持%通任意长度字符串- 不可按
relevance字段过滤
示例:
json
[
"keyword_info.search_volume", ">", 1000,
"and",
["serp_info.keyword_difficulty", ">", 0]
]order_by
默认按 relevance 排序,以便优返回与目标网站最的。 relevance 是本平台使用的性标识:
- 可作为默认排序依据
- 不能作为过滤条件
- 不会出现在
result数组返回字段中
示例:
json
[
"keyword_info.search_volume,desc"
]多个排序规则示例:
json
[
"keyword_info.search_volume,desc",
"keyword_info.cpc,asc"
]响应结构
接口返回 JSON,顶层 tasks 数组。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码 |
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[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
target | string | 请求中的目标域名 |
location_code | integer | 请求中的地区代码 |
language_code | string | 请求中的语言代码 |
total_count | integer | 数据库中与请求的总结果数 |
items_count | integer | 当前返回的 items 数量 |
offset | integer | 当前偏移量 |
offset_token | string | 后续翻页请求使用的偏移令牌 |
items | array | 建议列表 |
items[] 结果字段说明
基础字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的建议 |
location_code | integer | 地区代码 |
language_code | string | 语言代码 |
keyword_info 数据
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 数据更新时间,UTC,格式:yyyy-mm-dd hh-mm-ss +00:00 |
competition | float | 竞争度,基于 Google Ads 数据,范围 0 到 1 |
cpc | float | 历史平均点击成本,单位 USD |
search_volume | integer | 平均月搜索量 |
categories | array | 产品/服务分类 |
monthly_searches | array | 最近 12 个月月度搜索量明细 |
monthly_searches[]
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份 |
month | integer | 月份 |
search_volume | integer | 当月平均搜索量 |
keyword_properties 属性
| 字段 | 类型 | 说明 |
|---|---|---|
core_keyword | string / null | 分组中的核心词。若为 null,表示数据库中无符合该归类条件的核心词 |
keyword_difficulty | integer | 难度,范围 0-100,表示自然搜索前 10 名的难度 |
impressions_info 展现量数据
该对象提供基于广告展现估算的指标,daily_impressions 相比传统搜索量可提供更精细的参考。 该对象统一以 bid=999 计算,用于尽量削弱账户差异因素影响。
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | 展现量数据更新时间,UTC |
bid | integer | 最大 CPC 出价,本接口固定用于估算的值为 999 |
match_type | string | 匹方式:exact、broad、phrase |
ad_position_min | float | 广告最小展示位置 |
ad_position_max | float | 广告最大展示位置 |
ad_position_average | float | 广告平均展示位置 |
cpc_min | float | 在 bid=999 条件下估算的最小 CPC,不是 CPC |
cpc_max | float | 在 bid=999 条件下估算的最大 CPC,不是 CPC |
cpc_average | float | 在 bid=999 条件下估算的平均 CPC,不是 CPC |
daily_impressions_min | float | 估算最小日展现量 |
daily_impressions_max | float | 估算最大日展现量 |
daily_impressions_average | float | 估算平均日展现量 |
daily_clicks_min | float | 估算最小日点击量 |
daily_clicks_max | float | 估算最大日点击量 |
daily_clicks_average | float | 估算平均日点击量 |
daily_cost_min | float | 估算最小日消耗,单位 USD |
daily_cost_max | float | 估算最大日消耗,单位 USD |
daily_cost_average | float | 估算平均日消耗,单位 USD |
说明: CPC 请使用
keyword_info.cpc字段;impressions_info.cpc_*为bid=999条件下的估算值。
bing_keyword_info Bing 数据
注意:Bing 数据适用于部分地区和语言。
| 字段 | 类型 | 说明 |
|---|---|---|
last_updated_time | string | Bing 数据更新时间,UTC |
search_volume | integer | Bing 最近一个月搜索量 |
monthly_searches | array | 按月的 Bing 搜索量明细 |
serp_info SERP 数据
若请求中未设置 include_serp_info=true,或数据库中不存在对应 SERP 数据,则该字段为 null。
| 字段 | 类型 | 说明 |
|---|---|---|
check_url | string | 搜索结果页直达链接,用于核验结果 |
serp_item_types | array | SERP 中出现的结果类型 |
se_results_count | string / integer | 搜索结果数量 |
keyword_difficulty | integer | 基于 SERP 计算的难度,范围 0-100 |
last_updated_time | string | 最新 SERP 数据更新时间,UTC |
previous_updated_time | string / null | 上一次 SERP 数据更新时间,UTC |
serp_item_types 可能值
answer_boxappcarouselmulti_carouselfeatured_snippetgoogle_flightsgoogle_reviewsimagesjobsknowledge_graphlocal_packmaporganicpaidpeople_also_askrelated_searchespeople_also_searchshoppingtop_storiestwittervideoeventsmention_carouselrecipestop_sightsscholarly_articlespopular_productspodcastsquestions_and_answersfind_results_onstocks_box
注意:结果明细通常返回
organic、paid、featured_snippet、local_pack。
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/dataforseo_labs/keywords_for_site/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target": "apple.com",
"location_code": 2840,
"language_code": "en",
"include_serp_info": true,
"include_subdomains": true,
"filters": ["serp_info.keyword_difficulty", ">", 0],
"order_by": ["keyword_info.search_volume,desc"],
"limit": 5
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/dataforseo_labs/keywords_for_site/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
payload = [
{
"target": "apple.com",
"location_name": "United States",
"language_name": "English",
"include_serp_info": True,
"include_subdomains": True,
"filters": ["serp_info.keyword_difficulty", ">", 0],
"order_by": ["keyword_info.search_volume,desc"],
"limit": 5
}
]
response = requests.post(url, json=payload, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const payload = [
{
target: "apple.com",
location_code: 2840,
language_code: "en",
include_serp_info: true,
include_subdomains: true,
filters: ["serp_info.keyword_difficulty", ">", 0],
order_by: ["keyword_info.search_volume,desc"],
limit: 5
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/dataforseo_labs/keywords_for_site/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: payload
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});响应示例
json
{
"version": "0.1.20220214",
"status_code": 20000,
"status_message": "Ok.",
"time": "9.3410 sec.",
"cost": 0.0105,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "dataforseo_labs",
"function": "keywords_for_site",
"target": "apple.com",
"language_name": "English",
"location_code": 2840,
"include_serp_info": true,
"include_subdomains": true,
"filters": ["serp_info.keyword_difficulty", ">", 0],
"order_by": ["keyword_info.search_volume,desc"],
"limit": 5
},
"result": [
{
"items": [
{
"keyword": "targeted",
"location_code": 2840,
"language_code": "en",
"keyword_info": {
"last_updated_time": "2022-01-25 06:49:14 +00:00",
"competition": 0.017980228292144376,
"cpc": 0.145384,
"search_volume": 37200000
},
"keyword_properties": {
"core_keyword": null,
"keyword_difficulty": 70
},
"impressions_info": {
"last_updated_time": "2022-02-05 05:00:33 +00:00",
"bid": 999,
"match_type": "exact",
"ad_position_min": 1.59,
"ad_position_max": 1,
"ad_position_average": 1.44,
"cpc_min": 41.5,
"cpc_max": 50.72,
"cpc_average": 46.11,
"daily_impressions_min": 0.91,
"daily_impressions_max": 1.12,
"daily_impressions_average": 1.02,
"daily_clicks_min": 0.05,
"daily_clicks_max": 0.06,
"daily_clicks_average": 0.06,
"daily_cost_min": 2.39,
"daily_cost_max": 2.92,
"daily_cost_average": 2.65
},
"bing_keyword_info": {
"last_updated_time": "2022-02-05 01:54:40 +00:00",
"search_volume": 4470
},
"serp_info": {
"check_url": "https://www.google.com/search?q=targeted&num=100&hl=en&gl=US&gws_rd=cr&ie=UTF-8&oe=UTF-8&uule=w+CAIQIFISCQs2MuSEtepUEUK33kOSuTsc",
"serp_item_types": ["organic", "paid"],
"se_results_count": 3080000000,
"keyword_difficulty": 70,
"last_updated_time": "2022-01-13 20:29:40 +00:00",
"previous_updated_time": null
}
}
]
}
]
}
]
}错误处理
接口会返回通用状态码和任务状态码:
- 顶层:
status_code、status_message - 任务级:
tasks[].status_code、tasks[].status_message
建议业务侧建立统一异常处理机制,覆盖以下场景:
- 参数缺失或参数格式错误
- 地区/语言无效
- 过滤或排序字段非法
- 认证失败
- 请求频率限
- 异步任务执行失败或时
完整错误码体系请参考 /v3/appendix/errors。
使用建议
优使用默认性排序 默认
relevance排序更适合获取与目标网站最的建议。需要更多结果时使用
offset_token当需要连续拉取大量结果时,优使用offset_token,可降低时风险。SERP 数据按需开启 若做扩展,可
include_serp_info以减少返回体积;若需要评估竞争环境,再开启该字段。过滤条件不要使用
relevancerelevance用于排序,不可用于过滤,也不会出现在结果字段中。
实用场景
- 挖掘站点主题词:目标域名,批量获取与网站主题高度的,用于规划、栏目扩展和词库建设。
- 评估竞品覆盖方向:竞品官网域名,查看分布,帮助识别对方重点覆盖的搜索主题与流量。
- 筛选高价值:结合
search_volume、cpc、competition、keyword_difficulty过滤排序,快速定位商业价值和优化机会的词。 - 分析 SERP 竞争格局:开启
include_serp_info后,可判断是否存在featured_snippet、local_pack、paid等结果类型,制定 SEO 与 SEM 策略。 - 构建多地区地图:切换
location_code和language_code,比较不同国家/语言下的网站差异,为化 SEO 提供依据。