Skip to content

AI 优化 LLM 抓取器支持地域列表

本接口用于获取 AI 优化 LLM 抓取器支持的地域列表。你可以拉取地域,也可以按国家/地区 ISO 代码筛选,便于后续创建任务时正确设置地域参数。

本接口不收费,响应中的 cost 通常为 0;扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

接口地址

获取支持地域

GET https://api.seermartech.cn/v3/ai_optimization/wp/v2/locations

按国家筛选支持地域

GET https://api.seermartech.cn/v3/ai_optimization/wp/v2/locations/$country

说明:

  • wp 为对应的大语言模型类型标识
  • $country 为国家 ISO 代码,例如 us

说明:除 wp 外,还可使用受支持的大语言模型标识,以对应接口文档为准。 容路径 /v3/ai_optimization/... 需保持原样使用。

功能说明

通过本接口可以:

  • 获取当前支持的地域及编码
  • 按国家过滤地域列表
  • 查询地域层级,例如城市、州/省、国家之间的父级地域编码

如需批量查看完整地域单,也可使用平台提供的 CSV 地域列表文件。

注意:俄罗斯和白俄罗斯的所有地域当前不再受支持。

请求参数

路径参数

字段类型说明
countrystring可选。国家 ISO 代码;设置后返回该国家下的地域列表。例如:us

响应结构

接口返回 JSON 数据,顶层 tasks 数组,每个任务对象中本次请求的执行信息和结果数据。

顶层字段

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

tasks[] 字段

字段类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000
status_messagestring任务状态信息
timestring任务执行耗时,单位:秒
costfloat该任务成本,单位:USD
result_countintegerresult 数组中的数量
patharray请求 URL 路径
dataobjectGET 请求 URL 中传的参数信息
resultarray地域结果列表

result[] 字段

字段类型说明
location_codeinteger地域编码
location_namestring地域完整名称
location_code_parentinteger上级地域编码
country_iso_codestring地域所属国家 ISO 代码
location_typestring地域类型

地域层级示例

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

location_code_parent = 20044 对应的父级地域可能为:

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

认证方式

请求头统一使用 Bearer Token:

http
Authorization: Bearer smt_live_YOUR_KEY

请求示例

cURL:获取地域

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

cURL:按国家筛选地域

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

Python

python
import requests

url = "https://api.seermartech.cn/v3/ai_optimization/wp/v2/locations"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}

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

print(result)

TypeScript

typescript
import axios from "axios";

// 获取支持地域列表
axios({
 method: "get",
 url: "https://api.seermartech.cn/v3/ai_optimization/wp/v2/locations",
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
 }
})
 .then((response) => {
 // 输出结果数据
 console.log(response.data);
 })
 .catch((error) => {
 console.error(error);
 });

响应示例

json
{
 "version": "3.20191128",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.4305 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "ai_optimization",
 "function": "locations",
 "se": "wp",
 "se_type": "v2"
 },
 "result": []
 }
 ]
}

状态码说明

状态码字段说明
status_code通用或任务级状态码
status_message对应的状态描述

常见成功状态:

  • 20000:请求成功

完整错误码与状态说明请参考 /v3/appendix/errors

使用建议

  • 创建 AI 优化任务前,调用本接口确认可用地域编码
  • 如需按国家进行下钻查询,建议优使用 /locations/$country
  • 若业务依赖地域层级,可结合 location_code_parent 建立本地映射表
  • 接口路径中的模型标识(如 wp)需要与你调用的平台 API 能力保持一致

实用场景

  • 校验任务地域参数:在提交 LLM 抓取任务前查询支持地域,因地域编码无效导致任务失败。
  • 构建地域选择器:将返回的 location_namelocation_code 用于后台或前端下拉框,提升任务效率。
  • 按国家批量初始化地域库:使用国家 ISO 代码分批拉取地域,建立标准地域字,方便后续任务复用。
  • 建立地域层级映射:根据 location_code_parent 还原州、省、城市等层级结构,支持更细粒度的数据分析。
  • 过滤不可用市场:在多国家 SEO 或 AI监测流程中,判断目标市场是否受支持,减少无效请求。

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