Skip to content

Tripadvisor 地点列表接口

接口说明

该接口用于获取 Tripadvisor Business Data API 支持的地点列表。

支持两种调用方式:

  • 获取地点: GET /v3/business_data/tripadvisor/locations
  • 按国家筛选地点: GET /v3/business_data/tripadvisor/locations/$country

$country 为国家 ISO 代码,例如 usgb

注意:

  • 目前支持 CityRegion 两种地点类型。
  • 俄罗斯和白俄罗斯的地点在本平台服务中均不再支持。
  • 该接口本身不收费,扣费以响应头 X-SeerMarTech-Charge-CNY 为准;通常为 0

如需完整地点单,可下载平台提供的 CSV 地点列表文件;更新时间以对应资源为准。

请求信息

请求地址

text
GET https://api.seermartech.cn/v3/business_data/tripadvisor/locations
GET https://api.seermartech.cn/v3/business_data/tripadvisor/locations/$country

认证方式

请在请求头中使用 Bearer Token:

http
Authorization: Bearer smt_live_YOUR_KEY

路径参数

参数名类型说明
countrystring国家 ISO 代码。传后返回该国家下的地点列表,例如 us

返回结果

接口返回 JSON 结构,顶层任务执行信息及结果数组。

顶层字段

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

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000
status_messagestring任务状态说明
timestring任务执行耗时,单位秒
costfloat单任务费用,单位 USD
result_countintegerresult 数组中的数量
patharrayURL 路径
dataobjectGET 请求 URL 中传的参数
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"
}

含义如下:

  • location_code:地点唯一编码
  • location_name:完整地点名称,通常当前地点及上级区域
  • location_name_parent:当前地点的上级区域名称

状态码说明

  • 20000:请求成功
  • 状态码请参考 /v3/appendix/errors

通用错误信息与任务级错误信息也可通过 /v3/appendix/errors 查询。

请求示例

curl

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"

按国家筛选:

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"

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(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/business_data/tripadvisor/locations",
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json",
 },
})
 .then(function (response) {
 // 返回结果
 console.log(response.data);
 })
 .catch(function (error) {
 console.error(error);
 });

// 按国家筛选地点
axios({
 method: "get",
 url: "https://api.seermartech.cn/v3/business_data/tripadvisor/locations/gb",
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json",
 },
})
 .then(function (response) {
 console.log(response.data);
 })
 .catch(function (error) {
 console.error(error);
 });

响应示例

json
{
 "version": "0.1.20220216",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.2176 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "business_data",
 "function": "locations",
 "se": "tripadvisor"
 },
 "result": []
 }
 ]
}

使用说明

在创建 Tripadvisor 任务前,建议调用本接口获取可用地点列表,并使用返回的 location_code 或对应地点信息进行筛选。

由于该接口返回 Tripadvisor Business Data 支持的地点,使用本接口可传无效地点参数,提高任务创建成功率。

实用场景

  • 校验投放地点参数:在创建 Tripadvisor 商业数据任务前,验证国家、城市或区域是否受支持,减少因地点无效导致的任务失败。
  • 构建地点选择器:为后台系统或客户前端生成国家/城市/区域下拉选项,提升地点效率与准确性。
  • 规范地点映射:将外部业务系统中的城市名称映射为平台标准 location_code,便于后续任务批量化处理。
  • 筛选国家级可用市场:按国家拉取地点列表,快速确认特定市场下支持的城市与区域范围,为本地化 SEO 或商户分析做准备。
  • 维护地点主数据:定期同步支持地点列表,更新地点库,确保分析、报表与任务使用统一地点标准。

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