主题
获取 Google Dataset Info Advanced 结果(按任务 ID)
通过任务 ID 获取 Google Dataset Info 的 Advanced 结果。
接口说明
- 请求方式:
GET - 请求地址:
https://api.seermartech.cn/v3/serp/google/dataset_info/task_get/advanced/$id
计费说明
该接口本身不会重复计费。费用在创建任务时产生;任务结果在后续 30 天可拉取。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务提交后,可在 30 天随时使用该 ID 获取结果。 |
响应结构
接口返回 JSON 数据,顶层 tasks 数组,每个任务对象中对应的结果信息。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码 |
status_message | string | 通用状态信息 |
time | string | 执行时间,单位秒 |
cost | float | 本次请求总成本,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中返回错误的任务数量 |
tasks | array | 任务结果数组 |
建议在接时对状态码和异常做好完整处理。
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态信息 |
time | string | 任务执行时间,单位秒 |
cost | float | 单任务成本,单位 USD |
result_count | integer | result 数组数量 |
path | array | 请求路径 |
data | object | 与创建任务时传参数一致 |
result | array | 结果数组 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 提交时的;返回时会对 %## 进行解码 + 会被解码为空格 |
se_domain | string | POST 提交时的搜索引擎域名 |
language_code | string | POST 提交时的语言代码 |
check_url | string | 搜索结果直达链接,可用于人工校验结果准确性 |
datetime | string | 结果抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
spell | object | 搜索引擎自动纠错信息;若结果基于纠正后的返回,会在此说明纠错词及类型 |
refinement_chips | object | 搜索细化标签 |
item_types | array | 当前 SERP 中的结果类型;该接口可能值为 dataset |
se_results_count | integer | SERP 结果总数 |
items_count | integer | items 数组中的结果数量 |
items | array | SERP 中识别到的结果项 |
items[] 字段说明
每个代表一个数据集结果项。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 dataset |
rank_group | integer | 组排名;在相同 type 的组计数 |
rank_absolute | integer | SERP 中的绝对排名 |
position | string | 素在页面中的位置,可为 left、right |
xpath | string | 素的 XPath |
dataset_id | string | 数据集 ID |
title | string | 数据集标题 |
image_url | string | 图片 URL;可能来自原始资源,也可能来自平台缓存存储 |
scholarly_citations_count | integer | 引用该数据集的学术文章数量 |
links | array | null | 站点附加链接;若没有则为 null |
dataset_providers | array | 数据集提供机构列表 |
formats | array | 数据集文件格式列表 |
authors | array | null | 列表 |
licenses | array | 数据集许可证列表 |
updated_date | string | 数据集最近更新时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
area_covered | array | null | 数据覆盖区域,如 Africa、Global |
period_covered | object | 数据覆盖时间范围 |
dataset_description | object | 数据集描述信息 |
links[] 字段
显示在部分 Google Dataset 搜索结果下方的附加链接。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 link_element |
title | string | 链接标题 |
description | string | 链接描述 |
url | string | 链接 URL |
domain | string | 链接域名 |
dataset_providers[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 dataset_providers_element |
title | string | 数据集提供方名称 |
url | string | 提供方站点 URL |
domain | string | 提供方域名 |
formats[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 formats_element |
format | string | 文件格式类型,如 zip、html、csv |
size | string | 文件大小,单位字节 |
authors[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 authors_element |
name | string | 名称 |
url | string | 链接 URL |
domain | string | 链接域名 |
licenses[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 licenses_element |
title | string | 许可证名称 |
url | string | 许可证 URL |
domain | string | 许可证链接域名 |
period_covered 字段
| 字段 | 类型 | 说明 |
|---|---|---|
start_date | string | 覆盖周期开始时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
end_date | string | 覆盖周期结束时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
displayed_date | string | SERP 中展示的时间范围文本 |
dataset_description 字段
| 字段 | 类型 | 说明 |
|---|---|---|
text | string | 数据集描述文本 |
links | array | 描述文本中的链接 |
dataset_description.links[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 link_element |
title | string | 链接锚文本 |
description | string | 链接描述 |
url | string | 链接地址 |
domain | string | 链接域名 |
沙箱调试
如需查看该端点所有可返回字段,可调用沙箱地址:
https://sandbox.本平台.com/v3/serp/google/dataset_info/task_get/advanced/00000000-0000-0000-0000-000000000000
沙箱响应会返回该接口支持的完整字段结构,字段值为演示数据。使用沙箱接口不会扣费。
调用示例
curl
bash
id="02261816-2027-0066-0000-c27d02864073"
curl --location --request GET "https://api.seermartech.cn/v3/serp/google/dataset_info/task_get/advanced/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231256-2604-0066-2000-57133b8fc54e"
url = f"https://api.seermartech.cn/v3/serp/google/dataset_info/task_get/advanced/{task_id}"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const taskId = "02231256-2604-0066-2000-57133b8fc54e";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/serp/google/dataset_info/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);
});结合 tasks_ready 获取已完成任务
在批量任务场景中,通常调用:
GET /v3/serp/google/dataset_info/tasks_ready
获取已完成任务列表,再根据返回的任务 ID 或 endpoint_advanced 地址逐个获取结果:
GET /v3/serp/google/dataset_info/task_get/advanced/$id
这是一种更适合异步批处理的调用方式。
响应示例
json
{
"version": "0.1.20221214",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0729 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "dataset_info",
"dataset_id": "L2cvMTFqbl85ZHN6MQ==",
"device": "desktop",
"os": "windows"
},
"result": [
{
"se_results_count": 1,
"items_count": 1,
"items": [
{
"dataset_providers": [],
"formats": [],
"authors": null,
"licenses": [],
"updated_date": "2019-06-24 03:00:00 +00:00",
"area_covered": null,
"period_covered": {
"start_date": "2002-01-01 02:00:00 +00:00",
"end_date": "2017-12-31 02:00:00 +00:00",
"displayed_date": "Jan 1, 2002 - Dec 31, 2017"
},
"dataset_description": {
"text": "The Canadian Environmental Sustainability Indicators (CESI) program provides data and information to track Canada's performance on key environmental sustainability issues.",
"links": []
}
}
]
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求的执行状态 tasks[].status_code表示单个任务的执行状态- 建议同时校验:
- HTTP 状态码
- 顶层
status_code - 任务级
tasks[].status_code result是否为空
如任务尚未完成、任务 ID 无效或结果已过期,接口可能返回对应错误信息。建议在业务侧实现重试、过期判断和异常告警机制。
实用场景
- 抓取数据集页摘要:获取标题、描述、更新时间、覆盖区域等信息,用于搭建数据资源聚合页或专题页。
- 分析数据集来源机构:提取
dataset_providers,识别高频数据提供方,评估行业数据生态与合作机会。 - 筛选可下载格式:读取
formats中的csv、zip、html等格式,帮助产品快速判断数据是否适合采集、洗或二次分析。 - 评估数据集权威性:结合
scholarly_citations_count、许可证、信息,判断数据资源的可信度与研究引用价值。 - 构建时效性监控:基于
updated_date与period_covered监控数据是否长期未更新,支持运营和数据目录维护。