主题
创建 Trustpilot 评论采集任务
本接口用于为指定商家创建 Trustpilot 评论采集任务。你需要通过 domain 字段传目标商家在 Trustpilot 上对应的域名,接口会返回该商家的评论数据。
例如,某商家在 Trustpilot 上的页面地址为:
https://www.trustpilot.com/review/www.thepearlsource.com
则该商家的 domain 应填写为:
www.thepearlsource.com
注意:只有当你传的
domain能正确对应 Trustpilot 上已存在的商家页面时,才能成功获取评论。
接口地址
POST https://api.seermartech.cn/v3/business_data/trustpilot/reviews/task_post
计费说明
本接口的费用由两部分组成:
- 创建任务的基础费用
- 返回评论数量对应的采集费用
评论按每 20 条 为一个计费单位扣费:
- 若设置
"depth": 20,按 20 条计费 - 若设置
"depth": 21,按 40 条计费
因此,建议将 depth 设置为 20 的倍数,以不的计费浪费。
高优级任务(priority=2)会额外收费。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求说明
- 请求方法:
POST - 请求体格式:
application/json - 编码:
UTF-8 - 请求体为 JSON 数组:
[{ ... }]
调用限制
- 每分钟最多 30 次 API 调用
- 每次 POST 最多提交 100 个任务 -过 100 个任务时,出部分会返回错误码
40006
回调与结果获取
任务创建后,你可以通过以下方式获取结果:
- 使用任务唯一标识
id轮询获取结果 - 在创建任务时传:
postback_url:任务完成后,本平台会将结果以 gzip 压缩的 POST 请求推送到该地址pingback_url:任务完成后,本平台会向该地址发送 GET 通知
回调变量
你可以在回调地址中使用以下占位符:
$id:任务 ID$tag:你提交的自定义标签,发送前会进行 URL 编码
示例:
https://your-server.com/postbackscript?id=$idhttps://your-server.com/postbackscript?id=$id&tag=$taghttps://your-server.com/pingscript?id=$idhttps://your-server.com/pingscript?id=$id&tag=$tag
回调注意事项
postback_url和pingback_url中的特殊字符会被 URL 编码- 例如
#会被编码为%23 - 如果你的服务器在 10 秒未响应,连接会因时中断,任务会转
/v3/business_data/trustpilot/reviews/tasks_ready列表你后续拉取
请求参数
| 字段名 | 类型 | 说明 |
|---|---|---|
domain | string | 填。Trustpilot 商家页面对应的域名。可从商家页面 URL 中提取。示例:www.thepearlsource.com |
sort_by | string | 可选。结果排序方式。可选值:recency(按最新评论排序)、relevance(按性排序)。默认值:relevance |
priority | integer | 可选。任务优级。1:普通优级(默认);2:高优级。高优级会额外收费 |
depth | integer | 可选。返回的评论数量。默认值:20;最大值:200。建议使用 20 的倍数,因为系统按每 20 条评论一组处理和计费 |
tag | string | 可选。自定义任务标识,最长 255 个字符。可用于请求与结果匹,返回时会出现在响应的 data 对象中 |
postback_url | string | 可选。任务完成后接收结果推送的 URL。本平台会以 gzip 压缩的 POST 请求发送完整结果 |
pingback_url | string | 可选。任务完成后接收通知的 URL。本平台会发送 GET 请求通知任务已完成 |
响应结构
接口返回 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 | 本平台的唯一任务 ID,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态说明 |
time | string | 任务处理耗时,单位秒 |
cost | float | 单个任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | API 路径信息 |
data | object | 任务请求参数回显 |
result | array | 结果数组。对于任务创建接口,该值通常为 null |
请求示例
curl
bash
curl --location --request POST "https://api.seermartech.cn/v3/business_data/trustpilot/reviews/task_post" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"domain": "www.thepearlsource.com"
},
{
"domain": "www.thepearlsource.com",
"depth": 40,
"priority": 2
},
{
"domain": "www.thepearlsource.com",
"postback_url": "https://your-server.com/postbackscript"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/business_data/trustpilot/reviews/task_post"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
# 请求体为 JSON 数组
payload = [
{
"domain": "www.thepearlsource.com"
},
{
"domain": "www.thepearlsource.com",
"depth": 40,
"priority": 2,
"tag": "some_string_123",
"pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
},
{
"domain": "www.thepearlsource.com",
"postback_url": "https://your-server.com/postbackscript"
}
]
response = requests.post(url, headers=headers, json=payload)
print(response.json)TypeScript
typescript
import axios from "axios";
const postArray = [
{
domain: "www.thepearlsource.com",
},
{
domain: "www.thepearlsource.com",
depth: 40,
priority: 2,
tag: "some_string_123",
pingback_url: "https://your-server.com/pingscript?id=$id&tag=$tag",
},
{
domain: "www.thepearlsource.com",
postback_url: "https://your-server.com/postbackscript",
},
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/business_data/trustpilot/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);
});响应示例
json
{
"version": "0.1.20210917",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0676 sec.",
"cost": 0.00075,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "12345678-1234-1234-1234-1234567890ab",
"status_code": 20100,
"status_message": "Task Created.",
"time": "0.0020 sec.",
"cost": 0.00075,
"result_count": 0,
"path": [
"v3",
"business_data",
"trustpilot",
"reviews",
"task_post"
],
"data": {
"api": "business_data",
"function": "reviews",
"se": "trustpilot",
"domain": "www.thepearlsource.com",
"language_name": "English",
"language_code": "en",
"location_name": "United States",
"device": "desktop",
"os": "windows"
},
"result": null
}
]
}状态与错误处理建议
- 请始终检查顶层
status_code与任务级status_code - 建议为接口调用建立统一的异常处理机制
- 常见问题:
- 创建任务数 100,返回
40006 - 回调地址不可达或时
domain对应的 Trustpilot 商家不存在,导致无法返回预期评论数据
完整错误码可参考 /v3/appendix/errors。
实用场景
- 监控品牌口碑:定期抓取指定商家的最新评论,及时发现差评、投诉和服务问题
- 对比竞品评价:批量采集多个竞品在 Trustpilot 上的评论与数量,用于品牌对标分析
- 分析评论趋势:按时间顺序获取评论,观察活动前后、产品发布后或舆事件期间的口碑变化
- 提取用户反馈:结合评论文本做主题归类,识别物流、售后、质量、价格等高频反馈问题
- 构建商家评价库:持续归集 Trustpilot 评论数据,沉淀为 SEO、和市场分析数据资产