Skip to content

域名分类分布查询(实时)

POST /v3/dataforseo_labs/google/categories_for_domain/live

接口说明

该接口用于返回某个域名或子域名在 Google 搜索中已有排名所对应的产品/服务分类。

除分类列表外,接口还会返回该域名在各分类下的整体排名表现与流量估算数据自然搜索、付费搜索,以及部分 SERP素类型的聚合指标。

  • 接口路径:/v3/dataforseo_labs/google/categories_for_domain/live
  • 请求方式:POST
  • 请求地址:https://api.seermartech.cn/v3/dataforseo_labs/google/categories_for_domain/live

数据更新频率

数据按周更新。最新更新时间可通过 /v3/dataforseo_labs/status 接口查询。

计费与并发限制

本接口按请求计费。参考价请以游返回为准,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

并发与频率限制:

  • 每分钟最多可发送 2000 次 API 调用
  • 同时并发请求上限为 30

请求体格式

所有 POST 数据使用 UTF-8 编码的 JSON 格式,请求体为 JSON 数组:

json
[
 {
 "target": "example.com",
 "location_code": 2840,
 "language_code": "en"
 }
]

请求参数

字段名类型说明
targetstring目标域名或子域名。填。填写时不要 https://www.
location_namestring地区完整名称。未传 location_code 时填。location_namelocation_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区列表。例如:United Kingdom
location_codeinteger地区编码。未传 location_name 时填。location_namelocation_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用地区编码。例如:2840
language_namestring语言完整名称。未传 language_code 时填。language_namelanguage_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言列表。例如:English
language_codestring语言编码。未传 language_name 时填。language_namelanguage_code 二选一。可通过 /v3/dataforseo_labs/locations_and_languages 获取可用语言编码。例如:en
include_subcategoriesboolean是否在搜索中子分类。可选。设为 false 时忽略子分类。默认值:false
include_clickstream_databoolean是否在结果中基于点击流的指标。可选。设为 true 后,响应中将返回 clickstream_etvclickstream_gender_distributionclickstream_age_distribution。默认值:false。启用后请求费用翻倍
historical_serp_modestring数据筛选模式。可选。live:返回当前仍有排名的 SERP 数据;lost:返回此前有排名、最近一次检查已丢失排名的 SERP 数据;all:返回以上两类数据。默认值:live
item_typesarray指定返回的搜索结果类型。可选。用于控制响应中哪些 SERP 类型的数据。若数组中非 organic 类型,结果将按数组中第一个类型排序;且无法按未的结果类型进行排序与过滤
filtersarray结果过滤条件数组。可选。最多支持 8 个过滤条件。条件之间需使用逻辑运算符 and / or 连接。支持操作符:regexnot_regex<<=>>==<>innot_in
order_byarray排序规则。可选。可使用与 filters 相同的字段路径。排序方式:asc 升序,desc 降序。单次请求最多支持 3 条排序规则。若 item_types含非 organic 类型,则结果按 item_types 数组第一个类型排序
limitinteger返回的最大分类数量。可选。默认值:100,最大值:1000
offsetinteger结果偏移量。可选。默认值:0。例如传 10 时,将跳过前 10 个分类并从后续结果开始返回
tagstring用户自定义任务标识。可选,最长 255 个字符。可用于在响应 data 对象中回传并匹业务任务

过滤与排序说明

filters 支持嵌套逻辑条件。示例:

json
[
 ["metrics.organic.count", ">=", 100],
 "and",
 [
 ["metrics.organic.pos_1", ">", 0],
 "or",
 ["metrics.paid.count", "in", [1, 2]]
 ]
]

order_by 示例:

json
[
 ["metrics.organic.etv", "desc"],
 ["metrics.organic.count", "desc"]
]

更多字段路径可参考 /v3/dataforseo_labs/filters

返回结果结构

接口返回 JSON 编码数据,顶层 tasks 数组。

顶层响应字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码,完整列表见 /v3/appendix/errors
status_messagestring通用状态信息
timestring执行时间,单位秒
costfloat本次请求总费用,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000
status_messagestring任务状态说明
timestring任务执行时间,单位秒
costfloat单任务费用,单位 USD
result_countintegerresult 数组中的数量
patharray请求路径
dataobject原样回传请求参数
resultarray获取结果数组

result[] 字段

字段名类型说明
se_typestring搜索引擎类型
targetstring请求中的目标域名或子域名
location_codeinteger请求中的地区编码
language_codestring请求中的语言编码
total_countinteger数据库中与请求匹的总结果数
items_countintegeritems 数组返回的结果数
itemsarray分类及对应排名数据

items[] 字段

