主题
Gemini LLM Scraper 地区列表
GET /v3/ai_optimization/gemini/llm_scraper/locations
接口说明
通过本接口可获取 Gemini LLM Scraper 支持的地区列表。创建任务时,可基于国家筛选可用地区。
- 请求方式:
GET - 请求地址:
https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations - 计费:,不扣费
注意:俄罗斯和白俄罗斯的所有地区目前在平台 API 的服务中均不再支持。
接口返回为 JSON 数据,顶层 tasks 数组,每个任务中请求信息与结果列表。
请求参数
该接口为 GET 请求,无请求体。
返回字段
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 接口通用状态码;完整错误码可参考 /v3/appendix/errors |
status_message | string | 接口通用状态信息;完整说明可参考 /v3/appendix/errors |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用,单位 USD;该接口通常为 0 |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中执行报错的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000;完整错误码可参考 /v3/appendix/errors |
status_message | string | 任务状态信息 |
time | string | 任务执行耗时,单位秒 |
cost | float | 当前任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | URL 路径 |
data | object | GET 请求 URL 中传递的参数信息 |
result | array | 地区列表结果 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
location_code | integer | 地区编码 |
location_name | string | 地区完整名称 |
location_code_parent | integer | 上级地区编码 |
country_iso_code | string | 地区所属国家的 ISO 国家代码 |
location_type | string | 地区类型 |
地区层级说明
location_code_parent 表示当前地区的上级行政或地理层级。例如:
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"
}请求示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
async function getLocations {
const response = await axios.get(
"https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations",
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
// 输出返回结果
console.log(response.data);
}
getLocations.catch(console.error);响应示例
json
{
"version": "0.1.20260223",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0690 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "ai_optimization",
"function": "locations",
"se": "gemini",
"se_type": "llm_scraper"
},
"result": []
}
]
}状态码说明
| 状态码 | 说明 |
|---|---|
20000 | 请求成功 |
10000-60000 | 任务级状态码范围,含义请参考 /v3/appendix/errors |
使用建议
- 在提交地区任务前,调用本接口获取最新可用地区列表。
- 若业务需要按国家过滤地区,可基于
country_iso_code做本地筛选。 - 若需要构建地区树或级联选择器,可使用
location_code_parent还原层级。 - 实可用地区会随平台能力更新,建议定期同步缓存。
实用场景
- 同步地区字:定期拉取可用地区列表,维护本地标准地区库,提交无效地区参数。
- 构建地区选择器:基于
location_name与location_code_parent生成前端级联地区选择组件,提升任务效率。 - 按国家过滤投放范围:结合
country_iso_code保留目标国家地区,便于 SEO 或多市场分析。 - 校验任务参数:在创建 LLM 抓取任务前校验
location_code是否有效,减少请求失败和重试成本。 - 建立地区层级映射:利用父级编码还原机场、州、省、城市等上下级,支持更细粒度的区域分析。