Skip to content

Gemini LLM Scraper 地点列表

GET /v3/ai_optimization/gemini/llm_scraper/locations

本接口使用 GET 方法,请求路径为:

/v3/ai_optimization/gemini/llm_scraper/locations

调用本接口可获取 Gemini LLM Scraper 支持的地点列表。创建任务时,可根据国家或地点代码筛选目标地点。

> 俄罗斯和白俄罗斯境的地点目前不支持使用。

计费说明

使用本接口不收取费用,响应中的 cost 通常为 0

扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求方式

请求

http
GET https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json

本接口无需请求体。

响应字段

接口返回 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 路径
dataobject请求 URL 中传的参数
resultarray地点列表结果

result 地点字段

字段类型说明
location_codeinteger地点代码
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
}

location_code_parent20044,对应的上级地点可能是:

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"

PHP

php
<?php

require('RestClient.php');

$api_url = 'https://api.seermartech.cn/';

try {
    $client = new RestClient($api_url, null, null, null);

    // 设置 Bearer Token
    $client->setOption('headers', [
        'Authorization: Bearer smt_live_YOUR_KEY',
        'Content-Type: application/json'
    ]);
} catch (RestClientException $e) {
    echo "\n";
    print "HTTP code: {$e->getHttpCode()}\n";
    print "Error code: {$e->getCode()}\n";
    print "Message: {$e->getMessage()}\n";
    exit();
}

try {
    // 获取 Gemini LLM Scraper 支持的地点列表
    $result = $client->get(
        '/v3/ai_optimization/gemini/llm_scraper/locations'
    );

    print_r($result);
} catch (RestClientException $e) {
    echo "\n";
    print "HTTP code: {$e->getHttpCode()}\n";
    print "Error code: {$e->getCode()}\n";
    print "Message: {$e->getMessage()}\n";
}

TypeScript

typescript
import axios from "axios";

axios({
  method: "get",
  url: "https://api.seermartech.cn/v3/ai_optimization/gemini/llm_scraper/locations",
  headers: {
    Authorization: "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
  },
})
  .then((response) => {
    // 处理响应数据
    console.log(response.data);
  })
  .catch((error) => {
    console.error(error.response?.data || error.message);
  });

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)
result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        "请求失败。状态码: %s,消息: %s"
        % (result.get("status_code"), result.get("status_message"))
    )

C#

csharp
using Newtonsoft.Json.Linq;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace SeerMarTechDemos
{
    public static class Demos
    {
        public static async Task GetLlmScraperLocations()
        {
            using var httpClient = new HttpClient
            {
                BaseAddress = new Uri("https://api.seermartech.cn/")
            };

            httpClient.DefaultRequestHeaders.Authorization =
                new AuthenticationHeaderValue(
                    "Bearer",
                    "smt_live_YOUR_KEY"
                );

            var response = await httpClient.GetAsync(
                "/v3/ai_optimization/gemini/llm_scraper/locations"
            );

            var result = JObject.Parse(
                await response.Content.ReadAsStringAsync()
            );

            if ((int?)result["status_code"] == 20000)
            {
                Console.WriteLine(result);
            }
            else
            {
                Console.WriteLine(
                    $"请求失败。状态码: {result["status_code"]}," +
                    $"消息: {result["status_message"]}"
                );
            }
        }
    }
}

响应示例

json
{
  "version": "0.1.20260223",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0690 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0500 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "gemini",
        "llm_scraper",
        "locations"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "locations",
        "se": "gemini",
        "se_type": "llm_scraper"
      },
      "result": [
        {
          "location_code": 20044,
          "location_name": "Lower Austria,Austria",
          "location_code_parent": 20000,
          "country_iso_code": "AT",
          "location_type": "行政区"
        }
      ]
    }
  ]
}

状态码

  • 顶层 status_code 用于表示本次 API 请求的整体处理状态。
  • tasks[].status_code 用于表示任务的处理状态。
  • 当状态码为 20000 时,通常表示请求成功。
  • 状态码表示请求或任务处理异常,错误信息以 status_message 为准。

实用场景

  • 获取支持的地点代码,为 LLM 搜索任务合法的国家、城市或区域参数,因地点代码无效导致任务失败。
  • 按国家筛选可用地点,构建不同国家的 SEO 与搜索结果采集任务,支持多地区市场分析。
  • 建立地点名称与代码映射表,在后台管理系统中展示可读地点名称,并向 API 传递标准化地点代码。
  • 识别地点层级,通过 location_code_parent 组织国家、州省、城市及地点等层级数据,支持区域报告汇总。
  • 校验区域覆盖范围,在创建批量 LLM 抓取任务前检查目标市场是否受支持,降低无效任务和数据缺失风险。

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