主题
按任务 ID 获取 Google 商家资料结果
本接口用于获取指定任务的 Google 商家资料结果。HTTP 方法和路径为:
http
GET https://api.seermartech.cn/v3/business_data/google/my_business_info/task_get/$idGoogle 商家资料接口可返回商家的信息服务描述、地址、电话、网站、评分、营业时间、热门时段、服务项目及本地商家信息等。
计费说明
- 创建任务时收取费用。
- 任务创建成功后,可在 30 天获取任务结果。
- 任务成本以响应头
X-SeerMarTech-Charge-CNY为准。 - 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
接口通过路径参数传任务 ID,请求体为空。
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,使用 UUID 格式。任务创建后 30 天可随时使用该 ID 获取结果。 |
请求示例
cURL
bash
task_id="09171517-0696-0242-0000-a96bc1ad0bce"
curl --location --request GET \
"https://api.seermartech.cn/v3/business_data/google/my_business_info/task_get/${task_id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "09171517-0696-0242-0000-a96bc1ad0bce"
url = (
"https://api.seermartech.cn/v3/business_data/google/"
f"my_business_info/task_get/{task_id}"
)
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
response.raise_for_status()
result = response.json()
print(result)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_info/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);
});响应结构
接口返回 JSON 数据,顶层 tasks 数组。每个任务对象任务状态、请求参数及业务结果。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用响应状态码。建议根据状态码设计异常处理逻辑。 |
status_message | string | 通用状态说明。 |
time | string | 接口执行耗时,例如 0.0776 sec.。 |
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 | 任务业务结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 创建任务时提交的。返回时会对编码进行解码,+ 会被解码为空格。如果提交的是 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,例如 2019-11-15 12:57:46 +00:00。 |
item_types | array | 结果项类型列表,可能 google_business_info。 |
items_count | integer | items 数组中的数量。 |
items | array | 商家资料结果项数组。 |
items 商家资料字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 google_business_info。 |
rank_group | integer | 在相同 type 结果组中的排名。不同类型结果不会计该排名。 |
rank_absolute | integer | 在所有结果中的绝对排名。 |
position | string | 结果在搜索结果页中的对齐位置。 |
title | string | 商家名称。 |
original_title | string | 未经翻译的原始商家名称。 |
description | string | 商家描述。 |
category | string | 商家主要类别。 |
category_ids | array | 通用的商家类别 ID,不随国家或地区变化。 |
additional_categories | array | 商家的类别。 |
cid | string | Google 定义的商家客户 ID,可用于获取商家评论。 |
feature_id | string | 结果项在搜索结果页中的唯一标识。 |
address | string | 商家完整地址。 |
phone | string | 商家联系电话。 |
url | string | 商家官方网站绝对 URL。 |
contact_url | string | 首选联系页面 URL。 |
contributor_url | string | 用户或商家实体的 Local Guides 资料页 URL(如有)。 |
book_online_url | string | “在线预订”按钮对应的 URL,用于预约或下单。 |
domain | string | 商家域名。 |
logo | string | 商家资料中的 Logo URL。 |
main_image | string | 商家资料中的主图 URL。 |
total_photos | integer | 商家资料中的图片总数。 |
snippet | string | 商家的补信息。 |
latitude | float | Google 地图中的纬度,例如 51.584091。 |
longitude | float | Google 地图中的经度,例如 -0.3136592。 |
is_claimed | boolean | 商家是否已由所有在 Google 地图中完成验证。 |
local_justifications | array | 用于说明商家为何出现在某搜索查询中的本地结果文本片段。 |
is_directory_item | boolean | 商家是否属于同一地址下的商家目录,例如商场或商务中心。目录父级项目的值可能为 null。 |
price_level | string | 价格等级,可选值为 inexpensive、moderate、expensive、very_expensive;无数据时为 null。 |
hotel_rating | integer | 店星级,范围为 1 至 5;无数据时为 null。 |
services | array | 商家提供的服务列表。 |
address_info | object | 商家地址组成信息。 |
attributes | object | 基于用户反馈和商家类别整理的服务属性。 |
place_topics | object | 顾客评论中提及频率较高的产品或服务及出现次数。 |
rating | object | 商家评分信息。 |
rating_distribution | object | 1 至 5 星评分的数量分布。 |
people_also_search | array | 用户还搜索的商家。 |
work_time | object | 商家营业时间信息。 |
local_business_links | array | 可直接与商家互动的链接,例如预订、点单或查看菜单。 |
delivery_services | array | 商家可用的服务。 |
directory | array | 与目标商家位于同一地址的目录商家。 |
address_info 地址字段
| 字段 | 类型 | 说明 |
|---|---|---|
borough | string | 商家所在的行政区或地区。 |
address | string | 街道地址。 |
city | string | 城市名称。 |
zip | string | 邮政编码。 |
region | string | 商家所在区域。 |
country_code | string | ISO 国家或地区代码。 |
place_id | string | 本地商家的唯一地点 ID。 |
attributes 服务属性
| 字段 | 类型 | 说明 |
|---|---|---|
available_attributes | object | 商家可以提供的服务属性。 |
unavailable_attributes | object | 商家无法提供的服务属性。 |
place_topics 评论主题
该对象以评论中出现的为键,以提及该的评论数量为值。例如:
json
{
"egg roll": 48,
"birthday": 33
}rating 评分字段
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分类型,可为 Max5、Percents 或 CustomMax。 |
value | integer | 当前评分值。 |
votes_count | integer | 反馈或评价数量。 |
rating_max | integer | 当前评分类型对应的最大值。 |
rating_distribution 评分分布
| 字段 | 类型 | 说明 |
|---|---|---|
1 | integer | 一星评价数量。 |
2 | integer | 二星评价数量。 |
3 | integer | 三星评价数量。 |
4 | integer | 四星评价数量。 |
5 | integer | 五星评价数量。 |
营业时间字段
work_time
| 字段 | 类型 | 说明 |
|---|---|---|
work_hours | object | 商家营业时间。 |
popular_times | object | 商家繁忙时段。 |
work_hours
| 字段 | 类型 | 说明 |
|---|---|---|
timetable | object | 按星期划分的营业时间表。 |
current_status | string | 当前营业状态,可选值为 opened、closed、temporarily_closed、closed_forever。 |
timetable
以下字段均为数组,表示对应日期的营业时段:
sunday:星期日monday:星期一tuesday:星期二wednesday:星期三thursday:星期四friday:星期五saturday:星期
每个日期数组中的时段对象:
| 字段 | 类型 | 说明 |
|---|---|---|
open | object | 开始营业时间。 |
close | object | 结束营业时间。 |
open.hour | integer | 24 小时制的小时。 |
open.minute | integer | 分钟。 |
close.hour | integer | 24 小时制的小时。 |
close.minute | integer | 分钟。 |
popular_times
| 字段 | 类型 | 说明 |
|---|---|---|
popular_times_by_days | object | 按星期划分的繁忙时段。 |
popular_times_by_days 可 sunday 至 saturday 字段。每个时段对象:
| 字段 | 类型 | 说明 |
|---|---|---|
time | object | 繁忙时间点。 |
time.hour | integer | 24 小时制的小时。 |
time.minute | integer | 分钟。 |
popular_index | integer | 繁忙指数,范围为 0 至 100,数值越高表示该时段越繁忙。 |
本地商家链接
local_business_links
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 链接类型,例如 reservation 或 order。 |
title | string | 链接标题。 |
url | string | 预订、下单或交互链接。 |
delivery_services
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 送服务类型,通常为 delivery_services_element。 |
title | string | 在线点餐系统的名称或域名。 |
url | string | 送或点餐 URL。 |
商家还可能返回以下类型的链接:
type: menu:在线菜单链接。title:在线菜单系统名称或域名。url:查看菜单的 URL。
目录商家字段
当 is_directory_item 为 true 时,商家属于同一地址下的目录。若当前商家是目录父级项目,该字段可能为 null。
directory
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 目录标题,可能为 At this place 或 Directory。 |
items | array | 目录中的商家列表。 |
directory.items
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 目录结果类型,通常为 maps_search。 |
rank_group | integer | 相同类型结果组中的排名。 |
rank_absolute | integer | 所有结果中的绝对排名。 |
domain | string | 商家域名。 |
title | string | 商家名称。 |
url | string | 商家网站绝对 URL。 |
rating | object | 商家评分,字段结构与主结果中的 rating 相同。 |
rating_distribution | object | 1 至 5 星评分数量分布。 |
snippet | string | 商家补信息。 |
address | string | 商家地址。 |
address_info | object | 地址组成信息,字段结构与主结果中的 address_info 相同。 |
place_id | string | 商家地点 ID。 |
phone | string | 商家电话。 |
main_image | string | 商家主图 URL。 |
total_photos | integer | 商家图片总数。 |
category | string | 商家类别。 |
additional_categories | array | 商家类别。 |
category_ids | array | 通用类别 ID。 |
work_hours | object | 商家营业时间。 |
feature_id | string | 结果项唯一标识。 |
cid | string | Google 定义的商家客户 ID。 |
latitude | float | 商家纬度。 |
longitude | float | 商家经度。 |
is_claimed | boolean | 商家是否已完成所有验证。 |
local_justifications | array | 本地结果说明文本。 |
is_directory_item | boolean | 商家是否属于目录。 |
price_level | string | 价格等级,可为 inexpensive、moderate、expensive、very_expensive,无数据时为 null。 |
hotel_rating | integer | 店星级,范围为 1 至 5,无数据时为 null。 |
people_also_search
该数组用户还搜索的商家。
| 字段 | 类型 | 说明 |
|---|---|---|
cid | string | 商家的唯一客户 ID。 |
feature_id | string | 结果项的唯一标识。 |
title | string | 商家名称。 |
rating | object | 商家评分,字段结构与主结果中的 rating 相同。 |
services 服务项目
| 字段 | 类型 | 说明 |
|---|---|---|
category | string | 服务类别,例如 Internet Marketing Service。 |
title | string | 服务名称。 |
snippet | string | 商家提供的服务描述。 |
price | object | 服务价格信息。 |
services[].price
| 字段 | 类型 | 说明 |
|---|---|---|
current | float | 当前价格。 |
regular | float | 未折扣的常规价格。 |
max_value | float | 未折扣价格区间的最大值。 |
currency | string | ISO 货币代码。 |
is_price_range | boolean | 是否为价格区间。 |
displayed_price | string | Google 商家资料中展示的原始价格文本。 |
响应示例
json
{
"version": "0.1.20230705",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0776 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "09171517-0696-0242-0000-a96bc1ad0bce",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0642 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"business_data",
"google",
"my_business_info",
"task_get"
],
"data": {
"se_type": "business_info",
"se": "google",
"api": "business_data",
"function": "my_business_info",
"language_code": "en",
"location_name": "Toronto,Ontario,Canada",
"keyword": "cid:7116580480031320180",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "cid:7116580480031320180",
"se_domain": "google.ca",
"location_code": 1001587,
"language_code": "en",
"check_url": "https://www.google.ca/search?q=...",
"datetime": "2019-11-15 12:57:46 +00:00",
"item_types": [
"google_business_info"
],
"items_count": 1,
"items": [
{
"type": "google_business_info",
"rank_group": 1,
"rank_absolute": 1,
"position": "left",
"title": "示例商家",
"original_title": "Example Business",
"description": "商家描述",
"category": "Dental clinic",
"category_ids": [
"dental_clinic"
],
"additional_categories": [],
"cid": "3201917428470308758",
"feature_id": "0x882b2d67af2a8289:0x2c6f7eefcc1adf96",
"address": "100 Sheppard Ave E, North York, ON M2N 6N5",
"address_info": {
"borough": null,
"address": "100 Sheppard Ave E",
"city": "North York",
"zip": "M2N 6N5",
"region": "Ontario",
"country_code": "CA",
"place_id": null
},
"phone": "+1 000-000-0000",
"url": "https://example.com",
"contact_url": null,
"contributor_url": null,
"book_online_url": null,
"domain": "example.com",
"logo": null,
"main_image": "https://example.com/image.jpg",
"total_photos": 12,
"snippet": null,
"latitude": 43.7632353,
"longitude": -79.4057069,
"is_claimed": true,
"rating": {
"rating_type": "Max5",
"value": 4.8,
"votes_count": 120,
"rating_max": 5
},
"rating_distribution": {
"1": 2,
"2": 1,
"3": 5,
"4": 20,
"5": 92
},
"work_time": {
"work_hours": {
"timetable": {
"sunday": null,
"monday": [
{
"open": {
"hour": 9,
"minute": 0
},
"close": {
"hour": 17,
"minute": 0
}
}
],
"tuesday": null,
"wednesday": null,
"thursday": null,
"friday": null,
"saturday": null
},
"current_status": "opened"
},
"popular_times": {
"popular_times_by_days": {
"monday": [
{
"time": {
"hour": 12,
"minute": 0
},
"popular_index": 76
}
]
}
}
},
"people_also_search": [],
"local_business_links": [],
"delivery_services": [],
"directory": [],
"services": []
}
]
}
]
}
]
}状态码与异常处理
- 顶层
status_code用于判断本次 API 请求是否成功。 - 任务对象中的
status_code用于判断任务是否成功。 - 建议同时检查:
status_codestatus_messagetasks_errorresult是否为空
- 以
40000及以上的任务状态码作为异常任务进行处理,并记录对应的status_message。 - 完整状态码和错误信息请参考本平台错误码文档。
实用场景
- 批量核验本地商家资料:获取商家名称、地址、电话、网站和验证状态,发现 Google 商家资料中的过期或错误信息。
- 分析本地搜索竞争对手:比较同一地址或同一搜索结果中的商家类别、评分、评论数量和排名,支持本地 SEO 竞争分析。
- 评估商家口碑与服务重点:结合
rating_distribution、place_topics和services,识别用户评价集中反映的服务优势与问题。 - 优化本地转化:提取预约、点单、和菜单链接,评估商家在本地搜索结果中的转化路径完整度。
- 规划本地运营时段:使用营业时间、当前状态和热门时段数据,安排门店推广、客服响应和本地广告投放时间。