Skip to content

ChatGPT LLM 抓取器支持地区列表

本接口用于获取 ChatGPT LLM 抓取器支持的地理位置列表。支持以下 GET 请求路径:

  • GET /v3/ai_optimization/wp/v2/locations
  • GET /v3/ai_optimization/wp/v2/locations/$country

$country 为国家 ISO 代码,例如 us。该接口当前不收费。

> 俄罗斯和白俄罗斯的所有地区均不受支持。

请求地址

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

按国家筛选地区:

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

路径参数

参数类型说明
countrystring国家 ISO 代码。用于筛选指定国家的地区列表,例如 us

请求示例

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"
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/us"

response = requests.get(
    url,
    headers={
        "Authorization": "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
    },
    timeout=30,
)

response.raise_for_status()
result = response.json()

if result["status_code"] == 20000:
    # 读取地区列表
    locations = result["tasks"][0]["result"]
    print(locations)
else:
    print(
        f"请求失败:{result['status_code']} - "
        f"{result['status_message']}"
    )

TypeScript

typescript
import axios from "axios";

// 可将 /us 替换为国家 ISO 代码,或移除以获取地区
const url =
  "https://api.seermartech.cn/v3/ai_optimization/wp/v2/locations/us";

async function getLocations() {
  const response = await axios.get(url, {
    headers: {
      Authorization: "Bearer smt_live_YOUR_KEY",
      "Content-Type": "application/json",
    },
  });

  const result = response.data;

  if (result.status_code === 20000) {
    // 地区列表位于第一个任务的 result 数组中
    console.log(result.tasks[0].result);
  } else {
    console.error(
      `请求失败:${result.status_code} - ${result.status_message}`,
    );
  }
}

getLocations().catch(console.error);

响应说明

接口返回 JSON 数据,顶层 tasks 数组。每个任务对象中请求状态、请求参数及地区列表。

顶层字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger整体请求状态码。20000 表示请求成功。
status_messagestring整体请求状态说明。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorinteger返回错误的任务数量。
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地区唯一代码,用于后续创建 LLM 抓取任务。
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
}

对应的上级地区:

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

响应示例

json
{
  "version": "0.1.20260806",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0751 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12345678-1234-1234-1234-123456789012",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0751 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "wp",
        "v2",
        "locations",
        "us"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "locations",
        "se": "chat_gpt",
        "se_type": "llm_scraper",
        "country": "us"
      },
      "result": [
        {
          "location_code": 2840,
          "location_name": "United States",
          "location_code_parent": null,
          "country_iso_code": "US",
          "location_type": "Country"
        }
      ]
    }
  ]
}

错误处理

请同时检查顶层 status_code 与各任务对象中的 status_code

  • 20000:请求成功。
  • 20000:请求或任务执行失败,应根据 status_message 定位问题。
  • tasks_error 大于 0:表示部分或任务返回错误。

常见检查项:

  • 确认请求路径中的国家代码为有效 ISO 代码,例如 usgbde
  • 确认认证头使用有效的 SeerMarTech API Key。
  • 创建后续 LLM 抓取任务时,使用响应中的 location_code,而非自行拼接地区名称。
  • 确认目标地区属于当前支持范围。

实用场景

  • 筛选目标国家的可用地区:在创建 LLM 搜索可见性任务前拉取指定国家的地区代码,因地区不支持导致任务失败。
  • 构建本地化品牌监测任务:按城市、州省或国家选择 location_code,比较品牌在不同市场的 LLM 回答。
  • 批量生成多地区研究:同步支持地区列表后,为多个国家或城市自动创建统一的与竞品监控任务。
  • 校验用户提交的地域条件:在 SaaS 表单或运营中验证地区代码,减少无效地域和人工排查成本。
  • 维护地区层级映射数据:利用 location_code_parent 建立国家、行政区、城市等层级,支持区域维度的 SEO 数据汇总与报表分析。

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