主题
Google Business 数据支持地区列表
接口说明
该接口用于获取 Google Business 数据支持的地区列表。
你可以:
- 获取支持地区;
- 按国家筛选地区列表,用于后续创建任务时选择可用地区。
注意:俄罗斯和白俄罗斯地区已不再受支持。
计费说明
调用本接口不收费。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准;该接口通常返回 0。
请求方式
获取地区
GET /v3/business_data/google/locations
按国家筛选地区
GET /v3/business_data/google/locations/$country
路径参数
| 字段 | 类型 | 说明 |
|---|---|---|
country | string | 可选。国家 ISO 代码,用于按国家筛选支持地区。示例:us |
返回结构
接口返回 JSON 数据,顶层 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码,完整列表见参考文档 /v3/appendix/errors |
status_message | string | 通用状态信息,完整列表见参考文档 /v3/appendix/errors |
time | string | 执行时间,单位秒 |
cost | float | 本次请求总费用,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000,完整列表见参考文档 /v3/appendix/errors |
status_message | string | 任务状态信息 |
time | string | 任务执行时间,单位秒 |
cost | float | 当前任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | GET 请求 URL 中传的参数 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
location_code | integer | 地区编码 |
location_name | string | 地区完整名称 |
location_name_parent | string | 上级地区名称,例如:Lower Austria,Austria |
country_iso_code | string | 地区所属国家的 ISO 代码 |
location_type | string | 地区类型 |
示例:
json
{
"location_code": 9041134,
"location_name": "Vienna International Airport,Lower Austria,Austria",
"location_name_parent": "Lower Austria,Austria"
}可下载地区单
如需完整支持地区列表,也可以使用 CSV 文件方式获取。原文档中提供了下载链接,本文不再保留外部链接,建议直接调用本接口获取最新数据。
请求示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/business_data/google/locations" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"按国家筛选示例:
bash
curl --location --request GET "https://api.seermartech.cn/v3/business_data/google/locations/gb" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/business_data/google/locations/gb"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
result = response.json
if result.get("status_code") == 20000:
print(result)
else:
print(f'error. Code: {result.get("status_code")} Message: {result.get("status_message")}')TypeScript
typescript
import axios from "axios";
axios({
method: "get",
url: "https://api.seermartech.cn/v3/business_data/google/locations",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"content-type": "application/json"
}
})
.then(function (response) {
// 返回结果
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});响应示例
json
{
"version": "0.1.20200909",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.4592 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "business_data",
"function": "locations",
"se": "google"
},
"result": []
}
]
}状态码说明
20000:请求成功- 状态码:请参考
/v3/appendix/errors
建议同时检查:
- 顶层
status_code tasks[].status_codetasks_error
使用建议
在创建 Google Business 任务前,建议调用该接口确认可用地区及对应 location_code,以提交不受支持的地区参数。
实用场景
- 校验投放地区:在创建 Google Business 采集任务前校验地区是否受支持,减少因地区参数错误导致的任务失败。
- 构建地区选择器:将返回的
location_name和location_code同步到前端下拉列表,提升运营或分析人员任务的效率。 - 按国家批量初始化地区库:按
country分批拉取地区数据,建立标准地区映射表,便于多国家本地 SEO 分析。 - 过滤失效地区:定期同步最新支持地区,自动剔除已不支持的地区,降低历史失效带来的数据异常。
- 建立地区编码映射:把
location_code与城市、机场、行政区编码,为本地商家排名分析和门店数据采集提供统一主键。