Skip to content

Tripadvisor 商业数据位置列表

GET /v3/business_data/tripadvisor/locations

本接口用于获取 Tripadvisor 商业数据支持的位置列表。支持按国家/地区 ISO 代码筛选位置。当前支持 City(城市)和 Region(地区)两种位置类型。

接口方法与路径:

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

本接口不收取调用费用,参考价为 ¥0 / 次。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

> 由于服务政策限制,俄罗斯和白俄罗斯境的位置当前不受支持。

请求参数

路径参数

参数类型说明
countrystring用于按国家/地区筛选位置的 ISO 代码。示例:usgb

不填写 country 时,接口返回支持的位置;填写后,例如访问 /v3/business_data/tripadvisor/locations/gb,则返回英国的位置。

响应字段

接口返回 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位置结果数组。

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": "region"
}

请求示例

cURL

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

获取位置时:

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

Python

python
import requests

url = "https://api.seermartech.cn/v3/business_data/tripadvisor/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/tripadvisor/locations/gb",
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    const result = response.data;
    // 在此处理位置列表
    console.log(result);
  })
  .catch((error) => {
    console.error("请求失败:", error.response?.data || error.message);
  });

PHP

php
<?php

$url = 'https://api.seermartech.cn/v3/business_data/tripadvisor/locations/gb';

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer smt_live_YOUR_KEY',
        'Content-Type: application/json',
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$result = json_decode($response, true);

if (($result['status_code'] ?? null) === 20000) {
    print_r($result);
    // 在此处理位置列表
} else {
    echo "请求失败,HTTP 状态码:{$httpCode}\n";
    echo "业务状态码:" . ($result['status_code'] ?? '未知') . "\n";
    echo "错误信息:" . ($result['status_message'] ?? '未知') . "\n";
}

响应示例

json
{
  "version": "0.1.20220216",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.2176 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.2176 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "business_data",
        "tripadvisor",
        "locations",
        "gb"
      ],
      "data": {
        "api": "business_data",
        "function": "locations",
        "se": "tripadvisor",
        "country": "gb"
      },
      "result": [
        {
          "location_code": 9041134,
          "location_name": "London,England,United Kingdom",
          "location_name_parent": "England,United Kingdom",
          "country_iso_code": "gb",
          "location_type": "city"
        }
      ]
    }
  ]
}

状态码

  • 顶层 status_code 表示整体请求状态。
  • tasks[].status_code 表示任务状态。
  • 当状态码为 20000 时,表示请求成功。
  • 状态码表示请求或任务处理异常,应结合对应的 status_message 排查。

实用场景

  • 筛选目标国家的位置编码:按国家 ISO 代码获取城市和地区列表,为本地 SEO、门店排名及区域竞品分析准备标准化位置参数。
  • 构建位置选择器:将接口返回的位置名称、上级位置和编码接后台系统,帮助运营人员准确选择目标市场。
  • 统一地理维度:使用 location_codecountry_iso_code 建立跨项目的位置主数据,减少不同报表中的地名歧义。
  • 生成区域分析范围:按城市或地区批量整理业务覆盖范围,为本地搜索可见度和行业市场分析提供数据基础。

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