主题
Google 商业数据 API 地点列表
GET /v3/business_data/google/locations
本接口提供 Google 商业数据 API 支持的地点列表。
- GET
/v3/business_data/google/locations - GET
/v3/business_data/google/locations/$country
可通过国家/地区 ISO 代码筛选地点列表。当前俄罗斯和白俄罗斯的地点不再受支持。
计费说明
调用本接口目前不产生费用。
请求参数
路径参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
country | string | 否 | 国家/地区 ISO 代码。填写后返回指定国家/地区的地点。例如:us、gb。 |
请求示例
获取支持的地点:
http
GET https://api.seermartech.cn/v3/business_data/google/locations
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json获取英国地点:
http
GET https://api.seermartech.cn/v3/business_data/google/locations/gb
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json响应字段
接口返回 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 | GET 请求中传的路径参数和接口信息。 |
result | array | 地点列表结果。 |
data 字段
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称,值为 business_data。 |
function | string | 接口名称,值为 locations。 |
se | string | 搜索引擎或数据来源,值为 google。 |
country | string | 请求中指定的国家/地区 ISO 代码;未筛选时可能不返回。 |
result 地点字段
| 字段 | 类型 | 说明 |
|---|---|---|
location_code | integer | 地点代码。 |
location_name | string | 地点完整名称。 |
location_name_parent | string | 上级地点名称。 |
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",
"country_iso_code": "at",
"location_type": "Airport"
}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(
"请求失败。状态码:%s,消息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript 示例
typescript
import axios from "axios";
axios
.get(
"https://api.seermartech.cn/v3/business_data/google/locations/gb",
{
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);
});PHP 示例
php
<?php
$url = 'https://api.seermartech.cn/v3/business_data/google/locations/gb';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPGET => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
echo '请求失败:' . curl_error($ch);
} else {
$result = json_decode($response, true);
if (($result['status_code'] ?? null) === 20000) {
print_r($result);
} else {
echo '请求失败。状态码:'
. ($result['status_code'] ?? '未知')
. ',消息:'
. ($result['status_message'] ?? '未知');
}
}
curl_close($ch);C# 示例
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
public static class SeerMarTechDemos
{
public static async Task GetBusinessDataLocations()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Bearer",
"smt_live_YOUR_KEY"
);
var response = await httpClient.GetAsync(
"https://api.seermartech.cn/v3/business_data/google/locations/gb"
);
var content = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
// 处理 JSON 响应
Console.WriteLine(content);
}
else
{
Console.WriteLine(
$"请求失败。HTTP 状态码:{(int)response.StatusCode},响应:{content}"
);
}
}
}响应示例
json
{
"version": "0.1.20200909",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.4592 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": " ಮೇ1f4d9e7-6a1a-4f44-9ec8-2a8c0a1b2c3d",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1234 sec.",
"cost": 0,
"result_count": 2,
"path": [
"v3",
"business_data",
"google",
"locations",
"gb"
],
"data": {
"api": "business_data",
"function": "locations",
"se": "google",
"country": "gb"
},
"result": [
{
"location_code": 1006886,
"location_name": "London,England,United Kingdom",
"location_name_parent": "England,United Kingdom",
"country_iso_code": "gb",
"location_type": "City"
},
{
"location_code": 1006887,
"location_name": "Manchester,England,United Kingdom",
"location_name_parent": "England,United Kingdom",
"country_iso_code": "gb",
"location_type": "City"
}
]
}
]
}> id 示例用于展示 UUID 格式。响应中的任务标识符会有所不同。
完整状态码和错误信息请参考错误码文档。
实用场景
- 获取指定国家/地区的地点代码,为 Google 商业数据查询任务准备合法的
location_code,因地点参数无效导致任务失败。 - 构建国家/地区地点选择器,在 SEO 平台或本地搜索中提供城市、机场等地点筛选能力,提升用户效率。
- 校验业务地点参数,在提交本地排名、商户数据或区域搜索任务前验证地点名称与国家归属,减少错误。
- 同步地点层级信息,利用
location_name_parent和location_type建立国家、地区、城市等层级,支持本地 SEO 数据分组与报表分析。