Skip to content

设置 Google 商家信息任务

POST /v3/business_data/google/my_business_info/task_post

本接口用于提交 Google 商家信息查询任务,获取指定本地商家实体的详细信息。查询结果受所选地理位置和语言影响。

HTTP 方法与路径:

text
POST /v3/business_data/google/my_business_info/task_post

完整请求地址:

text
https://api.seermartech.cn/v3/business_data/google/my_business_info/task_post

计费说明

提交任务会产生费用。高优级任务会额外计费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

所有 POST 请求体使用 UTF-8 编码的 JSON 格式,并且顶层是数组:

json
[
  {
    "keyword": "RustyBrick, Inc.",
    "location_code": 1023191,
    "language_code": "en"
  }
]

调用限制:

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

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

如果的回调服务器在 10 秒未响应,连接将因时中断,任务会转任务就绪列表。错误码和错误信息取决于回调服务器。

请求参数

参数类型说明
keywordstring本地商家名称。最多 700 个字符。所有 %## 编码会被解码,字符 + 会被解码为空格。如果中需要使用 %,请写为 %25。该字段还可用于传 cidplace_id
priorityinteger任务优级:1 为普通优级,默认值;2 为高优级。高优级任务会额外计费。
location_namestring条件填搜索位置的完整名称。当未指定 location_codelocation_coordinate 时填。使用该字段后,无需再指定另外两个位置参数。
location_codeinteger条件填搜索位置编码。当未指定 location_namelocation_coordinate 时填。
location_coordinatestring条件填GPS 坐标,格式为 纬度,经度,半径。纬度和经度最多支持 7 位小数;半径最小值为 199.9,最大值为 199999。当未指定 location_namelocation_code 时填。
language_namestring条件填搜索语言的完整名称。当未指定 language_code 时填。
language_codestring条件填搜索语言代码。当未指定 language_name 时填。
tagstring用户自定义任务标识,最多 255 个字符。该值会原样出现在响应的 data 对象中,可用于任务与结果。
postback_urlstring任务完成后接收结果的 URL。本平台会向该地址发送任务结果的 gzip 压缩 POST 请求。
pingback_urlstring任务完成后的通知 URL。本平台会向该地址发送 GET 请求。

keyword 的特殊用法

keyword 可以传商家名称,也可以通过以下格式指定 Google 商家实体标识:

text
cid:194604053573767737
place_id:GhIJQWDl0CIeQUARxks3icF8U8A

  • cid:Google 定义的商家实体唯一 ID。
  • place_id:Google 地图中的商家实体标识。

位置参数示例

使用位置名称:

text
London,England,United Kingdom

使用位置编码:

text
2840

使用地理坐标:

text
53.476225,-2.243572,200

语言参数示例

使用语言名称:

text
English

使用语言代码:

text
en

位置和语言列表可分别通过以下接口获取:

text
GET /v3/business_data/google/locations
GET /v3/business_data/google/languages

回调 URL 占位符

postback_urlpingback_url 支持以下占位符:

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

示例:

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

回调 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唯一任务 ID,UUID 格式。
tasks[].status_codeinteger任务状态码,范围通常为 1000060000
tasks[].status_messagestring任务状态说明。
tasks[].timestring单个任务执行耗时,单位为秒。
tasks[].costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks[].result_countintegerresult 数组中的数量。提交任务接口中通常为 0
tasks[].patharray请求 URL 路径。
tasks[].dataobject请求中提交的任务参数。
tasks[].resultarray/null任务结果数组。提交任务接口中为 null,需要通过任务 ID 查询结果。

请求示例

cURL

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/business_data/google/my_business_info/task_post" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "location_code": 1023191,
      "language_code": "en",
      "keyword": "RustyBrick, Inc."
    },
    {
      "location_name": "New York,New York,United States",
      "language_name": "English",
      "keyword": "RustyBrick, Inc.",
      "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/my_business_info/task_post"

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

# 请求体是 JSON 数组,每次最多提交 100 个任务
payload = [
    {
        "location_code": 1023191,
        "language_code": "en",
        "keyword": "RustyBrick, Inc.",
    },
    {
        "location_name": "New York,New York,United States",
        "language_name": "English",
        "keyword": "RustyBrick, Inc.",
        "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, timeout=30)
response.raise_for_status()

result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        "请求失败:",
        result.get("status_code"),
        result.get("status_message"),
    )

TypeScript

typescript
import axios from "axios";

const payload = [
  {
    location_code: 1023191,
    language_code: "en",
    keyword: "RustyBrick, Inc.",
  },
  {
    location_name: "New York,New York,United States",
    language_name: "English",
    keyword: "RustyBrick, Inc.",
    priority: 2,
    tag: "some_string_123",
    pingback_url:
      "https://your-server.com/pingscript?id=$id&tag=$tag",
  },
];

axios
  .post(
    "https://api.seermartech.cn/v3/business_data/google/my_business_info/task_post",
    payload,
    {
      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.20200909",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0889 sec.",
  "cost": 0.0015,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "status_code": 20100,
      "status_message": "Task Created.",
      "time": "0.0100 sec.",
      "cost": 0.0015,
      "result_count": 0,
      "path": [
        "v3",
        "business_data",
        "google",
        "my_business_info",
        "task_post"
      ],
      "data": {
        "api": "business_data",
        "function": "my_business_info",
        "se": "google",
        "language_code": "en",
        "location_name": "New York,New York,United States",
        "keyword": "RustyBrick, Inc.",
        "se_type": "business_info",
        "device": "desktop",
        "os": "windows"
      },
      "result": null
    }
  ]
}

提交成功后,可使用返回的 tasks[].id 获取任务结果。建议在业务系统中同时处理请求级状态码、任务级状态码以及网络时等异常。

实用场景

  • 批量提交商家名称和地理位置,集中获取多个门店的 Google 商家信息,支持本地 SEO 数据库与门店档案建设。
  • 使用 cidplace_id 定位商家实体,减少同名商家导致的匹错误,提升商家数据洗和实体归因准确率。
  • 按不同语言和地区提交任务,对比跨区域商家展示信息,为化 SEO 和多市场运营提供数据依据。
  • 通过 pingback_url 接收任务完成通知,频繁轮询任务状态,降低异步数据采集系统的资源消耗。
  • 利用 tag 业务订单或门店编号,将接口结果自动匹到 CRM、门店管理系统或 SEO 监控项目。

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