Skip to content

Google 评论支持地区列表

接口概述

该接口用于获取 Google 评论数据支持的地区列表。

你可以通过以下方式调用:

  • 获取支持地区: GET /v3/reviews/google/locations
  • 按国家筛选地区: GET /v3/reviews/google/locations/$country

当你在后续评论任务中需要设置地区参数时,可通过本接口查询可用地区列表。

计费说明

本接口不收费。

参考价约 ¥0.0000 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求地址

text
GET https://api.seermartech.cn/v3/reviews/google/locations
GET https://api.seermartech.cn/v3/reviews/google/locations/{country}

路径参数

参数名类型说明
countrystring国家 ISO 代码。传后返回该国家下的支持地区。例如:us

返回结果说明

接口返回 JSON 数据,顶层 tasks 数组,每个任务对象结果。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码,完整列表参考 /v3/appendix/errors
status_messagestring通用状态信息,完整列表参考 /v3/appendix/errors
timestring执行耗时,单位秒
costfloat本次请求总费用,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务结果数组

tasks 对象字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000,完整列表参考 /v3/appendix/errors
status_messagestring任务状态说明
timestring任务执行耗时,单位秒
costfloat该任务费用,单位 USD
result_countintegerresult 数组中的数量
patharray请求 URL 路径
dataarrayGET 请求 URL 中传的参数
resultarray返回的地区列表

result 数组字段

字段名类型说明
location_codeinteger地区编码
location_namestring地区名
location_code_parentinteger上级地区编码
country_iso_codestring地区所属国家的 ISO 代码
location_typestring地区类型

地区层级说明

location_code_parent 表示当前地区的上级行政或地理节点。例如:

json
{
 "location_code": 9041134,
 "location_name": "Vienna International Airport,Lower Austria,Austria",
 "location_code_parent": 20044
}

说明:

json
{
 "location_code": 20044,
 "location_name": "Lower Austria,Austria"
}

表示 9041134 对应的上级地区是 Lower Austria,Austria

认证方式

请在请求头中使用 Bearer Token:

http
Authorization: Bearer smt_live_YOUR_KEY

请求示例

cURL

bash
curl --location --request GET "https://api.seermartech.cn/v3/reviews/google/locations" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"

按国家筛选示例:

bash
curl --location --request GET "https://api.seermartech.cn/v3/reviews/google/locations/us" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"

Python

python
import requests

url = "https://api.seermartech.cn/v3/reviews/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/reviews/google/locations",
 headers: {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
 }
})
 .then((response) => {
 // 返回结果
 console.log(response.data);
 })
 .catch((error) => {
 console.log(error);
 });

响应示例

json
{
 "version": "0.1.20200325",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.4416 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "reviews",
 "function": "locations",
 "se": "google"
 },
 "result": []
 }
 ]
}

状态码说明

你可以通过以下字段判断请求是否成功:

  • 顶层 status_code
  • tasks[].status_code

常见判断方式:

  • 20000:请求成功
  • 状态码:表示请求或任务处理异常

完整错误码与状态信息请参考 /v3/appendix/errors

使用建议

  • 在创建 Google 评论采集任务前,调用本接口确认目标地区是否受支持。
  • 如果业务只特定国家,建议通过 /{country} 方式缩小返回范围,减少本地筛选成本。
  • location_code 持化到本地或数据库中,可直接用于后续任务构建。
  • 若需要维护地区树结构,可结合 location_code_parent 构建父子层级。

实用场景

  • 校验投放地区:在创建 Google 评论采集任务前验证地区是否受支持,减少因地区参数错误导致的任务失败。
  • 构建地区选择器:将返回的 location_namelocation_code 和父级生成前端下拉或级联选择组件,提升运营效率。
  • 维护地区映射表:把平台城市、机场、州省与本接口返回的标准 location_code 对齐,便于批量任务自动化处理。
  • 按国家批量初始化:按 country 拉取目标国家地区,再批量建立本地索引,为评论监控系统做准备。
  • 建立地理层级分析:利用 location_code_parent 组地区树,用于后续按国家、省州、城市等维度汇总评论数据。

统一入口:官网 · LLM API · 控制台