主题
获取 WP V2 SERP 高级结果
使用 GET /v3/serp/wp/v2/task_get/advanced/$id 按任务 ID 获取已完成的 WP V2 SERP 高级结果。
text
GET https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/{id}该接口返回任务采集到的完整搜索结果页(SERP)结构自然结果、广告、精选摘要、知识图谱、图片、购物、本地结果、AI 概览及可能出现的 SERP素。
任务在提交时计费。任务完成后的 30 天可重复获取结果。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务唯一标识符,UUID 格式。任务完成后 30 天可使用该 ID 获取结果。 |
请求示例
cURL
bash
curl --request GET \
"https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/02261816-2027-0066-0000-c27d02864073" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02261816-2027-0066-0000-c27d02864073"
response = requests.get(
f"https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/{task_id}",
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
timeout=60
)
response.raise_for_status()
data = response.json()
# 检查整体响应状态
if data["status_code"] == 20000:
task = data["tasks"][0]
# 任务级状态码应小于 40000,且 result 不为空
if task["status_code"] < 40000 and task["result"]:
serp_result = task["result"][0]
print(serp_result["keyword"])
print(serp_result["items"])
else:
print(f"任务错误:{task['status_code']} - {task['status_message']}")
else:
print(f"请求错误:{data['status_code']} - {data['status_message']}")TypeScript
typescript
const taskId = "02261816-2027-0066-0000-c27d02864073";
const response = await fetch(
`https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/${taskId}`,
{
method: "GET",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
const data = await response.json();
if (data.status_code !== 20000) {
throw new Error(`${data.status_code}: ${data.status_message}`);
}
const task = data.tasks?.[0];
if (!task || task.status_code >= 40000 || !task.result) {
throw new Error(`${task?.status_code}: ${task?.status_message}`);
}
const serpResult = task.result[0];
console.log(serpResult.keyword);
console.log(serpResult.items);响应结构
接口返回 JSON 对象,顶层 tasks 为任务数组。每个任务对应一次已提交的 SERP 查询。
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 整体响应状态码。20000 表示请求成功。 |
status_message | string | 整体响应状态说明。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
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 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中结果对象数量。 |
path | array | 用于获取该任务结果的接口路径。 |
data | object | 创建任务时提交的原始参数。 |
result | array | SERP 结果数组。 |
> 建议同时处理顶层 status_code 和任务级 tasks[].status_code。任务级状态码大于或等于 40000 时,应视为任务处理失败或结果不可用。
tasks[].data 任务参数回显
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称。 |
function | string | 执行的方法,例如 task_get。 |
se | string | 搜索引擎标识。 |
se_type | string | 搜索类型。 |
keyword | string | 查询。URL 编码会被解码,+ 会转换为空格。 |
location_code | integer | 地区代码。 |
location_name | string | 地区名称。 |
language_code | string | 语言代码。 |
language_name | string | 语言名称。 |
device | string | 设备类型。 |
os | string | 操作系统。 |
tag | string | 提交任务时设置的自定义标签。 |
result[] 搜索结果对象
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 实查询。 |
type | string | 搜索引擎类型。 |
se_domain | string | 搜索引擎域名。 |
location_code | integer | 地区代码。 |
language_code | string | 语言代码。 |
check_url | string | 搜索结果页直达链接,可用于核验结果。 |
datetime | string | 获取结果的 UTC 时间,格式为 yyyy-mm-dd hh:mm:ss +00:00。 |
spell | object | 搜索引擎自动纠错信息;未触发时为 null。 |
refinement_chips | object | 搜索细化标签。 |
item_types | array | 当前 SERP 中出现的结果类型。 |
se_results_count | integer | 搜索引擎显示的结果总数。 |
pages_count | integer | 已获取的搜索结果页数。 |
items_count | integer | items 数组中的数量。 |
items | array | SERP 中的结果。 |
自动纠错 spell
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 自动纠正后的。 |
type | string | 自动纠错类型。 |
spell.type 可能值:
did_you_mean:您是不是想搜索;showing_results_for:已显示纠正后的结果;no_results_found_for:纠正前无结果;including_results_for:已纠正后的结果。
搜索细化标签 refinement_chips
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 refinement_chips。 |
xpath | string | 素的 XPath。 |
items | array | 细化标签列表。 |
items[] 及 options[] 通常以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 分别为 refinement_chips_element 或 refinement_chips_option。 |
title | string | 标签标题。 |
url | string | 带细化条件的搜索 URL。 |
domain | string | SERP 中显示的域名。 |
通用 SERP素字段
items[] 中每个根据 type 表示不同的 SERP 功能。大多数以下基础字段。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | SERP素类型。 |
rank_group | integer | 同类的排名。不同类型不计该排名。 |
rank_absolute | integer | 在当前 SERP 所有中的绝对位置。 |
page | integer | 素所在的搜索结果页码。 |
position | string | 页面布局位置,可能为 left 或 right。 |
xpath | string | 素在页面中的 XPath。 |
rectangle | object | 素在页面截图中的矩形坐标;未启用 calculate_rectangles 时为 null。 |
矩形坐标 rectangle
| 字段 | 类型 | 说明 |
|---|---|---|
x | integer | 素左上角相对页面左上角的 X 坐标。 |
y | integer | 素左上角相对页面左上角的 Y 坐标。 |
width | integer | 素宽度,单位为像素。 |
height | integer | 素高度,单位为像素。 |
图片对象 images[]
图片字段可能出现在自然结果、广告、精选摘要、AI 概览、知识图谱等多类中。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 通常为 images_element。 |
alt | string | 图片 Alt 文本。 |
url | string | 图片页面或原始资源 URL。 |
image_url | string | 图片 URL。原始资源不可用时可能返回平台缓存地址。 |
评分对象 rating
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分体系,可能为 Max5、Percents、CustomMax。 |
value | float | 当前评分值。 |
votes_count | integer | 评分或评论数量。 |
rating_max | integer | 对应评分体系的最大值。 |
价格对象 price
| 字段 | 类型 | 说明 |
|---|---|---|
current | float | 当前价格。 |
regular | float | 原价或无折扣价格。 |
max_value | float | 价格区间中的最高值。 |
currency | string | 价格币种的 ISO 代码。 |
is_price_range | boolean | 是否为价格区间。 |
displayed_price | string | 搜索结果页展示的原始价格文本。 |
链接对象 links[]
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 通常为 link_element。 |
title | string | 链接标题或锚文本。 |
description | string | 链接说明。 |
url | string | 链接 URL。 |
domain | string | 链接目标域名。 |
xpath | string | 链接 XPath。 |
支持的 SERP素类型
item_types 和 items[].type 可能返回以下类型:
text
answer_box
app
carousel
multi_carousel
featured_snippet
google_flights
google_reviews
third_party_reviews
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
recipes
top_sights
scholarly_articles
popular_products
questions_and_answers
find_results_on
stocks_box
commercial_units
local_services
google_hotels
math_solver
currency_box
product_considerations
short_videos
refine_products
perspectives
discussions_and_forums
compare_sites
ai_overview以下章节说明常用和重点的字段结构。响应返回当次 SERP 中真实出现的。
自然结果 organic
自然搜索结果,type 固定为 organic。
| 字段 | 类型 | 说明 |
|---|---|---|
domain | string | 结果域名。 |
title | string | 结果标题。 |
url | string | 结果目标 URL。 |
cache_url | string | 页面缓存版本 URL。 |
related_search_url | string | 相似或站点搜索 URL。 |
breadcrumb | string | 搜索结果中的面屑。 |
website_name | string | 搜索结果显示的网站名称。 |
is_image | boolean | 是否图片。该标记可能不再展示。 |
is_video | boolean | 是否视频。该标记可能不再展示。 |
is_featured_snippet | boolean | 是否为精选摘要。该标记可能不再展示。 |
is_malicious | boolean | 是否被标记为恶意站点。该标记可能不再展示。 |
is_web_story | boolean | 是否为 Web Story。该标记可能不再展示。 |
checks | array | 已识别的结果属性;无属性时为 null。 |
description | string | 摘要描述。 |
pre_snippet | string | 位于摘要前的附加信息。 |
extended_snippet | string | 位于摘要后的扩展信息。 |
images | array | 结果图片;无图片时为 null。 |
amp_version | boolean | 是否存在 AMP 页面版本。 |
rating | object | 评分信息;无评分时为 null。 |
price | object | 价格信息;无价格时为 null。 |
highlighted | array | 摘要中加粗高亮的词语。 |
links | array | 附加站点链接;无链接时为 null。 |
faq | object | 常见问题扩展。已废弃,始终为 null。 |
extended_people_also_search | array | 点击结果再返回后出现的搜索。 |
about_this_result | object | “此结果”信息。已废弃,始终为 null。 |
related_result | array | 同域名下合并展示的结果。 |
timestamp | string | 页面发布或索引时间,UTC 格式。 |
checks 可能:
text
is_image
is_video
is_featured_snippet
amp_version
is_malicious
is_web_story
is_highly_cited> 如需将同域结果拆分为独立的 organic素,应在创建任务时将 group_organic_results 设置为 false。
付费结果 paid
广告结果,type 固定为 paid。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 广告标题。 |
domain | string | 广告目标域名。 |
website_name | string | 广告展示的网站名称。 |
description | string | 广告描述。 |
url | string | 广告目标 URL。 |
breadcrumb | string | 广告面屑。 |
images | array | 广告图片。 |
highlighted | array | 描述中加粗高亮的词。 |
extra.ad_aclk | string | 广告标识符。 |
description_rows | array | 扩展描述行。 |
links | array | 广告附加链接。 |
price | object | 广告中的商品或服务价格。 |
rating | object | 广告评分。 |
轮播
carousel
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 轮播标题。 |
items | array | 轮播项。 |
carousel.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 carousel_element。 |
title | string | 项目标题。 |
subtitle | string | 项目副标题。 |
image_url | string | 项目图片 URL。 |
multi_carousel
| 字段 | 类型 | 说明 |
|---|---|---|
items | array | 多轮播基础项目。 |
multi_carousel_snippets | array | 多轮播片段。 |
multi_carousel_snippets[]:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 multi_carousel_snippet。 |
title | string | 项目标题。 |
subtitle | string | 项目副标题。 |
image_url | string | 图片 URL。 |
答案框与精选摘要
answer_box
| 字段 | 类型 | 说明 |
|---|---|---|
text | array | 答案框文本。 |
links | array | 答案框链接。 |
featured_snippet
| 字段 | 类型 | 说明 |
|---|---|---|
domain | string | 来源域名。 |
title | string | 来源页面标题。 |
featured_title | string | 精选摘要显示的标题。 |
description | string | 精选摘要。 |
timestamp | string | 发布时间或索引时间。 |
url | string | 来源 URL。 |
images | array | 图片。 |
table | object | 摘要中的表格。 |
table:
| 字段 | 类型 | 说明 |
|---|---|---|
table_header | array | 表头。 |
table_content | array | 表格行数据。 |
搜索与用户问题
related_searches
| 字段 | 类型 | 说明 |
|---|---|---|
items | array | 与初始查询的。 |
people_also_search
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 模块标题。 |
items | array | 用户也搜索的热门。 |
people_also_ask
“用户还问”模块。
| 字段 | 类型 | 说明 |
|---|---|---|
items | array | 问题列表。 |
people_also_ask.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 people_also_ask_element。 |
title | string | 问题文本。 |
seed_question | string | 触发展开问题的原始问题。 |
xpath | string | 问题 XPath。 |
expanded_element | array | 展开后的回答。 |
展开可能页面标题、URL、域名、摘要、图片、表格,以及 AI 概览类型。
本地、地图与结果
local_pack
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 本地商户名称。 |
description | string | 商户描述、距离、营业信息等。 |
domain | string | 商户域名。 |
phone | string | 电话号码。 |
booking_url | string | 预订页面 URL。 |
url | string | 商户 URL。 |
is_paid | boolean | 是否为付费展示。 |
rating | object | 商户评分。 |
cid | string | 本地商户唯一标识。 |
hotels_pack
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 店模块标题。 |
date_from | string | 住日期,格式 yyyy-mm-dd。 |
date_to | string | 离店日期,格式 yyyy-mm-dd。 |
items | array | 店列表。 |
hotels_pack.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 店名称。 |
desription | string | 店描述。注意字段名保持为 desription。 |
hotel_identifier | string | 店唯一标识。 |
domain | string | 域名。 |
url | string | 店页面 URL。 |
is_paid | boolean | 是否为广告。 |
price | object | 指定日期的住宿价格。 |
rating | object | 店评分。 |
google_hotels
| 字段 | 类型 | 说明 |
|---|---|---|
hotel_identifier | string | 店唯一标识。 |
url | string | 店页面 URL。 |
cid | string | 本地商户唯一标识。 |
map
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 地图模块标题。 |
url | string | 地图 URL。 |
local_services
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 本地服务模块标题。 |
url | string | 模块 URL。 |
domain | string | 域名。 |
items | array | 本地服务商列表。 |
local_services.items[]含 title、url、domain、description、rating、profile_image_url 等字段。
知识图谱 knowledge_graph
知识图谱在移动端可能被 SERP素拆分。因此同一结果页中可能返回多个 knowledge_graph素。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 知识图谱标题。 |
subtitle | string | 副标题或实体分类。 |
description | string | 实体描述。 |
card_id | string | 知识图谱卡片 ID。 |
url | string | 实体 URL。 |
image_url | string | 实体主图 URL。 |
logo_url | string | 实体徽标 URL。 |
cid | string | 本地实体唯一标识。 |
items | array | 知识图谱中的子项目。 |
knowledge_graph.items[] 可能以下子类型:
type | 说明 |
|---|---|
knowledge_graph_images_item | 图片区域。 |
knowledge_graph_list_item | 列表区域。 |
knowledge_graph_description_item | 描述文本区域。 |
knowledge_graph_row_item | 属性行,例如出生日期、地址等。 |
knowledge_graph_carousel_item | 横向轮播区域。 |
knowledge_graph_part_item | 信息分区。 |
knowledge_graph_expanded_item | 展开信息区域。 |
knowledge_graph_shopping_item | 购物信息区域。 |
knowledge_graph_hotels_booking_item | 店预订信息区域。 |
knowledge_graph_ai_overview_item | 知识图谱的 AI 概览区域。 |
知识图谱子项目通常以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 子项目标题。 |
data_attrid | string | 搜索页面定义的数据属性 ID。 |
text | string | 子项目文本。 |
link | object | 链接。 |
links | array | 链接列表。 |
items | array | 嵌套子。 |
expanded_element | array | 展开。 |
table | object | 表格。 |
知识图谱桌面结果中的部分子项目,rank_group 与 rank_absolute 可能固定为 0。
AI 概览 ai_overview
AI 概览的 type 为 ai_overview。如创建任务时未启用异步 AI加载,返回的可能来自缓存或不完整。
| 字段 | 类型 | 说明 |
|---|---|---|
asynchronous_ai_overview | boolean | 是否异步加载。true 表示异步加载,false 表示从缓存加载。 |
markdown | string | AI 概览,Markdown 格式。 |
items | array | AI 概览块。 |
references | array | AI 概览引用来源。 |
AI 概览的 items[] 可能:
type | 说明 |
|---|---|
ai_overview_element | 普通块。 |
ai_overview_video_element | 视频块。 |
ai_overview_table_element | 表格块。 |
ai_overview_expanded_element | 可展开块。 |
ai_overview_element
| 字段 | 类型 | 说明 |
|---|---|---|
position | string | 页面位置。 |
title | string | 标题。 |
text | string | 文本。 |
markdown | string | Markdown 格式。 |
links | array | 引用链接。 |
images | array | 图片。 |
references | array | 参考来源。 |
ai_overview_video_element
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 视频标题。 |
snippet | string | 视频补说明。 |
url | string | 视频 URL。 |
domain | string | 视频托管域名。 |
image_url | string | 视频缩略图 URL。 |
source | string | 视频来源。 |
date | string | 发布或索引日期文本。 |
timestamp | string | UTC 时间。 |
ai_overview_table_element
| 字段 | 类型 | 说明 |
|---|---|---|
markdown | string | Markdown 表格。 |
table.table_header | array | 表头。 |
table.table_content | array | 表格行数据。 |
references | array | 表格引用来源。 |
ai_overview_expanded_element
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 展开标题。 |
text | string | 展开文本。 |
components | array | 组件列表。 |
references | array | 引用来源。 |
AI 概览引用 references[]
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 ai_overview_reference。 |
source | string | 引用来源名称或标题。 |
domain | string | 引用来源域名。 |
url | string | 引用页面 URL。 |
title | string | 引用页面标题。 |
text | string | 用于生成 AI的引用文本片段。 |
图片、购物与商品结果
images
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 图片模块标题。 |
url | string | 图片搜索结果链接。 |
items | array | 图片列表。 |
related_image_searches | array | 图片搜索。已废弃,始终为 null。 |
shopping
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 购物模块标题。 |
items | array | 商品列表。 |
shopping.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 商品标题。 |
price | object | 商品价格。 |
source | string | 商品信息来源。 |
description | string | 商品描述。 |
marketplace | string | 商城或商户账号提供方。 |
marketplace_url | string | 商城商品页 URL。 |
url | string | 商品 URL。 |
rating | object | 商品评分。 |
popular_products
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 热门商品模块标题。 |
items | array | 商品列表。 |
popular_products.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 商品标题。 |
url | string | 商品页面 URL。 |
domain | string | 商品页域名。 |
description | string | 商品说明。 |
more_sellers | boolean | 是否有多个卖家。 |
seller | string | 卖家名称。 |
image_url | string | 商品图片 URL。 |
price | object | 商品价格。 |
rating | object | 商品评分。 |
product_identifiers | object | 商品标识符。 |
product_identifiers 可能:
| 字段 | 类型 | 说明 |
|---|---|---|
product_id | string | 商品唯一标识。 |
data_docid | string | SERP 数据唯一标识。 |
gid | string | 局商品标识。 |
commercial_units
商业商品单。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 模块标题。 |
items | array | 商业商品列表。 |
商品项 title、url、domain、price、source 和 rating。
refine_products
商品细化筛选模块。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 模块标题。 |
items | array | 细化选项。 |
refine_products.items[]:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 筛选项名称。 |
image_url | string | 筛选项图片。 |
keyword | string | 点击筛选项后的搜索词。 |
refine_type | string | 筛选类型,例如品牌筛选。 |
xpath | string | 素 XPath。 |
product_considerations
商品购买指南或选购建议模块。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 购买指南标题。 |
items | array | 考量因素列表。 |
items[] 可:
title:考量因素标题;consideration_category:考量类别;expanded_element:展开后的建议、来源页面、搜索;product_considerations_ai_overview_expanded_element:AI 概览形式的展开。
##与媒体
top_stories
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 新闻模块标题。 |
items | array | 新闻条目。 |
新闻条目 source、domain、title、date、timestamp、url、image_url、amp_version、badges 等字段。
video
| 字段 | 类型 | 说明 |
|---|---|---|
items | array | 视频列表。 |
视频项 source、title、timestamp、url 等字段。
short_videos
短视频模块。items[]含 title、url、domain、source 等字段。
twitter
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 模块标题。 |
url | string | 模块 URL。 |
items | array | 条目。 |
条目字段:
| 字段 | 类型 | 说明 |
|---|---|---|
tweet | string | 文本。 |
date | string | 发布日期文本。 |
timestamp | string | UTC 发布时间。 |
url | string | URL。 |
perspectives
观点模块。items[]含 title、description、url、domain、date、source、timestamp 等字段。
discussions_and_forums
讨论和论坛模块。items[]含 title、url、domain、source、description、timestamp、posts_count 等字段。
compare_sites
站点对比模块。items[]含 title、url、domain、image_url、source 等字段。
垂直搜索
jobs
职位模块。items[]含:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 职位名称。 |
description | string | 职位描述。 |
location | string | 工作地点。 |
author | string | 发布方。 |
job_posted_time | string | 发布时间文本。 |
timestamp | string | UTC 发布时间。 |
contract_type | string | 合同或岗位类型。 |
salary | string | 薪资信息。 |
url | string | 职位链接。 |
events
活动模块。items[]含 title、snippet、url。
recipes
食谱模块。items[]含 title、url、domain、source、description、time、rating。
top_sights
热门景点模块。items[]含 title、url、description、rating。
scholarly_articles
学术文章模块。items[]含 title、url、author、description。
questions_and_answers
问答模块。items[]含:
| 字段 | 类型 | 说明 |
|---|---|---|
url | string | 问答页面 URL。 |
question_text | string | 问题文本。 |
answer_text | string | 回答文本。 |
source | string | 来源名称。 |
domain | string | 来源域名。 |
votes | integer | 回答获赞数。 |
find_results_on
“可在以下网站找到结果”模块。items[]含 title、domain、url、source。
google_flights
航班模块。items[]含 description、url。
app
应用模块。items[]含 description、title、url、price。
金融与计算
stocks_box
股票模块。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 股票或市场摘要标题。 |
source | string | 行来源。 |
snippet | string | 行摘要。 |
price | object | 当前价格。数据可能存在延迟。 |
url | string | 页面 URL。 |
domain | string | 域名。 |
table | object | 行附加表格。 |
graph | object | 行图表数据。 |
graph.items[] 和 graph.previous_items[] 均:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 graph_element。 |
date | string | ISO 8601 时间,例如 2020-10-28T15:45:00。 |
value | float | 对应时间点的价格或前期收盘价。 |
currency_box
货币换算模块。
| 字段 | 类型 | 说明 |
|---|---|---|
value | integer | 转换金额。 |
converted_value | float | 换算后的金额。汇率数据可能存在延迟。 |
currency | string | 原始货币名称。 |
converted_currency | string | 目标货币名称。 |
timestamp | string | UTC 时间。 |
table | object | 汇率信息表格。 |
graph | object | 汇率图表数据。 |
math_solver
数学求解模块。
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 数学表达式。 |
result | string | 求解结果。 |
items | array | 解题步骤或扩展项。 |
links | array | 链接。 |
math_solver.items[].expanded_element[] 可:
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 解题步骤标题。 |
solution | array | 对应步骤的求解。 |
评论
google_reviews
| 字段 | 类型 | 说明 |
|---|---|---|
reviews_count | integer | 评论总数。 |
rating | object | 总体评分。 |
place_id | string | 地点标识。 |
feature | string | 评论特征标识。 |
cid | string | 本地商户唯一标识。 |
third_party_reviews
| 字段 | 类型 | 说明 |
|---|---|---|
reviews_count | integer | 评论数量。 |
title | string | 第三方评论来源名称。 |
url | string | 第三方评论来源 URL。 |
rating | object | 评分信息。 |
响应示例
以下示例展示常见的响应结构, items 会根据、地区、设备和搜索结果页实时变化。
json
{
"version": "0.1.20200129",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.3059 sec.",
"cost": 0.003,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02261816-2027-0066-0000-c27d02864073",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1234 sec.",
"cost": 0.003,
"result_count": 1,
"path": [
"/v3/serp/wp/v2/task_get/advanced/02261816-2027-0066-0000-c27d02864073"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "wp",
"se_type": "v2",
"keyword": "flight ticket new york san francisco",
"language_name": "English",
"location_name": "United States",
"device": "desktop",
"os": "windows",
"tag": "tag2"
},
"result": [
{
"keyword": "flight ticket new york san francisco",
"type": "v2",
"se_domain": "example.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.example.com/search?q=flight+ticket",
"datetime": "2025-01-15 12:57:46 +00:00",
"spell": null,
"refinement_chips": null,
"item_types": [
"organic",
"paid",
"people_also_ask",
"related_searches",
"ai_overview"
],
"se_results_count": 85600000,
"pages_count": 1,
"items_count": 5,
"items": [
{
"type": "ai_overview",
"rank_group": 1,
"rank_absolute": 1,
"page": 1,
"position": "left",
"xpath": "/html/body/div/div",
"asynchronous_ai_overview": false,
"markdown": "航班比价建议及参考来源。",
"items": [
{
"type": "ai_overview_element",
"position": "left",
"title": "出行建议",
"text": "建议比较不同日期和航空价格。",
"markdown": "建议比较不同日期和航空价格。",
"links": [
{
"type": "link_element",
"title": "参考页面",
"description": "航班信息页面",
"url": "https://example.com/flights",
"domain": "example.com"
}
],
"images": null,
"references": [
{
"type": "ai_overview_reference",
"source": "Example Travel",
"domain": "example.com",
"url": "https://example.com/flights",
"title": "航班信息",
"text": "航班价格和出行建议。"
}
]
}
],
"references": null,
"rectangle": null
},
{
"type": "paid",
"rank_group": 1,
"rank_absolute": 2,
"page": 1,
"position": "left",
"xpath": "/html/body/div/div",
"title": "优惠航班预订",
"domain": "example-airline.com",
"website_name": "Example Airline",
"description": "查看实时航班优惠和组合套餐。",
"url": "https://example-airline.com/flights",
"breadcrumb": "https://example-airline.com",
"images": null,
"highlighted": null,
"extra": {
"ad_aclk": "ad-identifier"
},
"description_rows": null,
"links": null,
"price": null,
"rating": {
"rating_type": "Max5",
"value": 4.8,
"votes_count": 803,
"rating_max": 5
},
"rectangle": null
},
{
"type": "organic",
"rank_group": 1,
"rank_absolute": 3,
"page": 1,
"position": "left",
"xpath": "/html/body/div/div",
"domain": "example.com",
"title": "纽约至旧金山航班指南",
"url": "https://example.com/new-york-san-francisco-flights",
"cache_url": null,
"related_search_url": null,
"breadcrumb": "example.com › flights",
"website_name": "Example Travel",
"is_image": false,
"is_video": false,
"is_featured_snippet": false,
"is_malicious": false,
"is_web_story": false,
"checks": null,
"description": "比较纽约至旧金山的航班、价格和出行日期。",
"pre_snippet": null,
"extended_snippet": null,
"images": null,
"amp_version": false,
"rating": null,
"price": null,
"highlighted": null,
"links": null,
"faq": null,
"extended_people_also_search": null,
"about_this_result": null,
"related_result": null,
"timestamp": null,
"rectangle": null
},
{
"type": "people_also_ask",
"rank_group": 1,
"rank_absolute": 4,
"page": 1,
"position": "left",
"xpath": "/html/body/div/div",
"items": [
{
"type": "people_also_ask_element",
"title": "纽约飞旧金山需要?",
"seed_question": null,
"xpath": "/html/body/div/div/div",
"expanded_element": [
{
"type": "people_also_ask_expanded_element",
"featured_title": "航班时间说明",
"url": "https://example.com/flight-duration",
"domain": "example.com",
"title": "纽约至旧金山飞行时间",
"description": "直飞通常约需小时。",
"images": null,
"timestamp": null,
"table": null
}
]
}
],
"rectangle": null
},
{
"type": "related_searches",
"rank_group": 1,
"rank_absolute": 5,
"page": 1,
"position": "left",
"xpath": "/html/body/div/div",
"items": [
"纽约旧金山机票价格",
"纽约到旧金山直飞",
"纽约旧金山航班时刻表"
],
"rectangle": null
}
]
}
]
}
]
}错误处理
建议按以下层级处理异常:
- 检查 HTTP 状态码;
- 检查顶层
status_code是否为20000; - 遍历
tasks并检查每个任务的status_code; - 当任务状态码大于或等于
40000时,记录status_message并执行重试、告警或降级逻辑; - 判断
result是否存在且result_count大于0; - 处理字段可能为
null的,是图片、评分、价格、矩形坐标、AI 概览及特定 SERP素。
常见状态处理建议:
| 条件 | 建议处理方式 |
|---|---|
顶层 status_code != 20000 | 将请求视为失败,记录整体错误信息。 |
tasks_error > 0 | 遍历任务并处理失败任务。 |
tasks[].status_code >= 40000 | 任务失败,不应读取 result。 |
result_count = 0 | 任务可能尚未完成、已过期或未产生结果。 |
字段值为 null | 表示该、功能或属性未在 SERP 中出现。 |
rectangle = null | 创建任务时未启用 calculate_rectangles,或该没有可用坐标。 |
asynchronous_ai_overview = true | AI 概览通过异步方式加载;应结合创建任务时的异步加载参数处理。 |
实用场景
- 监控自然排名与广告位分布:提取
organic、paid的绝对排名、标题和 URL,量化品牌词或核心业务词的自然流量竞争压力。 - 识别 AI 概览引用来源:解析
ai_overview.references、links与markdown,分析哪些站点被引用,为权威性建设和数字提供目标单。 - 挖掘选题与问答需求:汇总
people_also_ask、related_searches、people_also_search中的问题和词,构建更贴近搜索意图的 FAQ、专题页和集群。 - 分析电商 SERP 竞争格局:结合
shopping、popular_products、commercial_units的价格、卖家、评分和商品标识,监测竞品价格带与商品机会。 - 优化本地化获客策略:利用
local_pack、local_services、google_reviews中的商户评分、评论数、电话和cid,评估本地搜索可见度并定位门店优化优级。