Skip to content

reviews/google/task_post

GET /v3/appendix/errors

设置 Google Reviews 任务

请求方法与路径: POST /v3/reviews/google/task_post

本接口用于创建 Google 搜索结果页中“Reviews(评论)”的数据采集任务。返回结果受所选搜索地点和语言影响,地点可通过 /v3/reviews/google/locations 查询,语言可通过 /v3/reviews/google/languages 查询。

> 应本地商家的名称,否则可能无法获取对应评论。

计费说明

  • 任务创建会产生基础费用。
  • 评论数据按 items 数组中每返回 10 条评论计费。例如,设置 "depth": 11 时,将按 20 条评论计费。
  • 设置 priority: 2 的高优级任务会产生额外费用。
  • 如果 keyword含特定搜索操作符,单任务费用将乘以 5。
  • 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求限制与任务获取

  • 请求体使用 UTF-8 编码的 JSON 格式。
  • 每次请求最多提交 100 个任务。 平台限流以认证说明中的 30/60/120 次/分钟规则为准。
  • 创建任务后,可使用返回的任务 id 查询任务结果。
  • 也可以在请求中设置 postback_urlpingback_url,在任务完成后接收通知。
  • 如果接收服务器在 10 秒未响应,连接将因时中止,任务会转移到“任务就绪”列表。

请求参数

请求体是 JSON 数组:

json
[
  {
    "keyword": "hedonism wines",
    "location_name": "London,England,United Kingdom",
    "language_name": "English"
  }
]
参数类型说明
keywordstring本地商家名称或搜索,最长 700 个字符。所有 %## 编码会被解码,+ 会被解码为空格。若中需要使用 %,请写作 %25。<br><br>如果 allinanchor:allintext:allintitle:allinurl:define:filetype:id:inanchor:info:intext:intitle:inurl:link:related:site: 等操作符,单任务费用将乘以 5。 cache: 的不受支持,会返回验证错误。<br><br>该字段也可用于传递商家 cid 或 Google Maps 的 place_id。示例:cid:194604053573767737place_id:GhIJQWDl0CIeQUARxks3icF8U8A
priorityinteger任务优级:<br>1:普通优级,默认值;<br>2:高优级,费用更高。
location_namestring条件填搜索引擎地点的完整名称。未提供 location_codelocation_coordinate 时填。使用此参数时,不要同时传递另外两个地点参数。<br><br>可通过 GET https://api.seermartech.cn/v3/reviews/google/locations 获取可用地点。示例:London,England,United Kingdom
location_codeinteger条件填搜索引擎地点代码。未提供 location_namelocation_coordinate 时填。使用此参数时,不要同时传递另外两个地点参数。<br><br>可通过 GET https://api.seermartech.cn/v3/reviews/google/locations 获取地点代码。示例:2840
location_coordinatestring条件填地点 GPS 坐标,格式为 latitude,longitude,radius。纬度和经度最多支持 7 位小数,radius 最小值为 199.9。使用此参数时,不要同时传递 location_namelocation_code。<br><br>示例:53.476225,-2.243572,200
language_namestring条件填搜索引擎语言的完整名称。未提供 language_code 时填。使用此参数时,不要同时传递 language_code。<br><br>可通过 GET https://api.seermartech.cn/v3/reviews/google/languages 获取可用语言。示例:English
language_codestring条件填搜索引擎语言代码。未提供 language_name 时填。使用此参数时,不要同时传递 language_name。<br><br>可通过 GET https://api.seermartech.cn/v3/reviews/google/languages 获取语言代码。示例:en
depthinteger解析深度,即期望获取的评论数量。建议设置为 10 的倍数,因为系统按每批 10 条评论处理。默认值为 10
sort_bystring评论排序方式:<br>newest:最新评论优;<br>highest_rating:评分最高优;<br>lowest_rating:评分最低优;<br>relevant:按性排序。<br><br>默认值:relevant
tagstring自定义任务标识,最长 255 个字符。可用于任务与业务数据。指定的值会原样出现在响应的 data 数组中。
postback_urlstring任务完成后,本平台会向该地址发送结果的 POST 请求,使用 gzip 压缩。<br><br>URL 中可使用 $id$tag 占位符,发送时会替换为任务 ID 和经过 URL 编码的标签。<br><br>示例:https://your-server.com/postbackscript?id=$id<br>https://your-server.com/postbackscript?id=$id&tag=$tag
pingback_urlstring任务完成后,本平台会向该地址发送 GET 请求进行通知。<br><br>URL 中可使用 $id$tag 占位符,发送时会替换为任务 ID 和经过 URL 编码的标签。<br><br>示例:https://your-server.com/pingscript?id=$id<br>https://your-server.com/pingscript?id=$id&tag=$tag