字段名类型说明
se_typestring搜索引擎类型
categoriesarray产品/服务分类列表。完整分类单可向平台侧获取
metricsobject该域名或子域名在该分类下的聚合排名与流量数据

metrics 指标说明

metrics 下通常以下对象:

  • organic:自然搜索数据
  • paid:付费搜索数据
  • featured_snippet:精选摘要结果数据
  • local_pack:本地结果数据

上述对象字段结构一致,核心字段如下:

字段名类型说明
pos_1integer排名第 1 位的结果数量
pos_2_3integer排名第 2-3 位的结果数量
pos_4_10integer排名第 4-10 位的结果数量
pos_11_20integer排名第 11-20 位的结果数量
pos_21_30integer排名第 21-30 位的结果数量
pos_31_40integer排名第 31-40 位的结果数量
pos_41_50integer排名第 41-50 位的结果数量
pos_51_60integer排名第 51-60 位的结果数量
pos_61_70integer排名第 61-70 位的结果数量
pos_71_80integer排名第 71-80 位的结果数量
pos_81_90integer排名第 81-90 位的结果数量
pos_91_100integer排名第 91-100 位的结果数量
etvfloat预估流量。按 CTR 与搜索量计算得到的月度预估流量
countinteger含该域名/子域名的 SERP 总数
estimated_paid_traffic_costfloat将该流量等价转化为付费投放时的预估月成本,单位 USD
is_newinteger新增排名数量
is_upinteger排名上升的数量
is_downinteger排名下降的数量
is_lostinteger丢失排名的数量
clickstream_etvinteger基于点击流数据计算的预估流量在 include_clickstream_data=true 时返回
clickstream_gender_distributionobject点击流数据中的性别分布在 include_clickstream_data=true 时返回
clickstream_age_distributionobject点击流数据中的年龄分布在 include_clickstream_data=true 时返回

性别分布字段

字段名类型说明
femaleinteger女性用户数量
maleinteger男性用户数量

年龄分布字段

字段名类型说明
18-24integer18-24 岁用户数量
25-34integer25-34 岁用户数量
35-44integer35-44 岁用户数量
45-54integer45-54 岁用户数量
55-64integer55-64 岁用户数量

请求示例

cURL

bash
curl --location --request POST "https://api.seermartech.cn/v3/dataforseo_labs/google/categories_for_domain/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
 {
 "target": "example.com",
 "language_name": "English",
 "location_code": 2840,
 "filters": [
 ["metrics.organic.count", ">=", 100],
 "and",
 [
 ["metrics.organic.pos_1", ">", 0],
 "or",
 ["metrics.paid.count", "in", [1, 2]]
 ]
 ],
 "limit": 3
 }
]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/dataforseo_labs/google/categories_for_domain/live"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}
data = [
 {
 "target": "example.com",
 "location_name": "United States",
 "language_name": "English",
 "filters": [
 ["metrics.organic.count", ">=", 100],
 "and",
 [
 ["metrics.organic.pos_1", ">", 0],
 "or",
 ["metrics.paid.count", "in", [1, 2]]
 ]
 ],
 "limit": 3
 }
]

response = requests.post(url, headers=headers, json=data)
print(response.json)

TypeScript

typescript
import axios from "axios";

const postData = [
 {
 target: "example.com",
 location_name: "United States",
 language_name: "English",
 filters: [
 ["metrics.organic.count", ">=", 100],
 "and",
 [
 ["metrics.organic.pos_1", ">", 0],
 "or",
 ["metrics.paid.count", "in", [1, 2]]
 ]
 ],
 limit: 3
 }
];

axios({
 method: "post",
 url: "https://api.seermartech.cn/v3/dataforseo_labs/google/categories_for_domain/live",
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
 },
 data: postData
})
 .then((response) => {
 console.log(response.data);
 })
 .catch((error) => {
 console.error(error);
 });

响应示例

