Reviews
从 Google Shopping 获取商品的评论。
GET | POST /v1/google-shopping/reviews参数可以用 GET 的查询字符串发送,也可以用 POST 的 JSON 请求体发送,两者等价。
请求
curl "https://gateway.apinoa.com/v1/google-shopping/reviews?id=14699928440903523478" \
-H "x-api-key: $APINOA_API_KEY"参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
cursor | string | Next page: pass the previous result's cursor alone. | |
id | string | The product, as a search item's id carries it. Only a product Google groups across stores (an id of digits only) has reviews. | |
url | string | A Google Shopping product link instead of id (the url a search item carries). |
这些参数及所有响应类型也写在OpenAPI 文档中。
响应
在 data 中返回 ReviewPage。 真实响应的节选:数组只保留前几项,长文本已截断。
{
"success": true,
"data": {
"marketplace": "google-shopping",
"productId": "14699928440903523478",
"summary": {
"average": 4.7083335,
"count": 456,
"distribution": {"1": 3, "2": 1, "3": 4, "4": 11, "5": 83},
"starCounts": {"1": 11, "2": 4, "3": 14, "4": 49, "5": 378}
},
"page": {"index": 1, "size": 10, "total": 456},
"reviews": [
{
"id": "PR_3P_f5ad9bac86f8a072818655448a2d2a25",
"author": "Joshua W",
"authorAvatarUrl": "https://lh3.googleusercontent.com/shsm/AGYqVK3f_a0qsNdewufUaN9jNMjhBA2iqYGxMmbkzY_-9XUnWM-EHp54sZUtlNtGLSKzmHRExg=w40-h40-c0x00000000-cc",
"rating": 3,
"title": "Looking for some help",
"body": "The shoes feel great.. the very light and comfortable under the foot…. The staff were great and very helpful when I was there… she told me I had a slight curved…",
"images": [],
"syndicatedFrom": "ewavedemo.com",
"ext": {"dateText": "2 months ago"}
},
{
"id": "PR_3P_b2d0f4e9a87ebcd67397b1a448940f0a",
"author": "Default",
"authorAvatarUrl": "https://lh3.googleusercontent.com/shsm/AGYqVK36QOcqS62Et64UZUlsDp50FK0-LzpzaUd1Agzu2JVkg3ql3vf6jik6HH6NLO97COzJZg=w40-h40-c0x00000000-cc",
"rating": 5,
"title": "Great shoe for training runs",
"body": "I’ve put 20 miles on these shoes now in 4 easy runs. I have never had a rocker-style shoe before but they were noticeably plusher/softer and also nicer when goi…",
"images": [],
"syndicatedFrom": "scheels.com",
"ext": {"dateText": "2 months ago"}
}
],
"cursor": "YN15aw6pZJw1FMvFzP6fLCf0K96FEghuBGv4a93oJ-0zQyEfuCFWmFieSYh0NJKmYigKFBV16DeiEsT-lY3MyBrmGWZdMJ9vH_JZWUXjH0-TI4WKYoKGUF6U2-RV9NMs7SqyGL3MrLEVFTYSCgTtTtfdeF_O-7xW…"
}
}错误
| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | INVALID_CURSOR | 该 cursor 不是本操作返回的。请不带它重新开始。 |
| 400 | INVALID_PARAMS | 参数缺失、未知、超出范围,或该引擎不接受。消息中会指出是哪一个。 |
| 401 | UNAUTHORIZED | 缺少 x-api-key 请求头,或密钥已吊销或未知。 |
| 402 | INSUFFICIENT_BALANCE | 余额不足以支付本次调用。请在控制台充值。 |
| 404 | REVIEWS_NOT_FOUND | Google Shopping 没有保存此商品的评论:它是单个商店的商品,而不是 Google 跨商店归并的商品。消息中会给出该 id。 |
| 429 | MARKETPLACE_SATURATED | 并发调用过多。请等待 Retry-After 秒后重试。 |
| 502 | UPSTREAM_ERROR | 引擎返回了无法使用的内容。请退避后重试。 |
| 503 | SERVICE_UNAVAILABLE | 临时故障。请退避后重试。 |
全部错误代码见 Errors。失败的调用不计费。
价格
价格 每次调用 $0.0012。标价;单日调用超过 1,000 次后单价下调。
说明
- Google 按跨商店归并的商品保存评论。搜索结果中
id全为数字的商品就是这种商品。以c或p开头的id是单个商店的商品,在那里没有评论,返回404 REVIEWS_NOT_FOUND,不计费。