主题
根据任务 ID 获取 Google Shopping 商品评论结果(高级)
本接口使用 GET 方法,通过任务 ID 获取 Google Shopping 商品评论结果。
接口路径:
GET https://api.seermartech.cn/v3/merchant/google/reviews/task_get/advanced/$id
本接口返回指定 gid 对应商品的评论数据热门提及、评论标题、评论图片、评分、评论、评论信息及评论发布时间等。结果与创建任务时指定的搜索参数相对应。
系统会尽可能准确地模拟指定参数下的搜索结果。你可以通过响应中的 check_url 在无痕模式下访问搜索结果页面,核验返回数据的性。系统不会考虑用户偏好、搜索历史及个性化因素。
计费说明
在创建任务时计费。任务创建后 30 天可获取结果。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求路径中的 $id 为任务唯一标识。
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,采用 UUID 格式。任务创建成功后返回,可在 30 天随时用于获取任务结果。 |
响应结构
API 返回 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 | 任务结果数组。 |
状态码和错误信息请参考错误码文档。建议客户端针对任务级和请求级错误分别进行处理。
result 结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
product_id | string | 创建任务时提交的商品 ID。 |
type | string | 创建任务时提交的搜索引擎类型。 |
se_domain | string | 创建任务时提交的搜索引擎域名。 |
location_code | integer | 创建任务时提交的地区代码。 |
language_code | string | 创建任务时提交的语言代码。 |
check_url | string | 对应搜索结果页面的直接 URL,可用于核验结果准确性。 |
datetime | string | 获取结果的日期和时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
spell | object | 搜索引擎自动纠错信息。 |
title | string | Google Shopping 中的商品标题。 |
image_url | string | 商品图片 URL。 |
rating | object | 商品总体评分信息。 |
rating_groups | array | 按 1 至 5 分统计的评分分布。 5 个评分。 |
top_keywords | array | 与商品的热门评论。 |
reviews_count | integer | 评论总数。 |
item_types | array | Google Shopping 搜索结果中的项目类型。 |
items_count | integer | 返回的评论数量。可在创建任务时增加 depth 获取更多评论。 |
items | array | 商品评论列表。可在创建任务时增加 depth 获取更多评论。 |
spell 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 搜索引擎自动纠错后使用的。 |
type | string | 自动纠错类型。可能值:did_you_mean、showing_results_for、no_results_found_for、including_results_for。 |
rating 商品评分字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 rating_element。 |
position | string | 评分在搜索结果中的对齐方式,可为 left 或 right。 |
rating_type | string | 评分类型,目前为 Max5。 |
value | float | 基于评论计算的平均评分。 |
votes_count | integer | 评分数量。 |
rating_max | integer | 评分最大值;当 rating_type 为 Max5 时为 5。 |
rating_groups 评分分布字段
rating_groups 为 5 个对象的数组,分别对应 1 至 5 分。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 rating_element。 |
position | string | 评分在搜索结果中的对齐方式,可为 left 或 right。 |
rating_type | string | 评分类型,目前为 Max5。 |
value | integer | 评分值,可能为 1、2、3、4 或 5。 |
votes_count | integer | 对应评分的评论数量。 |
rating_max | integer | 评分最大值;Max5 的最大值为 5。 |
top_keywords 热门字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 表示商品某项特征或品质的。 |
count | string | 含该的评论数量。 |
items 评论字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 评论类型,可能为 google_shopping_review_item。 |
rank_group | integer | 在相同 type素组中的排名。不同类型不会计此排名。 |
rank_absolute | integer | 评论在评论列表中的绝对排名。 |
position | string | 评论在搜索结果中的对齐方式,通常为 right。 |
images | array | 评论提交的商品图片。 |
title | string | 评论标题。 |
url | string | 评论 URL。 |
review_text | string | 评论正文。 |
provided_by | string | 发布评论的网站域名。 |
author | string | 评论昵称。 |
publication_date | string | 评论的大致发布时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。该字段基于相对时间戳推算,可能并非精确时间。 |
rating | object | 评论提交的评分。 |
images 图片字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 图片类型,固定为 images_element。 |
alt | string | 图片替代文本。 |
url | string | 图片 URL。 |
image_url | string | 评论中展示的商品图片 URL。 |
items.rating 评论评分字段
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分类型,目前为 Max5。 |
value | float | 评论给出的评分。 |
votes_count | integer | 反馈数量。对于单条评论,该字段通常为 null。 |
rating_max | integer | 评分最大值;Max5 的最大值为 5。 |
Sandbox 测试
可以使用以下 Sandbox 地址查看该接口支持的结果字段。返回使用虚拟数据,不会产生费用:
https://sandbox.seermartech.cn/v3/merchant/google/reviews/task_get/advanced/00000000-0000-0000-0000-000000000000
请求示例
cURL
bash
id="04011058-0696-0199-0000-2196151a15cb"
curl --location --request GET \
"https://api.seermartech.cn/v3/merchant/google/reviews/task_get/advanced/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "06141103-2692-0309-1000-980b778b6d25"
url = (
"https://api.seermartech.cn/v3/merchant/google/reviews/"
f"task_get/advanced/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
data = response.json()
if data.get("status_code") == 20000:
print(data)
else:
print(
"请求失败,状态码:%s,信息:%s"
% (data.get("status_code"), data.get("status_message"))
)TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/merchant/google/reviews/task_get/advanced/${taskId}`,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
const data = response.data;
if (data.status_code === 20000) {
console.log("任务结果:", data);
} else {
console.error(
`请求失败,状态码:${data.status_code},信息:${data.status_message}`
);
}
})
.catch((error) => {
console.error("网络或服务异常:", error.message);
});响应示例
json
{
"version": "0.1.20231117",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1668 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "04011058-0696-0199-0000-2196151a15cb",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1200 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"merchant",
"google",
"reviews",
"task_get",
"advanced"
],
"data": {
"se_type": "reviews",
"api": "merchant",
"function": "reviews",
"se": "google",
"language_code": "en",
"location_code": 2840,
"gid": "4702526954592161872",
"device": "desktop",
"os": "windows"
},
"result": [
{
"product_id": "4702526954592161872",
"type": "google_shopping",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/",
"datetime": "2024-01-18 00:00:00 +00:00",
"title": "Apple iPhone XS 256GB",
"image_url": "https://example.com/product.jpg",
"rating": {
"type": "rating_element",
"position": "left",
"rating_type": "Max5",
"value": 4.3,
"votes_count": 20051,
"rating_max": 5
},
"rating_groups": [
{
"type": "rating_element",
"position": "left",
"rating_type": "Max5",
"value": 5,
"votes_count": 12000,
"rating_max": 5
}
],
"top_keywords": [
{
"keyword": "battery",
"count": "1250"
}
],
"reviews_count": 20051,
"item_types": [
"google_shopping_review_item"
],
"items_count": 10,
"items": [
{
"type": "google_shopping_review_item",
"rank_group": 1,
"rank_absolute": 1,
"position": "left",
"images": null,
"title": "A Great Phone!",
"url": "https://example.com/review",
"review_text": "The product works well and arrived on time.",
"provided_by": "example.com",
"author": "reviewer",
"publication_date": "2024-01-18 00:00:00 +00:00",
"rating": {
"rating_type": "Max5",
"value": 5,
"votes_count": null,
"rating_max": 5
}
}
]
}
]
}
]
}实用场景
- 提取商品评论中的高频,识别反复提及的功能、质量和售后问题,为商品页优化及创作提供依据。
- 汇总商品评分及评分分布,对比不同商品或卖家的口碑表现,选品、竞品分析和价格策略制定。
- 采集评论正文与评分信息,建立反馈数据库,用于感分析、产品缺陷发现和用户需求挖掘。
- 跟踪评论来源与发布时间,监测不同渠道的口碑变化,及时发现负面评价集中出现的时间段和发布平台。
- 结合
check_url校验搜索结果,验证采集数据与目标地区、语言及设备参数是否匹,提升 SEO 和电商数据监测的可靠性。