主题
Google 商家问答实时任务
POST /v3/business_data/google/questions_and_answers/live
本接口使用 POST 方法,路径为:
/v3/business_data/google/questions_and_answers/live
用于实时获取指定 Google 商家实体的问答信息问题与回答的完整文本、发布时间、用户资料及数据。结果会根据指定的地点和语言返回。
地点可参考 /v3/business_data/google/locations/,语言可参考 /v3/business_data/google/languages/。
每 20 个问题计费一次,每个问题最多返回 5 个回答。单次 Live API 请求只能 1 个任务;平台限流以认证说明中的 30/60/120 次/分钟规则为准,同时进行的请求数量最多为 30 个。
计费说明
- 参考价约 ¥0.039 / 每 20 个问题
depth过 20 时,如果返回的问题数量 20,可能产生额外费用。- 如果请求的
depth高于返回的问题数量,未使用部分会自动退还到账户余额。 - 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
请求体使用 UTF-8 编码的 JSON 数组格式:
json
[
{
"keyword": "The Last Bookstore",
"location_name": "Los Angeles,California,United States",
"language_code": "en"
}
]任务参数
| 参数 | 类型 | 说明 |
|---|---|---|
keyword | string | 填。 商家名称,最多 700 个字符。所有 %## 编码会被解码,字符 + 会被解码为空格。若中需要传递 %,请编码为 %25。此字段也可以传 cid 或 place_id。示例:cid:194604053573767737、place_id:GhIJQWDl0CIeQUARxks3icF8U8A。 |
location_name | string | 搜索地点的完整名称。当未指定 location_code 或 location_coordinate 时填。使用此参数后,无需再传另外两个地点参数。可通过 /v3/business_data/google/locations 获取可用地点。示例:London,England,United Kingdom。 |
location_code | integer | 搜索地点代码。当未指定 location_name 或 location_coordinate 时填。使用此参数后,无需再传另外两个地点参数。可通过 /v3/business_data/google/locations 获取可用地点。示例:2840。 |
location_coordinate | string | 地点 GPS 坐标。当未指定 location_name 或 location_code 时填。格式为 latitude,longitude,radius。纬度和经度最多 7 位小数;radius 范围为 199.9 至 199999。示例:53.476225,-2.243572,200。 |
language_name | string | 搜索语言的完整名称。当未指定 language_code 时填。使用此参数后,无需再传 language_code。可通过 /v3/business_data/google/languages 获取可用语言。示例:English。 |
language_code | string | 搜索语言代码。当未指定 language_name 时填。使用此参数后,无需再传 language_name。可通过 /v3/business_data/google/languages 获取可用语言代码。示例:en。 |
depth | integer | 解析深度,即最多返回的问题数量。可选,默认值为 20,最大值为 100。每组最多 20 个问题计费一次。 |
tag | string | 用户自定义任务标识,可选,最多 255 个字符。可用于任务与结果。提交的值会原样返回在响应任务的 data 对象中。 |
地点参数说明
location_name、location_code 和 location_coordinate 三只能选择一个。语言参数 language_name 与 language_code 只能选择一个。
keyword 除商家名称外,还可以使用 Google 商家实体标识定位目标商家:
text
cid:194604053573767737
place_id:GhIJQWDl0CIeQUARxks3icF8U8A响应结构
接口返回 JSON 数据,核心结构如下:
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 局状态码。可参考 /v3/appendix/errors。 |
status_message | string | 局状态说明。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中执行失败的任务数量。 |
tasks | array | 任务结果数组。 |
任务字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 | 请求路径。 |
data | object | 创建任务时提交的参数。 |
result | array | 任务结果数组。 |
结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 请求中的。返回时会解码 %##,字符 + 会解码为空格。如果请求中传 cid,此处会返回对应的 cid 值。 |
se_domain | string | 请求中使用的搜索引擎域名。 |
location_code | integer | 请求中的地点代码。 |
language_code | string | 请求中的语言代码。 |
check_url | string | 搜索结果页面的直接 URL,可用于核验返回结果。 |
datetime | string | 获取结果的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
cid | string | Google 定义的商家实体唯一 ID。 |
feature_id | string | 搜索结果特征的唯一标识。 |
item_types | array | 结果项类型列表,可能 google_business_question_item。 |
items_without_answers | array | 没有回答的问题列表。 |
items_count | integer | items 数组中的问题数量。 |
items | array | 含回答的问题列表。 |
问题字段
items_without_answers 和 items 中的问题对象均可能以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 google_business_question_item。 |
rank_group | integer | 在相同 type素组中的排名。不同类型之间不会计此排名。 |
rank_absolute | integer | 在结果中的绝对排名。 |
question_id | string | 问题 ID。 |
url | string | 问题页 URL。 |
profile_image_url | string | 提问用户的头像 URL。 |
profile_url | string | 提问用户的个人资料 URL。 |
profile_name | string | 页面显示的用户名称。 |
question_text | string | 当前问题文本。 |
original_question_text | string | 原始问题文本,可能为 null。 |
time_ago | string | 问题发布距今的大致时间。 |
timestamp | string | 问题发布的准确时间。 |
items | array | 当前问题下的回答列表。 |
回答字段
问题对象中的 items 数组回答对象,类型为 google_business_answer_element:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 google_business_answer_element。 |
answer_id | string | 回答 ID。 |
profile_image_url | string | 回答用户的头像 URL。 |
profile_url | string | 回答用户的个人资料 URL。 |
profile_name | string | 页面显示的用户名称。 |
answer_text | string | 当前回答文本。 |
original_answer_text | string | 原始回答文本,可能为 null。 |
time_ago | string | 回答发布距今的大致时间。 |
timestamp | string | 回答发布的准确时间。 |
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/business_data/google/questions_and_answers/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "Los Angeles,California,United States",
"language_code": "en",
"keyword": "The Last Bookstore"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/business_data/google/questions_and_answers/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
# 请求体是 JSON 数组
payload = [
{
"location_name": "Los Angeles,California,United States",
"language_code": "en",
"keyword": "The Last Bookstore",
}
]
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,状态码:%s,消息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript
typescript
const response = await fetch(
"https://api.seermartech.cn/v3/business_data/google/questions_and_answers/live",
{
method: "POST",
headers: {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify([
{
location_name: "Los Angeles,California,United States",
language_code: "en",
keyword: "The Last Bookstore",
},
]),
}
);
const result = await response.json();
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`请求失败,状态码:${result.status_code},消息:${result.status_message}`
);
}响应示例
以下示例展示了型响应结构,返回的问题数量和字段可能不同:
json
{
"version": "0.1.20240422",
"status_code": 20000,
"status_message": "Ok.",
"time": "7.2446 sec.",
"cost": 0.0054,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "07281531-3d9b-0694-0210-7f5f7c2e9a42",
"status_code": 20000,
"status_message": "Ok.",
"time": "7.1000 sec.",
"cost": 0.0054,
"result_count": 1,
"path": [
"v3",
"business_data",
"google",
"questions_and_answers",
"live"
],
"data": {
"api": "business_data",
"function": "questions_and_answers",
"se": "google",
"language_code": "en",
"location_name": "Los Angeles,California,United States",
"keyword": "The Last Bookstore",
"se_type": "questions_and_answers",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "The Last Bookstore",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/maps",
"datetime": "2024-04-25 12:49:03 +00:00",
"cid": "8591a1380838a935",
"feature_id": "questions_and_answers",
"item_types": [
"google_business_question_item"
],
"items_without_answers": [],
"items_count": 20,
"items": [
{
"type": "google_business_question_item",
"rank_group": 1,
"rank_absolute": 1,
"question_id": "8@1:CAESGUNWX0I0cUFQSFFOMXc5aXBJVkdBQUZwMGc|",
"url": "https://www.google.com/maps/place/data=...",
"profile_image_url": "https://lh3.googleusercontent.com/...",
"profile_url": "https://www.google.com/maps/contrib/...",
"profile_name": "Charles Kang",
"question_text": "Hi. Do you still trade used books?",
"original_question_text": null,
"time_ago": "3 years ago",
"timestamp": "2021-04-25 12:49:03 +00:00",
"items": [
{
"type": "google_business_answer_element",
"answer_id": "answer_123456",
"profile_image_url": "https://lh3.googleusercontent.com/...",
"profile_url": "https://www.google.com/maps/contrib/...",
"profile_name": "The Last Bookstore",
"answer_text": "Yes, we accept used books under specific conditions.",
"original_answer_text": null,
"time_ago": "3 years ago",
"timestamp": "2021-04-26 09:10:00 +00:00"
}
]
}
]
}
]
}
]
}状态码与异常处理
20000:请求成功。- 状态码:表示请求或任务执行异常。 -局状态码位于顶层
status_code,任务级状态码位于tasks[].status_code。 - 建议在客户端同时检查 HTTP 状态、顶层状态码和任务级状态码,并针对失败任务实施重试、记录和告警机制。
- 完整状态码列表请参考
/v3/appendix/errors。
实用场景
- 提取商家常见问题,汇总营业时间、库存、服务规则等高频咨询,为 FAQ 页面和客服话术提供依据。
- 分析用户需求与购买意图,从问题文本中识别产品、价格、库存和服务偏好,选题与本地 SEO 优化。
- 监测商家问答覆盖率,区分已回答和未回答问题,帮助运营团队优处理影响转化的咨询。
- 对比多门店问答表现,按地点和语言采集各门店问题数量及,评估本地搜索运营质量。
- 追踪问答变化,结合
timestamp、问题文本和回答文本,发现用户点变化并及时更新商家信息。