Skip to content

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"
  }
]

任务参数

参数类型说明
keywordstring填。 商家名称,最多 700 个字符。所有 %## 编码会被解码,字符 + 会被解码为空格。若中需要传递 %,请编码为 %25。此字段也可以传 cidplace_id。示例:cid:194604053573767737place_id:GhIJQWDl0CIeQUARxks3icF8U8A
location_namestring搜索地点的完整名称。当未指定 location_codelocation_coordinate 时填。使用此参数后,无需再传另外两个地点参数。可通过 /v3/business_data/google/locations 获取可用地点。示例:London,England,United Kingdom
location_codeinteger搜索地点代码。当未指定 location_namelocation_coordinate 时填。使用此参数后,无需再传另外两个地点参数。可通过 /v3/business_data/google/locations 获取可用地点。示例:2840
location_coordinatestring地点 GPS 坐标。当未指定 location_namelocation_code 时填。格式为 latitude,longitude,radius。纬度和经度最多 7 位小数;radius 范围为 199.9199999。示例:53.476225,-2.243572,200
language_namestring搜索语言的完整名称。当未指定 language_code 时填。使用此参数后,无需再传 language_code。可通过 /v3/business_data/google/languages 获取可用语言。示例:English
language_codestring搜索语言代码。当未指定 language_name 时填。使用此参数后,无需再传 language_name。可通过 /v3/business_data/google/languages 获取可用语言代码。示例:en
depthinteger解析深度,即最多返回的问题数量。可选,默认值为 20,最大值为 100。每组最多 20 个问题计费一次。
tagstring用户自定义任务标识,可选,最多 255 个字符。可用于任务与结果。提交的值会原样返回在响应任务的 data 对象中。

地点参数说明

location_namelocation_codelocation_coordinate 三只能选择一个。语言参数 language_namelanguage_code 只能选择一个。

keyword 除商家名称外,还可以使用 Google 商家实体标识定位目标商家:

text
cid:194604053573767737
place_id:GhIJQWDl0CIeQUARxks3icF8U8A

响应结构

接口返回 JSON 数据,核心结构如下:

字段类型说明
versionstring当前 API 版本。
status_codeinteger局状态码。可参考 /v3/appendix/errors
status_messagestring局状态说明。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中执行失败的任务数量。
tasksarray任务结果数组。

任务字段

字段类型说明
idstring任务唯一标识,UUID 格式。
status_codeinteger任务状态码,通常在 1000060000 范围。
status_messagestring任务状态说明。
timestring任务执行耗时。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray请求路径。
dataobject创建任务时提交的参数。
resultarray任务结果数组。

结果字段

字段类型说明
keywordstring请求中的。返回时会解码 %##,字符 + 会解码为空格。如果请求中传 cid,此处会返回对应的 cid 值。
se_domainstring请求中使用的搜索引擎域名。
location_codeinteger请求中的地点代码。
language_codestring请求中的语言代码。
check_urlstring搜索结果页面的直接 URL,可用于核验返回结果。
datetimestring获取结果的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00
cidstringGoogle 定义的商家实体唯一 ID。
feature_idstring搜索结果特征的唯一标识。
item_typesarray结果项类型列表,可能 google_business_question_item
items_without_answersarray没有回答的问题列表。
items_countintegeritems 数组中的问题数量。
itemsarray含回答的问题列表。

问题字段

items_without_answersitems 中的问题对象均可能以下字段:

字段类型说明
typestring素类型,固定为 google_business_question_item
rank_groupinteger在相同 type素组中的排名。不同类型之间不会计此排名。
rank_absoluteinteger在结果中的绝对排名。
question_idstring问题 ID。
urlstring问题页 URL。
profile_image_urlstring提问用户的头像 URL。
profile_urlstring提问用户的个人资料 URL。
profile_namestring页面显示的用户名称。
question_textstring当前问题文本。
original_question_textstring原始问题文本,可能为 null
time_agostring问题发布距今的大致时间。
timestampstring问题发布的准确时间。
itemsarray当前问题下的回答列表。

回答字段

问题对象中的 items 数组回答对象,类型为 google_business_answer_element

字段类型说明
typestring素类型,固定为 google_business_answer_element
answer_idstring回答 ID。
profile_image_urlstring回答用户的头像 URL。
profile_urlstring回答用户的个人资料 URL。
profile_namestring页面显示的用户名称。
answer_textstring当前回答文本。
original_answer_textstring原始回答文本,可能为 null
time_agostring回答发布距今的大致时间。
timestampstring回答发布的准确时间。

请求示例

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、问题文本和回答文本,发现用户点变化并及时更新商家信息。

统一入口:官网 · LLM API · 控制台