json
{
 "version": "0.1.20240514",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.2802 sec.",
 "cost": 0.0103,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "dataforseo_labs",
 "function": "categories_for_domain",
 "se_type": "google",
 "target": "example.com",
 "language_code": "en",
 "location_name": "United States",
 "item_types": [],
 "limit": 3
 },
 "result": [
 {
 "metrics": {
 "organic": {
 "pos_1": 13,
 "pos_2_3": 15,
 "pos_4_10": 139,
 "pos_11_20": 186,
 "pos_21_30": 147,
 "pos_31_40": 138,
 "pos_41_50": 149,
 "pos_51_60": 142,
 "pos_61_70": 135,
 "pos_71_80": 132,
 "pos_81_90": 128,
 "pos_91_100": 107,
 "etv": 5467.5736870300025,
 "count": 1431,
 "estimated_paid_traffic_cost": 28019.096953213215,
 "is_new": 491,
 "is_up": 572,
 "is_down": 315,
 "is_lost": 0,
 "clickstream_etv": 329.78355899999997,
 "clickstream_gender_distribution": {
 "female": 34,
 "male": 65
 },
 "clickstream_age_distribution": {
 "18-24": 15,
 "25-34": 39,
 "35-44": 41,
 "45-54": 3,
 "55-64": 0
 }
 },
 "paid": {
 "pos_1": 8,
 "pos_2_3": 3,
 "pos_4_10": 1,
 "pos_11_20": 0,
 "pos_21_30": 0,
 "pos_31_40": 0,
 "pos_41_50": 0,
 "pos_51_60": 0,
 "pos_61_70": 0,
 "pos_71_80": 0,
 "pos_81_90": 0,
 "pos_91_100": 0,
 "etv": 406.72699707746506,
 "count": 12,
 "estimated_paid_traffic_cost": 3098.8196816444397,
 "is_new": 10,
 "is_up": 0,
 "is_down": 1,
 "is_lost": 0,
 "clickstream_etv": 255.70439999999996,
 "clickstream_gender_distribution": {
 "female": 35,
 "male": 65
 },
 "clickstream_age_distribution": {
 "18-24": 0,
 "25-34": 62,
 "35-44": 37,
 "45-54": 0,
 "55-64": 0
 }
 },
 "featured_snippet": {
 "pos_1": 0,
 "pos_2_3": 0,
 "pos_4_10": 0,
 "pos_11_20": 0,
 "pos_21_30": 0,
 "pos_31_40": 0,
 "pos_41_50": 0,
 "pos_51_60": 0,
 "pos_61_70": 0,
 "pos_71_80": 0,
 "pos_81_90": 0,
 "pos_91_100": 0,
 "etv": 0,
 "count": 0,
 "estimated_paid_traffic_cost": 0,
 "is_new": 0,
 "is_up": 0,
 "is_down": 0,
 "is_lost": 0,
 "clickstream_etv": 0,
 "clickstream_gender_distribution": {
 "female": 0,
 "male": 0
 },
 "clickstream_age_distribution": {
 "18-24": 0,
 "25-34": 0,
 "35-44": 0,
 "45-54": 0,
 "55-64": 0
 }
 },
 "local_pack": {
 "pos_1": 0,
 "pos_2_3": 0,
 "pos_4_10": 0,
 "pos_11_20": 0,
 "pos_21_30": 0,
 "pos_31_40": 0,
 "pos_41_50": 0,
 "pos_51_60": 0,
 "pos_61_70": 0,
 "pos_71_80": 0,
 "pos_81_90": 0,
 "pos_91_100": 0,
 "etv": 0,
 "count": 0,
 "estimated_paid_traffic_cost": 0,
 "is_new": 0,
 "is_up": 0,
 "is_down": 0,
 "is_lost": 0,
 "clickstream_etv": 0,
 "clickstream_gender_distribution": {
 "female": 0,
 "male": 0
 },
 "clickstream_age_distribution": {
 "18-24": 0,
 "25-34": 0,
 "35-44": 0,
 "45-54": 0,
 "55-64": 0
 }
 }
 }
 }
 ]
 }
 ]
}

状态码与错误处理

  • 顶层 status_code 表示本次请求整体状态
  • tasks[].status_code 表示单个任务的执行状态
  • 建议同时处理 HTTP 状态码、顶层状态码与任务状态码
  • 完整错误码列表可参考 /v3/appendix/errors

使用注意事项

  1. target 支持域名或子域名,不要协议头和 www.
  2. location_name/location_code须二选一传
  3. language_name/language_code须二选一传
  4. include_clickstream_data=true 会导致请求费用翻倍
  5. item_types含非 organic 类型时,排序行为会受数组第一个影响
  6. 若需分页,请结合 limitoffset 使用

实用场景

  • 识别重点业务分类:查看某域名主要在哪些产品或服务分类中获得搜索,用于明确 SEO 主战场
  • 筛选高价值分类:结合 etvestimated_paid_traffic_cost 找出自然流量价值最高的分类,优与页面优化资源
  • 监控分类级排名波动:通过 is_newis_upis_downis_lost 观察各分类的可见性变化,快速定位增长或下滑板块
  • 分析自然与付费覆盖差异:对比 organicpaid 指标,判断品牌在某类目中更依赖 SEO 还是广告投放
  • 研究受众结构:启用点击流数据后,基于性别与年龄分布评估不同分类对应的人群特征,选题与落地页策略

统一入口:官网 · LLM API · 控制台