Skip to content

Google 商业数据 API 地点列表

GET /v3/business_data/google/locations

本接口提供 Google 商业数据 API 支持的地点列表。

  • GET /v3/business_data/google/locations
  • GET /v3/business_data/google/locations/$country

可通过国家/地区 ISO 代码筛选地点列表。当前俄罗斯和白俄罗斯的地点不再受支持。

计费说明

调用本接口目前不产生费用。

请求参数

路径参数

参数类型说明
countrystring国家/地区 ISO 代码。填写后返回指定国家/地区的地点。例如:usgb

请求示例

获取支持的地点:

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 数组请求结果。

顶层字段

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

tasks 数组字段

字段类型说明
idstring任务唯一标识符,UUID 格式。
status_codeinteger任务状态码,通常在 1000060000 范围。
status_messagestring任务状态说明信息。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的数量。
patharray请求 URL 路径。
dataobjectGET 请求中传的路径参数和接口信息。
resultarray地点列表结果。

data 字段

字段类型说明
apistringAPI 模块名称,值为 business_data
functionstring接口名称,值为 locations
sestring搜索引擎或数据来源,值为 google
countrystring请求中指定的国家/地区 ISO 代码;未筛选时可能不返回。

result 地点字段

字段类型说明
location_codeinteger地点代码。
location_namestring地点完整名称。
location_name_parentstring上级地点名称。
country_iso_codestring地点所属国家/地区的 ISO 代码。
location_typestring地点类型。

地点字段示例:

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_parentlocation_type 建立国家、地区、城市等层级,支持本地 SEO 数据分组与报表分析。

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