主题
按任务 ID 获取 Wp V2 SERP 高级结果
接口说明
GET https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/$id
$id 为任务 ID。本接口用于获取已提交任务的 SERP 高级结果新闻搜索结果、头条新闻、搜索细化选项及结果坐标等信息。
> 注意:/v3/serp/wp/v2/task_get/advanced/$id 为容路径,请勿将文档中的任务路径 /wp/... 视为接口。
计费说明
- 账户在提交任务时产生费用。
- 任务提交后的 30 天,可获取该任务结果。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - Sandbox 请求不会产生费用。
如需查看完整字段结构,可使用 Sandbox 请求:
https://sandbox.seermartech.cn/v3/serp/google/news/task_get/advanced/00000000-0000-0000-0000-000000000000
Sandbox 响应会返回该接口支持的 SERP 特性和扩展,字段为模拟数据。
请求参数
路径参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务唯一标识,UUID 格式。 |
请求示例
curl
bash
task_id="02261816-2027-0066-0000-c27d02864073"
curl --location --request GET \
"https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/${task_id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"TypeScript
typescript
import axios from "axios";
const taskId = "02231256-2604-0066-2000-57133b8fc54e";
axios
.get(
`https://api.seermartech.cn/v3/serp/wp/v2/task_get/advanced/${taskId}`,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
// 处理接口返回结果
console.log(response.data);
})
.catch((error) => {
console.error("请求失败:", error.response?.data || error.message);
});Python
python
import requests
task_id = "02261816-2027-0066-0000-c27d02864073"
url = (
"https://api.seermartech.cn/v3/serp/wp/v2/"
f"task_get/advanced/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
if response.ok:
result = response.json()
print(result)
else:
print(f"请求失败:{response.status_code} {response.text}")响应结构
接口返回 JSON 数据,顶层 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用响应状态码。完整状态码请参考错误码文档。建议对异常和错误状态进行统一处理。 |
status_message | string | 通用状态说明。 |
time | string | 接口执行耗时,例如 0.0733 sec.。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
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 | 请求 URL 路径。 |
data | object | 提交任务时使用的参数。 |
result | array | SERP 结果数组。 |
data 请求参数回显
data 对象提交任务时使用的参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称。 |
function | string | 调用的功能名称。 |
se | string | 搜索引擎名称。 |
se_type | string | 搜索类型,例如 news。 |
keyword | string | 查询。 |
language_code | string | 语言代码。 |
location_code | integer | 地区代码。 |
device | string | 设备类型,例如 desktop。 |
calculate_rectangles | boolean | 是否计算 SERP素的坐标和尺寸。 |
depth | integer | 抓取深度。 |
os | string | 操作系统类型。 |
result 结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 请求中提交的。返回时会对编码进行解码,+ 会被解码为空格。 |
type | string | POST 请求中的搜索引擎类型。 |
se_domain | string | POST 请求中的搜索引擎域名。 |
location_code | integer | POST 请求中的地区代码。 |
language_code | string | POST 请求中的语言代码。 |
check_url | string | 搜索引擎结果页的直接 URL,可用于核验结果准确性。 |
datetime | string | 获取结果的日期和时间,UTC 格式,例如 2019-11-15 12:57:46 +00:00。 |
spell | object | 搜索引擎自动纠错信息。 |
refinement_chips | object | 搜索细化选项。 |
includes_non_news_search_results | boolean | 是否同时新闻以外的普通搜索结果。 |
item_types | array | SERP 中的结果类型,可能 top_stories、news_search。 |
se_results_count | integer | SERP 中的结果总数。 |
items_count | integer | items 数组中的结果数量。 |
items | array | SERP 中的结果。 |
spell 自动纠错
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 搜索引擎纠正后的,结果将基于该返回。 |
type | string | 自动纠错类型。可能值:did_you_mean、showing_results_for、no_results_found_for、including_results_for。 |
refinement_chips 搜索细化选项
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 refinement_chips。 |
xpath | string | 素在页面中的 XPath。 |
items | array | 搜索细化项目。 |
options | array | 搜索细化选项。 |
items 项目字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 refinement_chips_element。 |
title | string | 项目标题。 |
url | string | 含细化参数的搜索 URL。 |
domain | string | SERP 中的域名。 |
options 选项字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 refinement_chips_option。 |
title | string | 选项标题。 |
url | string | 含细化参数的搜索 URL。 |
domain | string | SERP 中的域名。 |
items 结果
google_news 新闻搜索结果
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 news_search。 |
rank_group | integer | 同类型结果中的组排名。不同类型结果之间不会影响该排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
xpath | string | 结果的 XPath。 |
domain | string | 结果所属域名。 |
title | string | 新闻标题。 |
url | string | 新闻结果 URL。 |
image_url | string | 新闻图片 URL。 |
snippet | string | 新闻摘要。 |
time_published | string | 新闻发布时间描述。 |
timestamp | string | 新闻发布时间,格式为 年-月-日 时:分:秒 +UTC 时差,例如 2019-11-15 12:57:46 +00:00。 |
rectangle | object/null | 结果摘要在 SERP 页面中的坐标和尺寸。当提交任务时将 calculate_rectangles 设置为 true 时返回,否则为 null。 |
top_stories 热门新闻模块
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 top_stories。 |
rank_group | integer | 同类型结果中的组排名。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
position | string | 模块在 SERP 中的对齐方式,可能值为 left。 |
xpath | string | 模块的 XPath。 |
title | string | 模块标题。 |
items | array/null | 模块中的新闻项目;没有项目时为 null。 |
rectangle | object/null | 模块在 SERP 页面中的坐标和尺寸;未启用 calculate_rectangles 时为 null。 |
top_stories.items 新闻项目字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 top_stories_element。 |
source | string | 新闻来源名称。 |
domain | string | 新闻来源域名。 |
title | string | 新闻标题。 |
date | string | 新闻发布时间的近似描述,例如 23 hours ago。 |
amp_version | boolean | 是否提供 AMP 版本页面。 |
timestamp | string | 新闻发布时间,例如 2019-11-15 12:57:46 +00:00。 |
url | string | 新闻结果 URL。 |
image_url | string | 新闻图片 URL。 |
rectangle | object/null | 新闻项目在 SERP 页面中的坐标和尺寸。 |
rectangle 坐标字段
rectangle 用于表示 SERP素在页面中的位置和像素尺寸。页面左上角为坐标原点。
| 字段 | 类型 | 说明 |
|---|---|---|
x | integer | 素左上角的横坐标。 |
y | integer | 素左上角的纵坐标。 |
width | integer | 素宽度,单位为像素。 |
height | integer | 素高度,单位为像素。 |
响应示例
json
{
"version": "0.1.20200923",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0733 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02261816-2027-0066-0000-c27d02864073",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0412 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"serp",
"wp",
"v2",
"task_get",
"advanced"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "news",
"language_code": "en",
"location_code": 2840,
"keyword": "android",
"device": "desktop",
"calculate_rectangles": true,
"depth": 5,
"os": "windows"
},
"result": [
{
"keyword": "android",
"type": "news",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/search?q=android&tbm=nws",
"datetime": "2022-01-13 17:07:51 +00:00",
"includes_non_news_search_results": false,
"item_types": [
"news_search",
"top_stories"
],
"se_results_count": 771000000,
"items_count": 2,
"items": [
{
"type": "news_search",
"rank_group": 1,
"rank_absolute": 1,
"xpath": "/html/body/div/div/div/div/div/div/div/div/div/div",
"domain": "www.eff.org",
"title": "VICTORY: Google Releases “disable 2g” Feature for New Android Smartphones",
"url": "https://www.eff.org/deeplinks/2022/01/victory-google-releases-disable-2g-feature-new-android-smartphones",
"image_url": "https://api.seermartech.cn/cdn/i/01132007-1535-0139-0000-7b275022ce6d:0",
"snippet": "Last year Google quietly pushed a new feature to its Android operating system allowing users to optionally disable 2G at the modem level.",
"time_published": null,
"timestamp": "2022-01-12 22:07:51 +00:00",
"rectangle": {
"x": 180,
"y": 182,
"width": 652,
"height": 178
}
},
{
"type": "top_stories",
"rank_group": 1,
"rank_absolute": 2,
"position": "left",
"xpath": "/html/body/div/div/div/div/div/div/div/div/div/g-section-with-header",
"title": "News about Android",
"items": [
{
"type": "top_stories_element",
"source": "示例新闻来源",
"domain": "news.example.com",
"title": "Nvidia's Shield TVs get Android 11 upgrade",
"date": "23 hours ago",
"amp_version": false,
"timestamp": "2022-01-13 10:00:00 +00:00",
"url": "https://news.example.com/android-update",
"image_url": "https://api.seermartech.cn/cdn/i/01132007-1535-0139-0000-7b275022ce6d:1",
"rectangle": {
"x": 180,
"y": 376,
"width": 652,
"height": 178
}
}
],
"rectangle": {
"x": 180,
"y": 376,
"width": 652,
"height": 325
}
}
]
}
]
}
]
}实用场景
- 监测新闻排名:批量获取目标的新闻搜索结果和绝对排名,评估品牌或在新闻 SERP 中的表现。
- 追踪热门新闻模块:识别对应的热门新闻模块及新闻来源,支持新闻选题和发布策略调整。
- 分析竞争对手新闻:提取结果域名、标题、摘要和发布时间,对比竞争品牌的新闻覆盖量与更新频率。
- 还原 SERP 页面布局:启用
calculate_rectangles获取坐标和尺寸,评估新闻模块在搜索结果页中的视觉位置与展示空间。 - 发现新闻搜索细化方向:读取
refinement_chips及 URL,挖掘用户对新闻主题的进一步搜索意图。