Skip to content

AI 优化:LLM 提及过滤器

GET /v3/ai_optimization/llm_mentions/available_filters

本文介绍 AI 优化 LLM Mentions 接口可使用的过滤器。过滤器针对 result 数组中的对象设置,并且只能筛选对应结果对象中的字段。

获取可用过滤器

请求方法与路径:GET /v3/ai_optimization/llm_mentions/available_filters

调用本接口可获取 LLM Mentions 接口支持的过滤参数。该接口不产生费用。

请求示例

bash
curl --request GET \
  --url https://api.seermartech.cn/v3/ai_optimization/llm_mentions/available_filters \
  --header 'Authorization: Bearer smt_live_YOUR_KEY'

响应说明

接口返回 JSON 数据 result 数组可用于数据筛选的参数列表。参数会适用的接口进行分组。

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码
status_messagestring通用状态说明
timestring接口执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务数组
tasks[].idstring任务唯一标识,UUID 格式
tasks[].status_codeinteger任务状态码,通常在 1000060000 范围
tasks[].status_messagestring任务状态说明
tasks[].timestring任务执行耗时,单位为秒
tasks[].costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks[].result_countintegerresult 数组中的数量
tasks[].patharray请求路径
tasks[].dataobjectGET 请求 URL 中传的参数
tasks[].resultarray可用过滤参数列表及说明

响应示例

json
{
  "version": "0.1.20250828",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0625 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": " aze1d9b7-0000-0000-0000-000000000000",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0312 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "ai_optimization",
        "llm_mentions",
        "available_filters"
      ],
      "data": {
        "api": "ai_optimization",
        "function": "available_filters"
      },
      "result": [
        {
          "endpoint": "llm_mentions",
          "filters": [
            "platform",
            "location_code",
            "language_code",
            "ai_search_volume",
            "first_response_at",
            "last_response_at"
          ]
        }
      ]
    }
  ]
}

> idresult 等字段的会根据接口版本和可用过滤参数发生变化。

过滤器结构

在调用 AI Optimization LLM Mentions 任务接口时,可通过 filters 字段传筛选条件。

字段名类型说明
filtersarray结果过滤条件数组,可选
$parameter_fieldstring过滤字段。使用过滤器时填,对应上层结果数组中的字段
$filter_operatorstring过滤运算符。使用过滤器时填
$filter_valuenumber / string / boolean / time过滤值。使用过滤器时填

支持的过滤字段

目前支持以下参数:

字段类型说明
platformstringAI 平台
location_codenumber地区编码
language_codenumber语言编码
ai_search_volumenumberAI 搜索量
first_response_attime首次响应时间
last_response_attime最近一次响应时间

过滤器格式

最多可同时设置 8 个过滤条件。多个条件之间使用逻辑运算符 andor 连接。

单个条件由以下三部分组成:

text
["$parameter_field", "$filter_operator", "$filter_value"]

多个条件示例:

json
[
  ["platform", "=", "chatgpt"],
  "and",
  ["ai_search_volume", ">=", 1000]
]

也可以使用 or 连接条件:

json
[
  ["platform", "=", "chatgpt"],
  "or",
  ["platform", "=", "perplexity"]
]

过滤运算符

数值字段

适用于 location_codelanguage_codeai_search_volume 等数值类型字段。

支持以下运算符:

运算符说明
<小于
<=小于或等于
>大于
>=大于或等于
=等于
<>不等于
in位于指定值集合中
not_in不位于指定值集合中

使用 innot_in 时,过滤值使用数组:

json
["location_code", "in", [10001, 10002, 10003]]

字符串字段

适用于 platform 等字符串类型字段。

支持以下运算符:

运算符说明
match匹字符串
not_match不匹字符串
like模糊匹
not_like不进行模糊匹
ilike不区分大小写的模糊匹
not_ilike不区分大小写的不匹
in位于指定值集合中
not_in不位于指定值集合中
=等于
<>不等于
regex使用正则表达式匹
not_regex使用正则表达式排除匹

使用 innot_in 时,过滤值使用数组:

json
["platform", "in", ["chatgpt", "perplexity"]]

时间字段

适用于 first_response_atlast_response_at

支持以下运算符:

text
<、<=、>、>=

时间值使用 UTC 格式:

text
yyyy-mm-dd hh-mm-ss +00:00

示例:

json
["first_response_at", ">=", "2025-10-21 06:25:30 +00:00"]

正则表达式限制

regexnot_regex 支持使用 RE2 语法的字符串正则表达式。

正则表达式的最大长度为 1000 个字符

示例:

json
["platform", "regex", "chat.*"]
json
["platform", "not_regex", "test|demo"]

在任务请求中使用过滤器

以下示例展示如何在 LLM Mentions 任务请求中传过滤条件:

bash
curl --request POST \
  --url https://api.seermartech.cn/v3/ai_optimization/llm_mentions/task_post \
  --header 'Authorization: Bearer smt_live_YOUR_KEY' \
  --header 'Content-Type: application/json' \
  --data '[
    {
      "keyword": "seo tools",
      "location_code": 2840,
      "language_code": en,
      "filters": [
        ["platform", "in", ["chatgpt", "perplexity"]],
        "and",
        ["ai_search_volume", ">=", 1000]
      ]
    }
  ]'

> 实可用的任务路径和任务参数,请以对应的 LLM Mentions 接口文档为准。过滤器放置在支持该字段的结果对象对应的请求结构中。

排序限制

以下字段类型不能用于 order_by 排序规则:

text
array.str
array.num

错误与费用说明

  • 请求成功时,通常返回状态码 20000
  • 任务级状态码位于 tasks[].status_code
  • 通用错误信息位于 status_message,任务错误信息位于 tasks[].status_message
  • 本接口用于获取过滤器列表,不收取接口费用。
  • 任务接口如产生费用,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

实用场景

  • 筛选高价值 AI 搜索词:使用 ai_search_volume >= 过滤高搜索量,优分析更大流量潜力的主题。
  • 对比不同 AI 平台的品牌提及:使用 platformin=or,分别统计不同平台中的品牌表现。
  • 按地区和语言拆分结果:结合 location_codelanguage_code 筛选目标市场,支持区域化 SEO 和策略分析。
  • 分析品牌提及趋势:使用 first_response_atlast_response_at 限定时间范围,识别 AI 平台中的新增或持续提及。
  • 排除测试或无效数据:使用 not_innot_matchnot_regex 排除特定平台、模式或异常结果,提升分析数据质量。

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