主题
Trustpilot 搜索任务就绪列表
GET /v3/business_data/trustpilot/search/tasks_ready
接口说明
GET /v3/business_data/trustpilot/search/tasks_ready
本接口用于获取 Trustpilot 搜索任务中已完成但尚未领取的任务列表。若创建任务时未 postback_url,可通过本接口获取已完成任务的 id,再调用任务结果获取接口领取结果。
任务结果获取地址由响应中的 endpoint 字段提供。
> 注意:由于系统架构原因,已完成任务队列可能存在少量延迟。对于每分钟需要领取 1000 个任务的高并发场景,建议优使用回调通知机制,并将本接口用于查询回调失败的任务。
接口路径
获取指定搜索引擎的已完成任务:
http
GET /v3/business_data/$se/tasks_ready$se 为搜索引擎名称。本页面对应的搜索引擎为 trustpilot。
获取业务数据模块中所有已完成任务:
http
GET /v3/business_data/tasks_ready本页面的接口路径为:
http
GET /v3/business_data/trustpilot/search/tasks_ready计费与调用限制
- 获取已完成任务列表不产生额外费用。
- 每个已完成任务会一直保留在列表中,直到被领取。
- 每分钟最多调用本接口 20 次。
- 每次调用最多返回过去 3 天完成的 1000 个任务。
- 已被领取的任务不会再次出现在列表中。
- 完成后 3 天仍未领取的任务将从列表中移除。
- 如果创建任务时了
postback_url,任务正常完成后不会出现在本接口返回列表中。 - 只有当平台向您的服务器发送回调失败,且服务器返回的 HTTP 状态码小于
200或大于300时,该任务才可能出现在列表中。
本接口本身不扣费;如接口产生费用,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
本接口使用 GET 请求,无请求体和查询参数。
请求示例
cURL
bash
curl --location --request GET \
"https://api.seermartech.cn/v3/business_data/trustpilot/search/tasks_ready" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/business_data/trustpilot/search/tasks_ready"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
if response.ok:
result = response.json()
print(result)
else:
print(f"HTTP 错误:{response.status_code}")
print(response.text)TypeScript
typescript
import axios from "axios";
axios
.get(
"https://api.seermartech.cn/v3/business_data/trustpilot/search/tasks_ready",
{
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);
});响应说明
接口返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 请求级状态码。完整状态码列表请参考 /v3/appendix/errors |
status_message | string | 请求级说明信息。完整说明请参考 /v3/appendix/errors |
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。完整状态码请参考 /v3/appendix/errors |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时,单位为秒 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量 |
path | array | 请求路径信息 |
data | object | 创建任务时传的请求参数 |
result | array | 任务结果列表 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 已完成任务的唯一标识,采用 UUID 格式 |
se | string | 创建任务时指定的搜索引擎。此接口固定为 trustpilot |
se_type | string | 搜索引擎类型 |
date_posted | string | 任务提交时间,采用 UTC 格式 |
tag | string | 用户自定义任务标识 |
endpoint | string | 用于领取该任务结果的 URL 路径 |
> 建议在业务系统中对请求级和任务级状态码分别进行处理,并为任务领取失败、任务过期和回调失败等异常设计重试或告警机制。
响应示例
json
{
"version": "0.1.20210917",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1630 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "7c7e2c3a-3e2b-4e6a-9f01-123456789abc",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1200 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"business_data",
"trustpilot",
"search",
"tasks_ready"
],
"data": {
"se_type": "search",
"se": "trustpilot",
"api": "business_data",
"function": "search"
},
"result": [
{
"id": "7c7e2c3a-3e2b-4e6a-9f01-123456789abc",
"se": "trustpilot",
"se_type": "search",
"date_posted": "2024-01-15 10:30:00 +00:00",
"tag": "trustpilot_batch_001",
"endpoint": "/v3/business_data/trustpilot/search/task_get"
}
]
}
]
}实用场景
- 轮询已完成任务:定期获取 Trustpilot 搜索任务 ID,及时领取评价或企业搜索结果,降低结果处理延迟。
- 补偿回调失败任务:筛选未成功接收回调的任务,重新获取结果,业务数据缺失。
- 构建任务状态面板:统计已完成、失败和领取任务数量,为 SEO 数据采集平台提供运行监控。
- 执行批量结果收集:按
endpoint批量领取已完成任务,提升 Trustpilot 企业评价数据库效率。 - 理过期任务队列:在三天保留窗口及时处理任务,未领取结果自动移除。