主题
数据 Google 地区列表
接口说明
该接口用于获取数据可用的 Google 地区列表,对应路径为:
GET /v3/keywords_data/google/locations
这是一个只读接口,不会产生费用。参考价约 ¥0.0000 / 次,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
重要说明
1)旧版接口说明
Google AdWords Keywords Data API 属于旧版能力,现已由 Google Ads API 替代。 如果你仍在使用旧版数据能力,建议迁移到:
/v3/keywords_data/google_ads/migration_guide
2)地区支持限制
由于平台服务策略调整,俄罗斯和白俄罗斯的所有地区已不再支持,并且该限制适用于所有服务。
3)地区类型说明
本接口使用 Google 地理定向体系。你可以通过本接口获取适用于数据查询的地区,并按 location_type 判断类型。
支持的地区类型:
- Autonomous Community
- Canton
- City
- Congressional District
- Country
- County
- Department
- Governorate
- Municipality
- Prefecture
- Province
- Region
- State
- Territory
- Union Territory
如需完整地区列表,也可下载平台提供的 CSV 数据文件(最后更新于 2026-04-06)。
请求信息
请求地址
text
GET https://api.seermartech.cn/v3/keywords_data/google/locations请求头
http
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 |
tasks_count | integer | tasks 数组中的任务数 |
tasks_error | integer | 返回错误的任务数 |
tasks | array | 任务数组 |
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,通常在 10000-60000 范围 |
status_message | string | 任务状态信息 |
time | string | 任务执行时间,单位秒 |
cost | float | 任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | GET 请求 URL 中传的参数 |
result | array | 结果数组 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
location_code | integer | 地区编码 |
location_name | string | 地区完整名称 |
location_code_parent | integer | 上级地区编码 |
country_iso_code | string | 地区所属国家的 ISO 代码 |
location_type | string | 地区类型 |
location_code_parent 示例
例如:
当前地区:
location_code:9041134location_name:Vienna International Airport,Lower Austria,Austrialocation_code_parent:20044对应上级地区:
location_code:20044location_name:Lower Austria,Austria
这表示“Vienna International Airport”隶属于“Lower Austria, Austria”。
location_type 可选值
location_type 的取值遵循 Google 地理定向类型体系,例如:
- Country
- Region
- State
- Province
- City
- County
- Municipality
以及 Google 支持的地理定向类型。
请求示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/keywords_data/google/locations" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/google/locations"
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/keywords_data/google/locations",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}).then(function (response) {
const result = response.data;
// 处理返回结果
console.log(result);
}).catch(function (error) {
console.log(error);
});响应示例
json
{
"version": "3.20191128",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.4305 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "keywords_data",
"function": "locations",
"se": "google"
},
"result": []
}
]
}状态码说明
20000:请求成功- 状态码:表示请求或任务处理异常
完整错误码与状态信息请参考:
/v3/appendix/errors
使用建议
- 在发起数据查询前,调用本接口获取最新可用地区列表。
- 使用
location_code作为后续数据任务的地区参数,可减少因地区无效导致的请求失败。 - 如果你的业务需要按国家、省州、城市分层处理,可结合
location_code_parent构建地区树结构。 - 若需要长期缓存地区数据,建议定期同步 CSV量列表,并以接口返回结果为准进行增量校验。
实用场景
- 校验投放地区参数:在创建搜索量、竞价或趋势任务前,验证
location_code是否有效,降低任务失败率。 - 构建地区级联选择器:基于
location_code_parent生成国家、省州、城市三级联动,提升 SEO 工后台的可用性。 - 筛选特定地区类型:按
location_type提取国家、州、省、城市等节点,便于批量生成本地化研究任务。 - 维护地区主数据字:定期同步支持地区列表,为报表系统、任务系统和数据仓库提供统一地区维表。
- 定位本地 SEO 机会:结合城市或行政区地区编码批量查询数据,发现不同区域的搜索需求差异。