主题
获取 Google Reviews 已完成任务列表
GET /v3/business_data/google/reviews/tasks_ready
本接口使用 GET 方法和以下路径:
/v3/business_data/google/reviews/tasks_ready
用于获取已完成但尚未领取的 Google Reviews 任务列表。调用本接口后,可根据返回的任务 id,继续使用任务结果获取接口领取结果。
如果创建任务时了 postback_url,正常完成的任务不会出现在本接口返回列表中。只有当推送请求失败,且接收服务器返回的 HTTP 状态码小于 200 或大于 300 时,任务才可能重新出现在领取列表中。
> 注意:由于任务完成队列存在少量同步延迟,本接口不适合高并发、大批量任务的实时领取。如果系统每分钟需要领取 1000 个任务,建议优使用回调通知机制,并将本接口用于补偿获取回调失败的任务 ID。
请求地址
获取 Google Reviews 已完成任务
http
GET https://api.seermartech.cn/v3/business_data/google/reviews/tasks_ready按搜索引擎获取已完成任务
将 $se 替换为的搜索引擎名称:
http
GET https://api.seermartech.cn/v3/business_data/$se/tasks_ready获取 Business Data API部已完成任务
http
GET https://api.seermartech.cn/v3/business_data/tasks_readyReviews 业务对应的搜索引擎为 google。
计费与调用限制
- 获取已完成任务列表本身不扣费。
- 每个任务在被领取前会持续保留在列表中。
- 每分钟最多调用 20 次。
- 每次调用最多返回过去 3 天完成的 1000 个任务。
- 已经领取过的任务不会再次返回。
- 完成后 3 天仍未领取的任务将从列表中移除。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求头
http
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json本接口为 GET 请求,不需要请求体。
响应字段
响应为 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 | 已完成任务列表 |
完整状态码请参考 /v3/appendix/errors。建议客户端对异常状态和错误信息进行统一处理。
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 | 已完成任务的信息列表 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 已完成任务的唯一标识,UUID 格式 |
se | string | 创建任务时指定的搜索引擎,取值为 google |
se_type | string | 搜索引擎类型,Reviews 场景为 reviews |
date_posted | string | 任务提交时间,UTC 格式 |
tag | string | 用户自定义任务标识 |
endpoint | string | 用于获取该任务结果的 URL |
curl 示例
bash
curl --location --request GET \
"https://api.seermartech.cn/v3/business_data/google/reviews/tasks_ready" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"PHP 示例
php
<?php
$apiUrl = 'https://api.seermartech.cn';
$apiKey = 'smt_live_YOUR_KEY';
$ch = curl_init($apiUrl . '/v3/business_data/google/reviews/tasks_ready');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
echo '请求失败:' . curl_error($ch);
} else {
$result = json_decode($response, true);
if (($result['status_code'] ?? 0) === 20000) {
print_r($result);
} else {
echo '错误码:' . ($result['status_code'] ?? 'unknown') . PHP_EOL;
echo '错误信息:' . ($result['status_message'] ?? 'unknown') . PHP_EOL;
}
}
curl_close($ch);TypeScript / Axios 示例
typescript
import axios from 'axios';
axios({
method: 'get',
url: 'https://api.seermartech.cn/v3/business_data/google/reviews/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);
});Python 示例
python
import requests
url = "https://api.seermartech.cn/v3/business_data/google/reviews/tasks_ready"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
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.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
public static class BusinessDataExamples
{
public static async Task GetGoogleReviewsTasksReady()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");
var response = await httpClient.GetAsync(
"https://api.seermartech.cn/v3/business_data/google/reviews/tasks_ready"
);
var content = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
// 解析并处理已完成任务列表
Console.WriteLine(content);
}
else
{
Console.WriteLine($"HTTP 请求失败:{response.StatusCode}");
Console.WriteLine(content);
}
}
}响应示例
json
{
"version": "0.1.20200325",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1486 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.2345 sec.",
"cost": 0,
"result_count": 1,
"path": [
"/v3/business_data/google/reviews/task_get/01234567-89ab-cdef-0123-456789abcdef"
],
"data": {
"api": "reviews",
"function": "tasks_ready",
"se": "google",
"se_type": "reviews"
},
"result": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"se": "google",
"se_type": "reviews",
"date_posted": "2024-01-15 08:30:00 +00:00",
"tag": "client-project-001",
"endpoint": "/v3/business_data/google/reviews/task_get/01234567-89ab-cdef-0123-456789abcdef"
}
]
}
]
}返回任务 ID 后,可根据 endpoint 字段调用对应的任务结果获取接口,领取 Google Reviews 详细数据。
实用场景
- 轮询已完成任务:定期获取尚未领取的 Reviews 任务 ID,任务结果因长期未领取而过期。
- 补偿回调失败任务:筛选未成功推送到业务服务器的任务,降低回调网络异常造成的数据丢失。
- 批量同步商家评价:集中领取多个 Google Reviews 任务结果,为商家评价监控和舆分析提供数据。
- 构建任务调度队列:根据返回的任务状态和结果地址安排后续领取流程,提高异步采集系统的吞吐效率。
- 核对采集任务完整性:结合
tasks_count、tasks_error和任务 ID,对每日评价采集任务进行成功率审计。