主题
按任务 ID 获取 Google App 搜索 HTML 结果
本接口使用 GET 方法,通过任务 ID 获取 Google App 搜索任务的 HTML 结果。
请求方法与路径:
http
GET https://api.seermartech.cn/v3/app_data/google/app_searches/task_get/html/$id计费说明
- 提交任务时计费。
- 任务完成后,可在 7 天多次获取结果,获取结果本身不额外收费。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
接口参数通过 URL 路径传递,无需请求体。
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识。为 UUID 格式。任务提交后,可在 7 天使用该 ID 获取结果。 |
响应说明
接口返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用响应状态码。完整状态码列表请参考 /v3/appendix/errors。建议在客户端实现完善的异常和错误处理机制。 |
status_message | string | 通用响应信息。完整信息列表请参考 /v3/appendix/errors。 |
time | string | 请求执行耗时,单位为秒。 |
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。完整状态码列表请参考 /v3/appendix/errors。 |
status_message | string | 任务状态说明。 |
time | string | 任务执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量。 |
path | array | 请求 URL 路径信息。 |
data | object | 提交任务时使用的参数。 |
result | array | 任务结果数组。 |
result 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 提交任务时使用的。 |
type | string | 提交任务时指定的搜索引擎类型。 |
se_domain | string | 提交任务时指定的搜索引擎域名。 |
location_code | integer | 地区代码。 |
language_code | string | 语言代码。 |
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。例如:2019-11-15 12:57:46 +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"TypeScript
typescript
import axios from "axios";
const taskId = "02201115-0001-0066-0000-c06c8f23fce5";
axios
.get(
`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.response?.data || error.message);
});Python
python
import requests
task_id = "04171455-0696-0192-0000-4c69cc29b945"
url = (
"https://api.seermartech.cn/v3/app_data/google/"
f"app_searches/task_get/html/{task_id}"
)
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers, timeout=60)
response.raise_for_status()
data = response.json()
if data.get("status_code") == 20000:
print("任务结果:", data)
else:
print(
"请求失败,状态码:",
data.get("status_code"),
"信息:",
data.get("status_message"),
)PHP
php
<?php
$taskId = '04171455-0696-0192-0000-4c69cc29b945';
$url = 'https://api.seermartech.cn/v3/app_data/google/app_searches/task_get/html/' . $taskId;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
if (($result['status_code'] ?? null) === 20000) {
print_r($result);
} else {
echo '请求失败:' . ($result['status_message'] ?? '未知错误');
}响应示例
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.0831 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>"
}
]
}
]
}
]
}任务结果获取流程
如需批量获取已完成任务,可调用任务就绪列表接口:
http
GET /v3/app_data/google/app_searches/tasks_ready接口返回已完成任务及结果地址后,可使用以下接口获取单个任务的 HTML 结果:
http
GET /v3/app_data/google/app_searches/task_get/html/$id也可以直接将任务 ID 拼接到接口路径中进行查询。建议在获取结果时检查以下字段:
- 顶层
status_code - 任务级别的
tasks[].status_code - 任务级别的
tasks[].status_message - 结果是否存在于
tasks[].result
实用场景
- 抓取 Google App 搜索结果页面,获取原始 HTML,用于还原搜索结果展示结构和页面。
- 监测应用排名变化,定期获取指定地区和语言下的搜索页面,分析与排名波动。
- 提取竞争应用展示信息,解析 HTML 中的应用名称、评分、评论数及 SERP素,支持竞品研究。
- 构建搜索结果存档,按、地区和日期保存 HTML 快,用于历史对比、审计和异常排查。
- 验证 App SEO 优化效果,在应用商店页面或策略调整后重新抓取结果,评估优化带来的搜索展示变化。