Skip to content

Google 评论位置列表 ​

接口说明 ​

本接口用于获取 Google 评论支持的位置列表。支持获取位置,也可以按国家/地区筛选。

请求方法与路径:

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

,{country} 为国家/地区的 ISO 代码,例如 us。

当前使用本接口不收费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数 ​

路径参数 ​

参数类型填说明
countrystring否国家/地区 ISO 代码。填写后返回指定国家/地区的位置列表,例如 us。

请求示例 ​

获取位置:

http
GET /v3/reviews/google/locations

获取美国的位置:

http
GET /v3/reviews/google/locations/us

响应说明 ​

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段 ​

字段类型说明
versionstring当前 API 版本。
status_codeinteger请求级状态码。20000 表示成功。完整状态码请参考错误码文档。
status_messagestring请求级状态信息。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

tasks 子字段 ​

字段类型说明
idstring任务唯一标识,采用 UUID 格式。
status_codeinteger任务状态码,成功时通常为 20000。
status_messagestring任务状态信息。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray本次请求对应的 URL 路径信息。
dataarray请求中传的参数信息。
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
}

,20044 对应的上级位置可能为:

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

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

api_url = "https://api.seermartech.cn/v3/reviews/google/locations"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

response = requests.get(api_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"))
    )

按国家/地区筛选:

python
import requests

country = "us"
api_url = f"https://api.seermartech.cn/v3/reviews/google/locations/{country}"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

response = requests.get(api_url, headers=headers)
result = response.json()

if result.get("status_code") == 20000:
    locations = result["tasks"][0].get("result", [])
    for location in locations:
        print(location)
else:
    print(result)

TypeScript 示例 ​

typescript
import axios from "axios";

async function getGoogleReviewLocations(country?: string) {
  const path = country
    ? `/v3/reviews/google/locations/${country}`
    : "/v3/reviews/google/locations";

  const response = await axios.get(
    `https://api.seermartech.cn${path}`,
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  );

  const result = response.data;

  if (result.status_code === 20000) {
    return result;
  }

  throw new Error(
    `请求失败。状态码:${result.status_code},信息:${result.status_message}`
  );
}

getGoogleReviewLocations("us")
  .then((result) => {
    console.log(result);
  })
  .catch((error) => {
    console.error(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": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.1234 sec.",
      "cost": 0,
      "result_count": 2,
      "path": [
        "v3",
        "reviews",
        "google",
        "locations"
      ],
      "data": {
        "api": "reviews",
        "function": "locations",
        "se": "google"
      },
      "result": [
        {
          "location_code": 20044,
          "location_name": "Lower Austria,Austria",
          "location_code_parent": 20000,
          "country_iso_code": "AT",
          "location_type": "province"
        },
        {
          "location_code": 9041134,
          "location_name": "Vienna International Airport,Lower Austria,Austria",
          "location_code_parent": 20044,
          "country_iso_code": "AT",
          "location_type": "airport"
        }
      ]
    }
  ]
}

实用场景 ​

  • 构建国家/地区筛选器:获取可用的位置代码,为 Google 评论采集、排名监控或门店分析提供标准化地域选项。
  • 匹位置层级:利用 location_code_parent 建立国家、省州、城市及地点的层级结构,支持区域汇总与下钻分析。
  • 校验用户的位置:根据 location_code 和 country_iso_code 校验业务系统中的国家、地区或地点参数,减少无效请求。
  • 生成本地 SEO置:将位置名称和代码写项目,批量创建不同地区的 Google 评论监控任务。
  • 维护地域数据字:定期同步位置列表,为门店管理、区域报表和多地区 SEO 项目提供统一的位置主数据。

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