主题
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 数组可用于数据筛选的参数列表。参数会适用的接口进行分组。
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码 |
status_message | string | 通用状态说明 |
time | string | 接口执行耗时,单位为秒 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | tasks 数组中返回错误的任务数量 |
tasks | array | 任务数组 |
tasks[].id | string | 任务唯一标识,UUID 格式 |
tasks[].status_code | integer | 任务状态码,通常在 10000 至 60000 范围 |
tasks[].status_message | string | 任务状态说明 |
tasks[].time | string | 任务执行耗时,单位为秒 |
tasks[].cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks[].result_count | integer | result 数组中的数量 |
tasks[].path | array | 请求路径 |
tasks[].data | object | GET 请求 URL 中传的参数 |
tasks[].result | array | 可用过滤参数列表及说明 |
响应示例
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"
]
}
]
}
]
}> id、result 等字段的会根据接口版本和可用过滤参数发生变化。
过滤器结构
在调用 AI Optimization LLM Mentions 任务接口时,可通过 filters 字段传筛选条件。
| 字段名 | 类型 | 说明 |
|---|---|---|
filters | array | 结果过滤条件数组,可选 |
$parameter_field | string | 过滤字段。使用过滤器时填,对应上层结果数组中的字段 |
$filter_operator | string | 过滤运算符。使用过滤器时填 |
$filter_value | number / string / boolean / time | 过滤值。使用过滤器时填 |
支持的过滤字段
目前支持以下参数:
| 字段 | 类型 | 说明 |
|---|---|---|
platform | string | AI 平台 |
location_code | number | 地区编码 |
language_code | number | 语言编码 |
ai_search_volume | number | AI 搜索量 |
first_response_at | time | 首次响应时间 |
last_response_at | time | 最近一次响应时间 |
过滤器格式
最多可同时设置 8 个过滤条件。多个条件之间使用逻辑运算符 and 或 or 连接。
单个条件由以下三部分组成:
text
["$parameter_field", "$filter_operator", "$filter_value"]多个条件示例:
json
[
["platform", "=", "chatgpt"],
"and",
["ai_search_volume", ">=", 1000]
]也可以使用 or 连接条件:
json
[
["platform", "=", "chatgpt"],
"or",
["platform", "=", "perplexity"]
]过滤运算符
数值字段
适用于 location_code、language_code、ai_search_volume 等数值类型字段。
支持以下运算符:
| 运算符 | 说明 |
|---|---|
< | 小于 |
<= | 小于或等于 |
> | 大于 |
>= | 大于或等于 |
= | 等于 |
<> | 不等于 |
in | 位于指定值集合中 |
not_in | 不位于指定值集合中 |
使用 in 或 not_in 时,过滤值使用数组:
json
["location_code", "in", [10001, 10002, 10003]]字符串字段
适用于 platform 等字符串类型字段。
支持以下运算符:
| 运算符 | 说明 |
|---|---|
match | 匹字符串 |
not_match | 不匹字符串 |
like | 模糊匹 |
not_like | 不进行模糊匹 |
ilike | 不区分大小写的模糊匹 |
not_ilike | 不区分大小写的不匹 |
in | 位于指定值集合中 |
not_in | 不位于指定值集合中 |
= | 等于 |
<> | 不等于 |
regex | 使用正则表达式匹 |
not_regex | 使用正则表达式排除匹 |
使用 in 或 not_in 时,过滤值使用数组:
json
["platform", "in", ["chatgpt", "perplexity"]]时间字段
适用于 first_response_at 和 last_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"]正则表达式限制
regex 和 not_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 平台的品牌提及:使用
platform合in、=或or,分别统计不同平台中的品牌表现。 - 按地区和语言拆分结果:结合
location_code与language_code筛选目标市场,支持区域化 SEO 和策略分析。 - 分析品牌提及趋势:使用
first_response_at和last_response_at限定时间范围,识别 AI 平台中的新增或持续提及。 - 排除测试或无效数据:使用
not_in、not_match或not_regex排除特定平台、模式或异常结果,提升分析数据质量。