主题
通过任务 ID 获取 Google 商家动态结果
本接口使用 GET 方法,通过任务 ID 获取 Google 商家资料中发布的动态。
请求方法与路径:
text
GET https://api.seermartech.cn/v3/business_data/google/my_business_updates/task_get/$id本接口返回的结果与创建任务时指定的 cid(客户 ID)或 keyword、location 和 language 参数。平台会尽可能准确地模拟指定参数下的搜索环境,使返回结果与任务创建时可见的搜索结果保持一致。
你可以使用响应中的 check_url,在无痕模式下打开并核验结果。
计费说明
本接口在创建任务时计费。任务创建成功后,可在 30 天获取任务结果。
参考价约 ¥0.0320 / 次。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求参数通过路径传递。
| 参数名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,使用 UUID 格式。任务创建后,可在 30 天随时使用该 ID 获取结果。 |
请求示例
cURL
bash
id="09091111-0696-0243-0000-1e835179296a"
curl --location --request GET \
"https://api.seermartech.cn/v3/business_data/google/my_business_updates/task_get/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/business_data/google/my_business_updates/task_get/${taskId}`,
{
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);
});Python
python
import requests
task_id = "09091111-0696-0243-0000-1e835179296a"
response = requests.get(
f"https://api.seermartech.cn/v3/business_data/google/my_business_updates/task_get/{task_id}",
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
if response.ok:
result = response.json()
print(result)
else:
print(f"HTTP 错误:{response.status_code}")
print(response.text)响应说明
服务器返回 JSON 数据 tasks 数组及对应任务的信息。
顶层响应字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。请根据状态码处理异常和错误。 |
status_message | string | 通用状态说明。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
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 | 请求 URL 路径。 |
data | object | 创建任务时提交的参数。 |
result | array | 任务结果数组。 |
tasks.data 字段
data 对象通常创建任务时提交的参数,例如:
| 字段名 | 类型 | 说明 |
|---|---|---|
se_type | string | 搜索结果类型,通常为 business_updates。 |
se | string | 搜索引擎名称,例如 google。 |
api | string | API 产品类型,例如 business_data。 |
function | string | 功能名称,例如 my_business_updates。 |
language_code | string | 语言代码。 |
location_name | string | 地理位置名称。 |
keyword | string | 查询或商家标识。 |
device | string | 设备类型,例如 desktop。 |
os | string | 操作系统,例如 windows。 |
result 字段说明
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | 创建任务时提交的。返回时会对经过编码的进行解码,+ 可能被解码为空格。如果创建任务时在该字段中传 cid,此处将返回对应的 cid,例如 cid:2946633002421908862。 |
se_domain | string | 创建任务时指定的搜索引擎域名。 |
location_code | integer | 创建任务时指定的地理位置代码。 |
language_code | string | 创建任务时指定的语言代码。 |
check_url | string | 搜索引擎结果页面的直接 URL,可用于核验返回结果的准确性。 |
datetime | string | 获取结果的日期和时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
business_updates_id | string | 商家动态在搜索结果中的唯一标识符。 |
cid | string | Google 定义的客户 ID,用于唯一标识本地商家。 |
feature_id | string | 搜索结果中该的唯一标识符。 |
item_types | array | items 数组中的结果类型。可能的值为 google_business_post。 |
items_count | integer | items 数组中的数量。 |
items | array | 商家动态结果数组。 |
items 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 google_business_post。 |
rank_group | integer | 在相同 type 类型组中的排名。不同类型的排名不会计此字段。 |
rank_absolute | integer | 在所有商家动态中的绝对排名。 |
position | string | 素在搜索结果中的对齐位置。目前可能为 right。 |
xpath | string | 素在页面中的 XPath 路径。 |
author | string | 动态的或发布商家名称。 |
snippet | string | 动态的附加摘要。没有时可能为 null。 |
post_text | string | 动态正文。 |
url | string | 动态对应的页面 URL。 |
images_url | string | 动态中的图片 URL。 |
post_date | string | 动态发布时间,格式为 mm/dd/yyyy hh:mm:ss。 |
timestamp | string | 动态发布时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
links | array | 动态中的链接数组。 |
links 数组字段
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 链接类型,可能为 link_element。 |
title | string | 链接锚文本。 |
url | string | 链接指向的页面 URL。 |
响应示例
json
{
"version": "0.1.20200909",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1259 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "09091111-0696-0243-0000-1e835179296a",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1259 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"business_data",
"google",
"my_business_updates",
"task_get"
],
"data": {
"se_type": "business_updates",
"se": "google",
"api": "business_data",
"function": "my_business_updates",
"language_code": "en",
"location_name": "New York,New York,United States",
"keyword": "RustyBrick, Inc.",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "RustyBrick, Inc.",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/search?q=RustyBrick%2C+Inc.",
"datetime": "2020-04-02 00:00:00 +00:00",
"business_updates_id": "2946633002421908862",
"cid": "2946633002421908862",
"feature_id": "local_posts",
"item_types": [
"google_business_post"
],
"items_count": 2,
"items": [
{
"type": "google_business_post",
"rank_group": 1,
"rank_absolute": 1,
"position": "right",
"xpath": "/div/span",
"author": "RustyBrick, Inc.",
"snippet": null,
"post_text": "The RustyBrick team is working from home. We are fully up and operational.",
"url": "https://search.google.com/local/posts",
"images_url": "https://lh4.googleusercontent.com/photo.jpg",
"post_date": "04/02/2020 00:00:00",
"timestamp": "2020-04-02 00:00:00 +00:00",
"links": null
},
{
"type": "google_business_post",
"rank_group": 2,
"rank_absolute": 2,
"position": "right",
"xpath": "/div/span",
"author": "RustyBrick, Inc.",
"snippet": null,
"post_text": "We hope everyone is safe and healthy.",
"url": "https://search.google.com/local/posts",
"images_url": "https://lh4.googleusercontent.com/photo.jpg",
"post_date": "03/16/2020 00:00:00",
"timestamp": "2020-03-16 00:00:00 +00:00",
"links": [
{
"type": "link_element",
"title": "了解更多",
"url": "https://example.com/"
}
]
}
]
}
]
}
]
}错误处理
建议客户端同时检查以下字段:
- 顶层
status_code和status_message; tasks[*].status_code和tasks[*].status_message;tasks[*].result是否存在或为空;- HTTP 状态码及网络请求异常。
当 tasks_error 大于 0,或任务级 status_code 表示失败时,应记录错误信息并业务策略进行重试或人工处理。
实用场景
- 抓取本地商家动态,汇总目标商家的、促销和活动信息,支持本地 SEO运营。
- 监控竞争对手商家更新,按商家
cid定期获取最新动态,分析竞品促销节奏与营销主题。 - 提取商家发布时间,结合
post_date和timestamp建立更新频率报表,评估商家本地搜索活跃度。 - 分析商家动态中的外链与图片,读取
links、url和images_url,评估引流方式与素材使用。 - 核验本地搜索结果准确性,通过
check_url对搜索页面,排查地区、语言或问题。