地点参数互斥

以下三组参数三选一:

  • location_name
  • location_code
  • location_coordinate

以下两组参数二选一:

  • language_name
  • language_code

响应字段

创建任务后,接口返回 JSON 数据 tasks 数组已创建任务的信息。

字段类型说明
versionstring当前 API 版本。
status_codeinteger请求级状态码。错误码详见 /v3/appendix/errors。建议对异常和错误进行统一处理。
status_messagestring请求级状态信息。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务总数。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务对象数组。
tasks[].idstring任务唯一标识,UUID 格式。
tasks[].status_codeinteger任务状态码,通常为 10000 至 60000。
tasks[].status_messagestring任务状态信息。
tasks[].timestring任务执行耗时,单位为秒。
tasks[].costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks[].result_countintegerresult 数组中的结果数量。
tasks[].patharray请求路径信息。
tasks[].dataarray/object创建任务时提交的参数。
tasks[].resultarray/null任务结果。对于任务创建接口,该字段为 null;需要使用任务 ID 获取后续结果。

请求示例

cURL

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/reviews/google/task_post" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "location_name": "London,England,United Kingdom",
      "language_name": "English",
      "keyword": "hedonism wines"
    },
    {
      "location_name": "London,England,United Kingdom",
      "language_name": "English",
      "keyword": "hedonism wines",
      "depth": 50,
      "sort_by": "highest_rating",
      "priority": 2,
      "tag": "some_string_123",
      "pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag"
    },
    {
      "location_name": "London,England,United Kingdom",
      "language_name": "English",
      "keyword": "hedonism wines",
      "postback_url": "https://your-server.com/postbackscript"
    }
  ]'

Python

python
import requests

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

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

post_data = [
    {
        "location_name": "London,England,United Kingdom",
        "language_name": "English",
        "keyword": "hedonism wines",
    },
    {
        "location_name": "London,England,United Kingdom",
        "language_name": "English",
        "keyword": "hedonism wines",
        "depth": 50,
        "sort_by": "highest_rating",
        "priority": 2,
        "tag": "some_string_123",
        "pingback_url": "https://your-server.com/pingscript?id=$id&tag=$tag",
    },
    {
        "location_name": "London,England,United Kingdom",
        "language_name": "English",
        "keyword": "hedonism wines",
        "postback_url": "https://your-server.com/postbackscript",
    },
]

response = requests.post(url, headers=headers, json=post_data)
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
import axios from "axios";

const postData = [
  {
    location_name: "London,England,United Kingdom",
    language_name: "English",
    keyword: "hedonism wines",
  },
  {
    location_name: "London,England,United Kingdom",
    language_name: "English",
    keyword: "hedonism wines",
    depth: 50,
    sort_by: "highest_rating",
    priority: 2,
    tag: "some_string_123",
    pingback_url: "https://your-server.com/pingscript?id=$id&tag=$tag",
  },
  {
    location_name: "London,England,United Kingdom",
    language_name: "English",
    keyword: "hedonism wines",
    postback_url: "https://your-server.com/postbackscript",
  },
];

axios
  .post(
    "https://api.seermartech.cn/v3/reviews/google/task_post",
    postData,
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    // 处理任务创建结果
    console.log(response.data);
  })
  .catch((error) => {
    // 处理请求错误
    console.error(error.response?.data || error.message);
  });

响应示例

json
{
  "version": "0.1.20200325",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.1329 sec.",
  "cost": 0.00375,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20100,
      "status_message": "Task Created.",
      "time": "0.0150 sec.",
      "cost": 0.00375,
      "result_count": 0,
      "path": [
        "v3",
        "reviews",
        "google",
        "task_post"
      ],
      "data": {
        "api": "reviews",
        "function": "task_post",
        "se": "google",
        "location_name": "London,England,United Kingdom",
        "language_name": "English",
        "keyword": "hedonism wines",
        "depth": 50,
        "device": "desktop",
        "os": "windows"
      },
      "result": null
    }
  ]
}

实用场景

  • 批量创建商家评论采集任务,集中获取多个门店的 Google 评论,用于门店口碑监控和服务质量评估。
  • 按评分或时间排序采集评论,优分析最新评论、最高评分或最低评分,发现用户反馈趋势和负面问题。
  • 结合 place_idcid 定位商家,减少同名商家带来的匹误差,提高本地 SEO 竞品和品牌监测的准确性。
  • 使用 tag 业务项目,将评论任务与门店、客户、活动或分组对应,降低异步结果回传后的数据归属成本。
  • ** postback_urlpingback_url 自动接收结果通知**,在任务完成后触发评论分析、告警或报表更新流程。

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