主题
获取 Google App Searches 任务的 HTML 结果
通过任务 id 获取 Google App Searches 已完成任务的 HTML 原始结果。
接口说明
GET https://api.seermartech.cn/v3/app_data/google/app_searches/task_get/html/$id
该接口用于按任务 ID 拉取 HTML 页面结果。任务提交成功后,系统在创建任务时计费;任务结果在后续 7 天可获取。
参考价说明:本接口结果查询本身通常不额外收费,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 参数名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。该 ID 可在任务创建后的 7 天用于随时获取结果。 |
返回结果
接口返回 JSON 数据,顶层 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。完整错误码见 /v3/appendix/errors。建议在业务中实现完善的异常处理。 |
status_message | string | 通用状态消息。完整说明见 /v3/appendix/errors。 |
time | string | 接口执行耗时,单位秒。 |
cost | float | 本次请求总费用,单位。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | 返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。 |
status_code | integer | 任务状态码,范围通常为 10000-60000。完整错误码见 /v3/appendix/errors。 |
status_message | string | 任务状态说明。 |
time | string | 该任务执行耗时,单位秒。 |
cost | float | 该任务费用,单位。 |
result_count | integer | result 数组中的数量。 |
path | array | 请求路径。 |
data | object | 与创建任务时 POST 请求中传的参数一致。 |
result | array | 结果数组。 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 请求中提交的。 |
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。例如:2019-11-15 12:57:46 +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 原始。 |
调用方式
curl
bash
id="04171455-0696-0192-0000-4c69cc29b945"
curl --location --request GET "https://api.seermartech.cn/v3/app_data/google/app_searches/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_searches/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_searches/task_get/html/${taskId}`,
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
})
.then((response) => {
// 输出结果数据
console.log(response.data);
})
.catch((error) => {
console.error(error);
});获取已完成任务后再获取结果
通常可调用:
GET /v3/app_data/google/app_searches/tasks_ready
获取已完成任务列表,再根据返回的任务结果地址或任务 ID 调用:
GET /v3/app_data/google/app_searches/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_searches/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_info in task_group.get("result", []) if isinstance(task_group.get("result"), list) else []:
# 2. 通过 endpoint_html 获取结果
endpoint_html = task_info.get("endpoint_html")
if endpoint_html:
result_resp = requests.get(f"{base_url}{endpoint_html}", headers=headers)
results.append(result_resp.json)
# 3. 或通过任务 id 获取结果
# task_id = task_info.get("id")
# if task_id:
# result_resp = requests.get(
# f"{base_url}/v3/app_data/google/app_searches/task_get/html/{task_id}",
# headers=headers
# )
# results.append(result_resp.json)
print(results)响应示例
json
{
"version": "0.1.20220422",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1093 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "04171455-0696-0192-0000-4c69cc29b945",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0211 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"app_data",
"google",
"app_searches",
"task_get",
"html",
"04171455-0696-0192-0000-4c69cc29b945"
],
"data": {
"se_type": "organic",
"se": "google",
"api": "app_data",
"function": "app_searches",
"keyword": "vpn",
"location_code": 2840,
"language_code": "en",
"depth": 50,
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "vpn",
"type": "organic",
"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 不存在
- 任务尚未完成,暂无结果
- 任务结果已 7 天保留期
- 鉴权失败或访问频率限
使用说明
- 本接口为按任务 ID 取结果接口,不负责创建任务。
- 能获取之前已成功提交的 App Searches 任务结果。
- HTML 结果适合用于页面结构复核、结果页抽取、调试解析逻辑等场景。
- 如果需要更稳定的结构化字段,建议结合对应的结构化结果接口使用。
实用场景
- 复核搜索结果页结构:拉取原始 HTML,检查应用搜索结果页的真实 DOM 结构,便于定位解析规则失效原因。
- 提取应用:从 HTML 中抽取标题、评分、量、开发等展示,用于应用商店搜索可见性分析。
- 监控 SERP 页面变化:定期对同一保存 HTML 快,识别搜索页模板改版或版位变化带来的流量影响。
- 调试抓取与解析程序:在结构化结果异常时回看原始 HTML,快速判断是页面变化、区域差异还是解析逻辑问题。
- 沉淀竞品搜索样本:按和地区拉取应用搜索 HTML 页面,建立竞品词库下的搜索结果样本库,用于后续分析。