主题
设置 Amazon 商品评论采集任务
> 接口状态:暂时不可用
POST /v3/merchant/amazon/reviews/task_post
本接口用于创建 Amazon 商品评论采集任务。系统将根据请求中的 asin 获取指定商品的评论列表。
asin 是 Amazon 商品的唯一标识。不同商品规格通常对应不同的 asin,请确保提交的标识与目标商品及规格一致。
> 计费说明 > > - 本接口在成功创建任务时计费。 > - 评论按每 10 条为一个计费单位。例如,depth 设置为 11 时,将按 20 条评论计费。 > - 原始示例中的任务费用为 0.0015 USD,按参考汇率折算约为 ¥0.0108 / 次,供参考。 > - 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。 > - 设置 priority: 2 的高优级任务可能产生额外费用。
请求说明
- 请求方法:
POST - 请求路径:
/v3/merchant/amazon/reviews/task_post - 请求格式:
application/json - 请求体:JSON 数组,单次最多 100 个任务 平台限流以认证说明中的 30/60/120 次/分钟规则为准 -过单次 100 个任务的部分将返回错误码
40006
任务创建成功后,可以通过返回的任务 id 获取结果。也可以在创建任务时 postback_url 或 pingback_url,由本平台在任务完成后主动通知。
如果的回调服务器在 10 秒未响应,连接将因时中断,任务会转移到任务就绪列表。回调错误码和错误信息取决于服务器。
请求参数
每个任务对象支持以下字段:
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
asin | string | 是 | Amazon 商品唯一标识。可通过 /v3/merchant/amazon/products/task_post 获取商品信息及 asin。示例:B0773ZY26F |
priority | integer | 否 | 任务优级。1:普通,默认值;2:高优级,可能产生额外费用 |
location_name | string | 条件填 | 位置完整名称。当未指定 location_code 和 location_coordinate 时填。使用该字段后,无需再指定另外两个位置参数。可通过 /v3/merchant/amazon/locations 获取可用值。示例:HA1,England,United Kingdom |
location_code | integer | 条件填 | 位置代码。当未指定 location_name 和 location_coordinate 时填。使用该字段后,无需再指定另外两个位置参数。可通过 /v3/merchant/amazon/locations 获取。示例:9045969 |
location_coordinate | string | 条件填 | GPS 坐标,格式为 纬度,经度,半径。纬度和经度最多 7 位小数,radius 最小值为 199.9。示例:53.476225,-2.243572,200 |
language_name | string | 条件填 | 语言完整名称。当未指定 language_code 时填。使用该字段后,无需再指定 language_code。可通过 /v3/merchant/amazon/languages 获取。示例:English (United Kingdom) |
language_code | string | 条件填 | 语言代码。当未指定 language_name 时填。使用该字段后,无需再指定 language_name。可通过 /v3/merchant/amazon/languages 获取。示例:en_GB |
se_domain | string | 否 | Amazon 站点域名。本平台通常会根据位置和语言自动选择,也可以手动指定。示例:amazon.com、amazon.co.uk、amazon.fr |
depth | integer | 否 | 评论采集数量,默认值为 10,最大值为 50。建议设置为 10 的倍数,因为系统按每批 10 条评论处理 |
sort_by | string | 否 | 评论排序方式。目前支持 helpful,默认值为 helpful |
reviewer_type | string | 否 | 评论类型过滤:<br>all_reviews:所有评论,默认值;<br>avp_only_reviews:返回带“已验证购买”标记的评论 |
filter_by_star | string | 否 | 星级过滤:<br>all_stars:所有星级,默认值;<br>five_star:五星;<br>four_star:四星;<br>three_star:三星;<br>two_star:二星;<br>one_star:一星;<br>positive:正面评论;<br>critical:批评性评论 |
filter_by_keyword | string | 否 | 按过滤评论,最多 300 个字符。指定后返回该的评论 |
media_type | string | 否 | 媒体类型过滤:<br>all_contents:文本、图片和视频评论,默认值;<br>media_reviews_only:图片和视频评论 |
format_type | string | 否 | 商品规格过滤:<br>all_format:所有商品规格的评论,默认值;<br>current_format:当前商品规格的评论 |
tag | string | 否 | 用户自定义任务标识,最多 255 个字符。可用于任务与结果,提交的值会原样返回在响应的 data 对象中 |
postback_url | string | 否 | 任务完成后,本平台向该地址发送结果的 POST 请求,使用 gzip 压缩。可使用 $id 和 $tag 占位符,例如:https://your-server.com/postbackscript?id=$id&tag=$tag |
postback_data | string | 条件填 | 使用 postback_url 时填。指定回调数据类型,可选值:advanced、html |
pingback_url | string | 否 | 任务完成后,本平台向该地址发送 GET 请求进行通知。可使用 $id 和 $tag 占位符,例如:https://your-server.com/pingscript?id=$id&tag=$tag |
位置参数互斥规则
以下三个参数三选一:
location_namelocation_codelocation_coordinate
例如,指定 location_name 后,不需要再提交 location_code 或 location_coordinate。
语言参数互斥规则
以下两个参数二选一:
language_namelanguage_code
例如,指定 language_name 后,不需要再提交 language_code。
> postback_url 和 pingback_url 中的特殊字符会进行 URL 编码,例如 # 会被编码为 %23。
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/merchant/amazon/reviews/task_post" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "United States",
"language_name": "English (United States)",
"asin": "B0773ZY26F",
"depth": 10,
"reviewer_type": "all_reviews",
"filter_by_star": "all_stars"
}
]'PHP
php
<?php
$apiUrl = 'https://api.seermartech.cn/v3/merchant/amazon/reviews/task_post';
$postArray = [
[
// 基础任务:指定位置、语言和商品 asin
'location_name' => 'United States',
'language_name' => 'English (United States)',
'asin' => 'B0773ZY26F'
],
[
// 高优级任务,并通过 pingback_url 接收完成通知
'location_name' => 'United States',
'language_name' => 'English (United States)',
'asin' => 'B0773ZY26F',
'priority' => 2,
'tag' => 'some_string_123',
'pingback_url' => 'https://your-server.com/pingscript?id=$id&tag=$tag'
],
[
// 通过 postback_url 接收任务结果
'location_name' => 'United States',
'language_name' => 'English (United States)',
'asin' => 'B0773ZY26F',
'postback_data' => 'html',
'postback_url' => 'https://your-server.com/postbackscript'
]
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($postArray, JSON_UNESCAPED_UNICODE)
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
if (($result['status_code'] ?? 0) === 20000) {
print_r($result);
} else {
echo "请求失败:";
print_r($result);
}TypeScript
typescript
import axios from "axios";
const postArray = [
{
location_name: "United States",
language_name: "English (United States)",
asin: "B0773ZY26F",
priority: 2,
tag: "some_string_123",
pingback_url:
"https://your-server.com/pingscript?id=$id&tag=$tag",
},
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/merchant/amazon/reviews/task_post",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
data: postArray,
})
.then((response) => {
// 处理接口响应
console.log(response.data);
})
.catch((error) => {
console.error("请求失败:", error.response?.data || error.message);
});Python
python
import requests
url = "https://api.seermartech.cn/v3/merchant/amazon/reviews/task_post"
post_data = [
{
# 基础任务
"location_name": "United States",
"language_name": "English (United States)",
"asin": "B0773ZY26F"
},
{
# 通过 pingback_url 接收完成通知
"location_name": "United States",
"language_name": "English (United States)",
"asin": "B0773ZY26F",
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
},
{
# 通过 postback_url 接收任务结果
"location_name": "United States",
"language_name": "English (United States)",
"asin": "B0773ZY26F",
"postback_data": "html",
"postback_url": "https://your-server.com/postbackscript"
}
]
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, json=post_data)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败。错误码:%s,错误信息:%s"
% (result.get("status_code"), result.get("status_message"))
)C#
csharp
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class AmazonReviewsDemo
{
public static async Task CreateTask()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Bearer",
"smt_live_YOUR_KEY"
);
var postData = new List<object>
{
new
{
// 基础任务
location_name = "United States",
language_name = "English (United States)",
asin = "B0773ZY26F"
},
new
{
// 高优级任务,并通过 pingback_url 接收通知
location_name = "United States",
language_name = "English (United States)",
asin = "B0773ZY26F",
priority = 2,
tag = "some_string_123",
pingback_url =
"https://your-server.com/pingscript?id=$id&tag=$tag"
},
new
{
// 通过 postback_url 接收任务结果
location_name = "United States",
language_name = "English (United States)",
asin = "B0773ZY26F",
postback_data = "html",
postback_url = "https://your-server.com/postbackscript"
}
};
var json = JsonSerializer.Serialize(postData);
using var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
var response = await httpClient.PostAsync(
"https://api.seermartech.cn/v3/merchant/amazon/reviews/task_post",
content
);
var responseText = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseText);
}
}响应说明
接口返回 JSON 对象 tasks 数组任务创建结果。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 请求级状态码。20000 表示成功 |
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 | null | 任务结果。创建任务接口返回 null,需通过任务结果接口获取评论数据 |
响应示例
json
{
"version": "0.1.20220407",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0727 sec.",
"cost": 0.0108,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "0723c5f3-7b11-06a7-0000-4b8c8b2c0000",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0081 sec.",
"cost": 0.0108,
"result_count": 0,
"path": [
"v3",
"merchant",
"amazon",
"reviews",
"task_post"
],
"data": {
"api": "merchant",
"function": "reviews",
"se": "amazon",
"language_code": "en_US",
"location_code": 2840,
"asin": "B0773ZY26F",
"priority": 2,
"depth": 10,
"se_type": "reviews",
"device": "desktop",
"os": "windows"
},
"result": null
}
]
}错误处理
请根据 status_code 和 status_message 判断请求及任务是否成功。
常见:
| 错误码 | 说明 |
|---|---|
20000 | 请求或任务处理成功 |
40006 | 单次请求提交的任务数 100 个 |
建议在客户端实现以下处理逻辑:
- 检查顶层
status_code。 - 检查每个任务对象的
status_code。 - 根据
tasks_error判断是否存在失败任务。 - 对时、网络异常和回调失败进行重试或告警。
- 保存任务
id,用于后续查询任务结果。
实用场景
- 采集商品评论:批量获取指定 Amazon 商品的用户评论,为产品口碑、满意度和竞品研究提供原始数据。
- 筛选差评与正面反馈:通过
filter_by_star区分星级或正负面评论,定位产品缺陷与用户认可点,支持产品迭代。 - 分析已验证购买评论:使用
reviewer_type: avp_only_reviews聚焦真实购买用户反馈,提升评论样本的分析价值。 - 监测提及:通过
filter_by_keyword筛选指定词语的评论,追踪功能、材质、物流或品牌话题。 - 识别图文和视频评论:使用
media_type获取媒体的评论,分析用户生成对商品转化和竞品表现的影响。