主题
获取 Amazon Sellers 任务 HTML 结果
接口说明
用于根据任务 id 获取 Amazon Sellers 任务的 HTML 抓取结果。
请求地址
GET https://api.seermartech.cn/v3/merchant/amazon/sellers/task_get/html/$id
计费说明
该接口本身不重复收费,费用在创建任务时产生。任务提交成功后,可在 7 天 多次获取结果。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务创建后,可在 7 天 使用该 id 随时获取结果。 |
返回结果说明
接口返回 JSON 数据,顶层 tasks 数组,用于承载任务执行结果。
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本号 |
status_code | integer | 通用状态码,完整列表见 /v3/appendix/errors |
status_message | string | 通用状态说明 |
time | string | 接口执行耗时,单位秒 |
cost | float | 本次请求总成本,单位 USD |
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 |
result_count | integer | result 数组中的结果数量 |
path | array | 请求路径 |
data | object | 与创建任务时 POST 请求中传的参数一致 |
result | array | 任务结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
asin | string | POST 请求中提交的 ASIN |
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 | Amazon 上返回的结果项 |
items[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
page | integer | 返回的 HTML 页序号 |
date | string | HTML 页面抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
html | string | 页面 HTML 原文 |
调用方式
通常流程如下:
- 通过
/v3/merchant/amazon/sellers/tasks_ready查询已完成任务; - 再使用返回的任务结果地址或任务
id拉取 HTML 结果; - 在 7 天有效期可重复查询。
请求示例
cURL
bash
id="04171157-0696-0183-0000-4f63affdd40a"
curl --location --request GET "https://api.seermartech.cn/v3/merchant/amazon/sellers/task_get/html/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231453-2604-0066-2000-64d39c6677d4"
url = f"https://api.seermartech.cn/v3/merchant/amazon/sellers/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 = "02231453-2604-0066-2000-64d39c6677d4";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/merchant/amazon/sellers/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/merchant/amazon/sellers/tasks_ready
拿到已完成任务列表后,再逐个调用:
GET /v3/merchant/amazon/sellers/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/merchant/amazon/sellers/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/merchant/amazon/sellers/task_get/html/{task_id}",
headers=headers
)
results.append(result_resp.json)
print(results)TypeScript 示例:获取已完成任务,再获取 HTML 结果
typescript
import axios from "axios";
const baseURL = "https://api.seermartech.cn";
const headers = {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
};
async function fetchCompletedTaskResults {
const readyResponse = await axios.get(
`${baseURL}/v3/merchant/amazon/sellers/tasks_ready`,
{ headers }
);
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 axios.get(
`${baseURL}/v3/merchant/amazon/sellers/task_get/html/${task.id}`,
{ headers }
);
results.push(resultResponse.data);
}
}
}
console.log(results);
}
fetchCompletedTaskResults.catch(console.error);响应示例
json
{
"version": "0.1.20200416",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1269 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"se_type": "sellers_list",
"api": "merchant",
"function": "sellers",
"se": "amazon",
"language_code": "en",
"location_code": 2840,
"asin": "B088NFXLRV",
"priority": 2,
"device": "desktop",
"os": "windows"
},
"result": [
{
}
]
}
]
}状态码与异常处理
- 顶层
status_code表示整个请求的处理状态; tasks[].status_code表示单个任务的执行状态;- 建议同时校验这两个层级的状态码;
- 错误码与状态说明请参考
/v3/appendix/errors; - 建议在业务系统中实现时、空结果、任务未完成、任务过期等异常处理逻辑。
使用建议
- 该接口返回的是原始 HTML,适合需要自行解析页面结构的场景;
- 若任务刚提交不,建议通过
/v3/merchant/amazon/sellers/tasks_ready判断任务是否完成; html字段可能较大,建议按需存储或对象存储;- 任务结果保留 7 天,建议及时归档。
实用场景
- 抓取卖家页面原始 HTML,用于自建解析器提取店铺名称、评分、商品列表等信息,提升电商报采集灵活性。
- 复核结构化结果,结合 HTML 原文排查字段缺失、解析偏差或页面模板变更,提升数据质量控制能力。
- 监控页面改版,对比不同时间点的 HTML,识别 Amazon 卖家页结构变化,降低采集规则失效风险。
- 归档页面证据,保存特定时间点的卖家页 HTML 快,为竞品跟踪、异常回溯和运营复盘提供依据。
- 构建自定义特征,从 HTML 中提取本平台未直接结构化输出的,用于卖家分析、风险识别或 SEO/电商研究。