Skip to content

不可索引页面查询

接口说明

该接口用于返回站点中被搜索引擎禁止索引的页面列表。不可索引的原因可能来自:

  • robots.txt
  • HTTP 响应头
  • 页面 meta 标签
  • 页面属性设置
  • 重定向次数过多

接口路径:

POST /v3/on_page/non_indexable

完整请求地址:

https://api.seermartech.cn/v3/on_page/non_indexable

计费说明

调用该接口不额外收费。 已获取的任务结果可在 30 天读取

参考价约 ¥0.0000 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求格式

所有 POST 数据均需使用 JSON(UTF-8 编码)提交。 请求体为 JSON 数组,格式如下:

json
[
 {
 "id": "任务ID",
 "limit": 10
 }
]

请求参数

字段名类型说明
idstring。任务 ID。可通过 /v3/on_page/task_post/ 接口返回结果获取。示例:07131248-1535-0216-1000-17384017ad04
limitinteger可选。返回页面数量上限。默认值:100;最大值:1000
offsetinteger可选。结果偏移量。默认值:0;最大值:2000000。例如设置为 10 时,将跳过前 10 条结果并返回后续页面
filtersarray可选。结果过滤条件数组,最多支持 8 个过滤条件。多个条件之间需使用逻辑运算符 andor 连接

filters 支持的运算符

支持以下过滤运算符:

  • regex
  • not_regex
  • <
  • <=
  • >
  • >=
  • =
  • <>
  • in
  • not_in
  • like
  • not_like

说明:

  • likenot_like 支持使用 % 作为通符,匹任意长度字符串

filters 示例

下面的过滤条件表示:

  • reason = robots_txt
  • urlgo
json
[
 {
 "id": "07281559-0695-0216-0000-c269be8b7592",
 "filters": [
 ["reason", "=", "robots_txt"],
 "and",
 ["url", "like", "%go%"]
 ],
 "limit": 10
 }
]

可用过滤字段的完整范围请参考过滤器说明文档。

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码。完整错误码说明见参考文档。建议在接时做好异常与错误处理
status_messagestring通用状态信息
timestring执行耗时,单位:秒
costfloat本次请求总成本
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000
status_messagestring任务状态信息
timestring任务执行耗时,单位:秒
costfloat当前任务成本
result_countintegerresult 数组中的数量
patharrayURL 路径
dataobject与请求中提交参数一致的数据对象
resultarray结果数组

result[] 字段

字段名类型说明
crawl_progressstring抓取进度状态。可能值:in_progressfinished
crawl_statusobject抓取会话
max_crawl_pagesinteger抓取页面上限,即创建任务时指定的 max_crawl_pages
pages_in_queueinteger当前仍在抓取队列中的页面数
pages_crawledinteger已抓取页面数
total_items_countinteger数据库中符合条件的总记录数
items_countinteger当前结果数组中的记录数
itemsarray不可索引页面列表

items[] 字段

字段名类型说明
reasonstring页面不可索引的原因
urlstring不可索引页面的 URL

reason 可能值

含义
robots_txtrobots.txt 禁止抓取/索引
meta_tag被页面 meta 标签限制索引
http_header被 HTTP 响应头限制索引
attribute被页面属性设置限制索引
too_many_redirects重定向次数过多导致不可索引

请求示例

cURL

bash
curl --location --request POST "https://api.seermartech.cn/v3/on_page/non_indexable" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
 {
 "id": "07281559-0695-0216-0000-c269be8b7592",
 "filters": [
 ["reason", "=", "robots_txt"],
 "and",
 ["url", "like", "%go%"]
 ],
 "limit": 10
 }
]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/on_page/non_indexable"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}
data = [
 {
 "id": "07281559-0695-0216-0000-c269be8b7592",
 "filters": [
 ["reason", "=", "robots_txt"],
 "and",
 ["url", "like", "%go%"]
 ],
 "limit": 10
 }
]

response = requests.post(url, headers=headers, json=data)
print(response.json)

TypeScript

typescript
import axios from "axios";

const postData = [
 {
 id: "07281559-0695-0216-0000-c269be8b7592",
 filters: [
 ["reason", "=", "robots_txt"],
 "and",
 ["url", "like", "%go%"]
 ],
 limit: 10
 }
];

axios({
 method: "post",
 url: "https://api.seermartech.cn/v3/on_page/non_indexable",
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
 },
 data: postData
})
 .then((response) => {
 // 返回结果
 console.log(response.data);
 })
 .catch((error) => {
 console.error(error);
 });

响应示例

json
{
 "version": "0.1.20200805",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.1075 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "id": "07281559-0695-0216-0000-c269be8b7592",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.0321 sec.",
 "cost": 0,
 "result_count": 1,
 "path": [
 "v3",
 "on_page",
 "non_indexable"
 ],
 "data": {
 "api": "on_page",
 "function": "non_indexable"
 },
 "result": [
 {
 "crawl_progress": "finished",
 "crawl_status": {
 "max_crawl_pages": 100,
 "pages_in_queue": 0,
 "pages_crawled": 100
 },
 "total_items_count": 2,
 "items_count": 2,
 "items": [
 {
 "reason": "robots_txt",
 "url": "https://example.com/go/"
 },
 {
 "reason": "meta_tag",
 "url": "https://example.com/private-page/"
 }
 ]
 }
 ]
 }
 ]
}

状态码说明

  • 顶层 status_code 表示整个请求的处理状态
  • tasks[].status_code 表示单个任务的执行状态
  • 建议同时校验:
  • HTTP 状态码
  • 顶层 status_code
  • 任务级 tasks[].status_code

如需完整错误码列表,请参考 /v3/appendix/errors

使用说明

  1. 通过 /v3/on_page/task_post/ 创建站点抓取任务
  2. 从任务创建响应中获取 id
  3. 使用该 id 调用 /v3/on_page/non_indexable
  4. 如抓取尚未完成,可根据 crawl_progress 判断当前状态:
  • in_progress:抓取尚未完成
  • finished:抓取已完成,可获取完整结果

实用场景

  • 排查索引异常页面:快速找出被 robots.txtmeta noindex 或响应头屏蔽的页面,缩短 SEO 技术排障时间。
  • 识别误屏蔽目录:筛选指定 URL 目录下的不可索引页面,及时发现模板或规则误伤,减少自然流量损失。
  • 核查改版后索引策略:在站点改版、迁移或 CMS 升级后,批量检查页面是否被错误设置为不可索引,保障收录恢复速度。
  • 监控重定向异常:定位因重定向链过长而无法索引的页面,优化抓取效率并提升搜索引擎可访问性。
  • 按原因分组治理问题:基于 reason 字段分类统计不可索引页面来源,帮助团队按 robots、标签、响应头等问题类型制定修复优级。

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