主题
获取 Google App Reviews HTML 结果
GET /v3/app_data/google/app_reviews/task_get/html/{id}
接口说明
通过任务 id 获取 Google 应用评论抓取任务的 HTML 原始结果。
该接口适用于在任务提交完成后,按任务 ID 拉取已抓取的评论页面 HTML,用于页面还原、调试解析逻辑或进行二次数据提取。
- 请求方式:
GET - 请求路径:
/v3/app_data/google/app_reviews/task_get/html/$id
完整请求地址示例:
https://api.seermartech.cn/v3/app_data/google/app_reviews/task_get/html/$id
计费说明
本接口本身不对结果拉取重复收费,账户在创建任务时扣费。任务结果在生成后的 7 天可获取。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。可在任务创建后的 7 天随时用于获取结果。 |
响应结构
接口返回 JSON 数据,顶层 tasks 数组,每个任务对象中对应结果。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 接口通用状态码,完整列表见 /v3/appendix/errors |
status_message | string | 接口通用状态信息,完整列表见 /v3/appendix/errors |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总成本,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000,完整列表见 /v3/appendix/errors |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时,单位秒 |
cost | float | 单任务成本,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | 请求路径信息 |
data | object | 与创建任务时 POST 请求中传的参数一致 |
result | array | 结果数组 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
app_id | string | POST 请求中传的应用 ID |
type | string | POST 请求中的搜索引擎类型 |
se_domain | string | POST 请求中的搜索引擎域名 |
location_code | integer | POST 请求中的地区编码 |
language_code | string | POST 请求中的语言编码 |
datetime | string | 结果获取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
items_count | integer | items 数组中的结果数量 |
items | array | HTML 页面及数据 |
items[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
page | integer | 返回的 HTML 页序号 |
date | string | HTML 页面抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
html | string | HTML 页面源码 |
使用说明
通常推荐按以下流程调用:
- 通过创建任务接口创建评论抓取任务;
- 使用
/v3/app_data/google/app_reviews/tasks_ready获取已完成任务列表; - 从返回结果中提取任务 ID 或 HTML 结果地址;
- 调用本接口
/v3/app_data/google/app_reviews/task_get/html/$id获取 HTML。
请求示例
cURL
bash
id="04171455-0696-0192-0000-4c69cc29b945"
curl --location --request GET "https://api.seermartech.cn/v3/app_data/google/app_reviews/task_get/html/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02201115-0001-0066-0000-c06c8f23fce5"
url = f"https://api.seermartech.cn/v3/app_data/google/app_reviews/task_get/html/{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 = "02201115-0001-0066-0000-c06c8f23fce5";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/app_data/google/app_reviews/task_get/html/${taskId}`,
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
})
.then((response) => {
// 返回任务 HTML 结果
console.log(response.data);
})
.catch((error) => {
console.error(error);
});获取已完成任务后再获取结果
如果你需要批量处理已完成任务,可以请求:
GET /v3/app_data/google/app_reviews/tasks_ready
再逐个调用:
GET /v3/app_data/google/app_reviews/task_get/html/$id
这适合异步任务处理场景,可频繁轮询未完成任务。
Python 示例:取已完成任务,再获取 HTML 结果
python
import requests
base_url = "https://api.seermartech.cn"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
# 1. 获取已完成任务
ready_resp = requests.get(
f"{base_url}/v3/app_data/google/app_reviews/tasks_ready",
headers=headers
)
ready_data = ready_resp.json
results = []
if ready_data.get("status_code") == 20000:
for task_group in ready_data.get("tasks", []):
for task in task_group.get("result", []) or []:
task_id = task.get("id")
if not task_id:
continue
# 2. 根据任务 ID 拉取 HTML 结果
result_resp = requests.get(
f"{base_url}/v3/app_data/google/app_reviews/task_get/html/{task_id}",
headers=headers
)
results.append(result_resp.json)
print(results)TypeScript 示例:批量拉取已完成任务结果
typescript
import axios from "axios";
const client = axios.create({
baseURL: "https://api.seermartech.cn",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
});
async function fetchReadyTasksAndResults {
const readyResponse = await client.get("/v3/app_data/google/app_reviews/tasks_ready");
const readyData = readyResponse.data;
const results: any[] = [];
if (readyData.status_code === 20000) {
for (const taskGroup of readyData.tasks || []) {
for (const task of taskGroup.result || []) {
if (!task.id) continue;
const resultResponse = await client.get(
`/v3/app_data/google/app_reviews/task_get/html/${task.id}`
);
results.push(resultResponse.data);
}
}
}
console.log(results);
}
fetchReadyTasksAndResults.catch(console.error);响应示例
json
{
"version": "0.1.20220420",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0688 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "04171455-0696-0192-0000-4c69cc29b945",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0312 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"app_data",
"google",
"app_reviews",
"task_get",
"html",
"04171455-0696-0192-0000-4c69cc29b945"
],
"data": {
"se_type": "reviews",
"se": "google",
"api": "app_data",
"function": "app_reviews",
"app_id": "org.telegram.messenger",
"location_code": 2840,
"language_code": "en",
"depth": 150,
"rating": 5,
"device": "desktop",
"os": "windows"
},
"result": [
{
"app_id": "org.telegram.messenger",
"type": "reviews",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"datetime": "2019-11-15 12:57:46 +00:00",
"items_count": 1,
"items": [
{
"page": 1,
"date": "2019-11-15 12:57:46 +00:00",
"html": "<html>...</html>"
}
]
}
]
}
]
}状态码与错误处理
建议在接时同时校验顶层和任务级别的状态字段:
- 顶层
status_code:表示整个请求是否成功; tasks[].status_code:表示任务是否成功返回结果。
完整错误码与说明请参考:
/v3/appendix/errors
建议重点处理以下:
- 任务 ID 不存在或已过期;
- 任务尚未完成,结果不可用;
- 返回的
result为空; tasks_error大于0;- 单个任务状态码大于等于
40000。
注意事项
- 任务结果保证在任务创建后 7 天可查询;
- 本接口返回的是HTML 原始页面,适合做页面回放、规则调试与自定义解析;
- 若只需要结构化评论数据,建议优使用对应的 JSON 结果接口;
data字段会回显创建任务时传的参数,便于结果核对与追踪。
实用场景
- 复核评论抓取结果:获取原始 HTML 页面,核对结构化结果是否遗漏字段,提升评论数据质量。
- 调试解析规则:基于返回的页面源码定位 DOM 结构变化,快速修复自定义评论解析逻辑。
- 留存页面证据:保存指定时间点的评论页面 HTML,用于舆复盘、数据审计或异常追踪。
- 分析地区与语言差异:对比不同
location_code、language_code下返回的评论页面结构与差异,为化运营提供依据。 - 构建二次提取流程:在拿到 HTML 后,自行抽取额外字段,如页面控件、排序状态、隐藏展示等,扩展标准结果之外的数据能力。