Skip to content

设置 Google 商家问答任务

POST /v3/business_data/google/questions_and_answers/task_post

本接口使用 POST 方法,路径为:

/v3/business_data/google/questions_and_answers/task_post

用于提交 Google 商家资料中的“问题与回答”采集任务。任务结果指定商家的问题和回答正文,以及发布时间、用户信息等数据。

返回数据取决于所选的地区和语言。地区可通过 /v3/business_data/google/locations 查询,语言可通过 /v3/business_data/google/languages 查询。

每 20 个问题计费一次;每个问题最多返回 5 条回答。

计费说明

提交任务会产生费用。参考价约 ¥0.0054 / 次,价格可能因任务深度和优级而变化。

  • depth 每增加至 20,搜索引擎返回更多问题时可能产生额外费用。
  • 如果请求的 depth 高于返回的问题数量,未使用部分将自动退还到账户余额。
  • 使用高优级任务(priority=2)会产生额外费用。
  • 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求说明

所有 POST 数据使用 UTF-8 编码的 JSON 格式,并以 JSON 数组作为请求体:

json
[
  {
    "keyword": "The Last Bookstore",
    "location_code": 1013962,
    "language_code": "en"
  }
]

请求限制:

平台限流以认证说明中的 30/60/120 次/分钟规则为准。

  • 每次 POST 请求最多 100 个任务。 -过 100 个任务的部分会返回错误码 40006
  • 每个任务提交后会返回唯一的任务 ID,可使用该 ID 查询任务结果。
  • 也可以通过 postback_urlpingback_url 在任务完成后接收通知。

如果的回调服务器在 10 秒未返回响应,连接将因时中止,任务会转移到“任务就绪”列表。

请求参数

参数类型说明
keywordstring。本地商家名称,最多 700 个字符。该字段中的 %## 编码会被解码,字符 + 会被解码为空格。如果中需要使用百分号 %,应写为 %25。也可以使用以下格式直接指定商家:cid:商家唯一 IDplace_id:Google 地图商家 ID。示例:cid:194604053573767737place_id:GhIJQWDl0CIeQUARxks3icF8U8A
priorityinteger可选,任务优级。1:普通优级,默认值;2:高优级。高优级任务会额外计费。
location_namestring地区名。当未指定 location_codelocation_coordinate 时填。使用该字段后,无需再指定另外两个地区参数。示例:London,England,United Kingdom
location_codeinteger搜索引擎地区代码。当未指定 location_namelocation_coordinate 时填。使用该字段后,无需再指定另外两个地区参数。示例:2840
location_coordinatestring地区 GPS 坐标。当未指定 location_namelocation_code 时填。格式为 "纬度,经度,半径",纬度和经度最多保留 7 位小数;半径最小值为 199.9,最大值为 199999。示例:53.476225,-2.243572,200
language_namestring搜索引擎语言名。当未指定 language_code 时填。使用该字段后,无需再指定 language_code。示例:English
language_codestring搜索引擎语言代码。当未指定 language_name 时填。使用该字段后,无需再指定 language_name。示例:en
depthinteger可选,解析深度,即最多返回的问题数量。默认值为 20,最大值为 700。每组最多 20 个问题计费一次;当 depth 大于 20 且返回 20 个问题时,可能产生额外费用。
tagstring可选,自定义任务标识,最多 255 个字符。可用于将任务与结果进行匹,提交的值会原样出现在响应的 data 对象中。
postback_urlstring可选,任务结果回调地址。任务完成后,本平台会向该地址发送结果的 gzip 压缩 POST 请求。URL 中可使用 $id$tag 占位符,平台发送请求前会替换为任务 ID 和经过 URL 编码的标签值。
pingback_urlstring可选,任务完成通知地址。任务完成后,本平台会向该地址发送 GET 请求。URL 中可使用 $id$tag 占位符,平台发送请求前会替换为任务 ID 和经过 URL 编码的标签值。

地区和语言参数

location_namelocation_codelocation_coordinate 三只能选择一。

language_namelanguage_code 二选一。

