主题
merchant/amazon/reviews/task_get/html
获取 Amazon Reviews HTML 结果
接口方法与路径:
http
GET https://api.seermartech.cn/v3/merchant/amazon/reviews/task_get/html/$id根据任务 ID 获取 Amazon 商品评论页面的 HTML 结果及数据。
计费说明
- 在提交任务时计费。
- 任务完成后,可在 7 天获取结果。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - 任务 ID须在有效期使用。
请求参数
该接口通过 URL 路径传任务 ID,不需要请求体。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务唯一标识,UUID 格式。任务提交后可在 7 天使用该 ID 获取结果。 |
响应结构
接口返回 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 | 任务结果数组。 |
data 字段
data含提交任务时使用的参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索引擎类型,例如 reviews。 |
api | string | API 类型,例如 merchant。 |
function | string | 功能名称,例如 reviews。 |
se | string | 搜索引擎名称,例如 amazon。 |
language_code | string | 语言代码。 |
location_code | integer | 地区代码。 |
asin | string | Amazon 商品 ASIN。 |
priority | integer | 任务优级。 |
depth | integer | 抓取深度或页数。 |
device | string | 设备类型,例如 desktop。 |
os | string | 操作系统,例如 windows。 |
result 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
product_id | 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 | 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 | Amazon 评论页面的 HTML。 |
请求示例
cURL
bash
id="04171455-0696-0192-0000-4c69cc29b945"
curl --location --request GET \
"https://api.seermartech.cn/v3/merchant/amazon/reviews/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/merchant/amazon/reviews/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"
f"/v3/merchant/amazon/reviews/task_get/html/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
timeout=60,
)
if response.ok:
data = response.json()
print(data)
else:
print(f"请求失败:HTTP {response.status_code},{response.text}")响应示例
json
{
"version": "0.1.20220407",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1455 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "04171455-0696-0192-0000-4c69cc29b945",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1200 sec.",
"cost": 0,
"result_count": 1,
"path": [
"/v3/merchant/amazon/reviews/task_get/html/04171455-0696-0192-0000-4c69cc29b945"
],
"data": {
"se_type": "reviews",
"api": "merchant",
"function": "reviews",
"se": "amazon",
"language_code": "en_US",
"location_code": 2840,
"asin": "B0773ZY26F",
"priority": 2,
"depth": 10,
"device": "desktop",
"os": "windows"
},
"result": [
{
"product_id": "B0773ZY26F",
"type": "reviews",
"se_domain": "amazon.com",
"location_code": 2840,
"language_code": "en_US",
"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是否为20000。 - 再检查
tasks中每个任务的status_code。 - 当任务状态码表示错误,或
result为空时,应读取对应的status_message。 - 对网络时、HTTP 错误、任务过期和结果为空等进行重试或异常记录。
完整错误码可参考错误码文档。
实用场景
- 抓取商品评论 HTML:获取指定 ASIN 的评论页面原始,为评论文本解析、评分统计和主题抽取提供数据基础。
- 监控竞品口碑变化:定期获取竞品商品评论页面,比较评分、评论数量和用户反馈变化,竞品分析。
- 提取用户需求与痛点:解析 HTML 中的评论,识别高频问题和购买动机,支持产品优化与策划。
- 构建评论数据仓库:按商品、地区、语言和页面保存 HTML 结果,形成可追溯的评论历史数据。
- 验证评论采集结果:通过
datetime、page和items_count检查页面抓取时间、分页完整性及返回数量,提升数据质量。