主题
按任务 ID 获取 Google 应用列表 HTML 结果
GET /v3/appendix/errors
接口说明
GET https://api.seermartech.cn/v3/app_data/google/app_list/task_get/html/$id
本接口用于根据任务 ID 获取 Google 应用列表采集任务的 HTML 结果。任务提交成功后,可在 7 天通过任务 ID查询结果。
计费说明
在提交任务时计费,查询已提交任务的结果不额外收费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求路径中的 $id 为任务唯一标识。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务唯一标识,采用 UUID 格式。任务提交后,可在 7 天使用该 ID 查询结果。 |
请求示例
bash
curl --location --request GET \
"https://api.seermartech.cn/v3/app_data/google/app_list/task_get/html/04171455-0696-0192-0000-4c69cc29b945" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"GET 请求不需要请求体。
响应说明
接口返回 JSON 对象 tasks 数组任务执行结果。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用响应状态码。完整状态码列表请参考错误码文档。 |
status_message | string | 通用提示信息。 |
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 范围。 |
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。 |
html | string | HTML 页面。 |
响应示例
json
{
"version": "0.1.20220422",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1072 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "04171455-0696-0192-0000-4c69cc29b945",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0950 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"app_data",
"google",
"app_list",
"task_get",
"html"
],
"data": {
"se_type": "app_list",
"se": "google",
"api": "app_data",
"function": "app_list",
"app_collection": "top_free",
"location_code": 2840,
"language_code": "en",
"depth": 50,
"app_category": "shopping",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "top_free",
"type": "app_list",
"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 - 对应的
status_message tasks_errorresult是否为空
当任务尚未完成、任务 ID 不存在或任务执行失败时,应根据状态码和提示信息进行重试、记录日志或终止处理。完整错误码列表请参考 /v3/appendix/errors。
代码示例
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_list/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 = "02201115-0001-0066-0000-c06c8f23fce5"
url = f"https://api.seermartech.cn/v3/app_data/google/app_list/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_list/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 Exception(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
print_r($result);C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
public static class AppListDemo
{
public static async Task GetTaskResult()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Bearer",
"smt_live_YOUR_KEY"
);
var taskId = "04171455-0696-0192-0000-4c69cc29b945";
var url =
"https://api.seermartech.cn/v3/app_data/google/app_list/task_get/html/"
+ taskId;
var response = await httpClient.GetAsync(url);
var responseBody = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
Console.WriteLine($"HTTP 请求失败:{response.StatusCode}");
return;
}
Console.WriteLine(responseBody);
}
}实用场景
- 抓取 Google 应用列表原始 HTML,保存搜索结果页面快,便于后续解析应用排名、标题和展示信息。
- 对比不同地区的应用榜单页面,分析同一应用在不同市场中的排名变化和差异。
- 监测应用分类榜单变化,定期获取购物、、游戏等分类的 HTML,发现竞品上升或下降趋势。
- 构建应用市场数据仓库,将
html与任务参数、扫描时间保存,为历史分析和审计提供原始数据。 - 校验应用列表解析结果,在结构化字段异常时回溯原始 HTML,提升数据洗和排名监控的可靠性。