可通过以下接口获取可用地区和语言:

  • 地区:/v3/business_data/google/locations
  • 语言:/v3/business_data/google/languages

回调 URL 占位符

示例:

text
https://your-server.com/postbackscript?id=$id&tag=$tag

平台会将:

  • $id 替换为任务 ID。
  • $tag 替换为经过 URL 编码的任务标签。

postback_urlpingback_url 中的特殊字符会进行 URL 编码,例如 # 会编码为 %23

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用状态码。
status_messagestring通用状态信息。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务总数。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

tasks 子项字段

字段类型说明
idstring任务唯一标识,UUID 格式。
status_codeinteger任务状态码,通常在 1000060000 范围。
status_messagestring任务状态信息。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray请求路径。
dataobject本次 POST 请求中提交的任务参数。
resultarray/null任务结果数组。提交任务接口中通常为 null,需要通过任务 ID 获取后续结果。

完整状态码列表请参考 /v3/appendix/errors。建议客户端对状态码、时和回调失败等异常进行统一处理。

请求示例

curl

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/business_data/google/questions_and_answers/task_post" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "location_code": 1013962,
      "language_code": "en",
      "keyword": "The Last Bookstore"
    },
    {
      "location_name": "Los Angeles,California,United States",
      "language_name": "English",
      "keyword": "The Last Bookstore",
      "priority": 2,
      "tag": "some_string_123",
      "pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
    }
  ]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/business_data/google/questions_and_answers/task_post"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

payload = [
    {
        "location_code": 1013962,
        "language_code": "en",
        "keyword": "The Last Bookstore",
    },
    {
        "location_name": "Los Angeles,California,United States",
        "language_name": "English",
        "keyword": "The Last Bookstore",
        "priority": 2,
        "tag": "some_string_123",
        "pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag",
    },
]

response = requests.post(url, headers=headers, json=payload)
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
const url =
  "https://api.seermartech.cn/v3/business_data/google/questions_and_answers/task_post";

const payload = [
  {
    location_code: 1013962,
    language_code: "en",
    keyword: "The Last Bookstore",
  },
  {
    location_name: "Los Angeles,California,United States",
    language_name: "English",
    keyword: "The Last Bookstore",
    priority: 2,
    tag: "some_string_123",
    pingback_url:
      "https://your-server.com/pingscript?id=$id&tag=$tag",
  },
];

const response = await fetch(url, {
  method: "POST",
  headers: {
    Authorization: "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});

const data = await response.json();

if (data.status_code === 20000) {
  console.log(data);
} else {
  console.error(
    `请求失败,状态码:${data.status_code},消息:${data.status_message}`
  );
}

响应示例

json
{
  "version": "0.1.20240422",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.2147 sec.",
  "cost": 0.00075,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "080b7b8e-1234-4567-8901-123456789abc",
      "status_code": 20100,
      "status_message": "Task Created.",
      "time": "0.0123 sec.",
      "cost": 0.00075,
      "result_count": 0,
      "path": [
        "v3",
        "business_data",
        "google",
        "questions_and_answers",
        "task_post"
      ],
      "data": {
        "api": "business_data",
        "function": "questions_and_answers",
        "language_code": "en",
        "location_name": "Los Angeles,California,United States",
        "keyword": "The Last Bookstore",
        "se_type": "questions_and_answers",
        "se": "google",
        "device": "desktop",
        "os": "windows"
      },
      "result": null
    }
  ]
}

实用场景

  • 采集本地商家问答,汇总目标商家的常见问题与官方或用户回答,完善本地 SEO和商家资料。
  • 监控竞争对手商家问答变化,定期提交任务并对比新增问题、回答和时间信息,发现用户点与竞品服务缺口。
  • 分析决策疑问,按地区和语言提取问题文本,归纳价格、营业时间、服务能力等高频主题,指导落地页和 FAQ 建设。
  • 评估本地市场需求差异,针对不同 location_code 或坐标区域采集问答数据,为区域化布局和门店运营提供依据。
  • 构建问答追踪流程,结合 tagpingback_urlpostback_url 自动任务与结果,降低批量 SEO 数据采集的人工处理成本。

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