主题
OnPage 重复检测
POST /v3/on_page/duplicate_content
本接口使用 POST /v3/on_page/duplicate_content,根据指定页面返回相似的页面列表,同时提供页面性能、质量和 SEO 检查数据。
接口使用 SimHash 算法计算相似度,分值范围为 0~10:
0:不相似10:一致- 默认将相似度大于或等于
6的页面判定为重复
计费说明
本接口当前不收取任务费用,任务结果可在提交后的 30 天获取。
参考价约 ¥0 / 次。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求说明
- 请求方法:
POST - 请求路径:
/v3/on_page/duplicate_content - 请求地址:
https://api.seermartech.cn/v3/on_page/duplicate_content - Content-Type:
application/json - 字符编码:UTF-8
- 请求体格式:JSON 数组
请求中的 id须来自 /v3/on_page/task_post 接口的任务创建响应。
请求参数
请求体为任务数组,每个代表一个查询任务。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
id | string | 是 | 任务 ID。使用已创建任务的 ID。示例:07131248-1535-0216-1000-17384017ad04 |
url | string | 是 | 要检测重复的初始页面 URL |
similarity | integer | 否 | 相似度阈值,取值范围为 0~10。默认值为 6,当相似度大于或等于该值时视为重复 |
limit | integer | 否 | 返回页面的最大数量。默认值为 100,最大值为 1000 |
offset | integer | 否 | 结果偏移量。默认值为 0,最大值为 2000000。例如设置为 10 时,跳过结果中的前 10 条记录 |
tag | string | 否 | 自定义任务标识,最多 255 个字符。可用于匹任务与结果,提交的值会原样返回在响应的 data 对象中 |
请求示例
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/on_page/duplicate_content" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"id": "07281559-0695-0216-0000-c269be8b7592",
"url": "https://www.etsy.com/",
"similarity": 6,
"limit": 100,
"offset": 0,
"tag": "duplicate-check-001"
}
]'Python 示例
python
import requests
url = "https://api.seermartech.cn/v3/on_page/duplicate_content"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"id": "07281559-0695-0216-0000-c269be8b7592",
"url": "https://www.etsy.com/",
"similarity": 6,
"limit": 100,
"offset": 0,
"tag": "duplicate-check-001",
}
]
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,状态码:%s,消息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript 示例
typescript
import axios from "axios";
const response = await axios.post(
"https://api.seermartech.cn/v3/on_page/duplicate_content",
[
{
id: "07281559-0695-0216-0000-c269be8b7592",
url: "https://www.etsy.com/",
similarity: 6,
limit: 100,
offset: 0,
tag: "duplicate-check-001",
},
],
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
if (response.data.status_code === 20000) {
console.log(response.data);
} else {
console.error(
response.data.status_code,
response.data.status_message
);
}响应结构
接口返回 JSON 对象,主要结构如下:
json
{
"version": "0.1.20210129",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.3879 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "07281559-0695-0216-0000-c269be8b7592",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.3879 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"on_page",
"duplicate_content"
],
"data": {
"api": "on_page",
"function": "duplicate_content",
"id": "07281559-0695-0216-0000-c269be8b7592",
"url": "https://www.etsy.com/",
"similarity": 6,
"limit": 100,
"offset": 0,
"tag": "duplicate-check-001"
},
"result": [
{
"crawl_progress": "finished",
"crawl_status": {
"max_crawl_pages": 100,
"pages_in_queue": 0,
"pages_crawled": 100,
"items_count": 1
},
"items": [
{
"url": "https://www.etsy.com/",
"total_count": 1,
"pages": [
{
"similarity": 8.7,
"page": {
"resource_type": "html",
"status_code": 200,
"location": null,
"url": "https://example.com/page",
"meta": {},
"content": {},
"spell": {},
"resource_errors": {},
"social_media_tags": {},
"page_timing": {},
"onpage_score": 88.36,
"checks": {},
"last_modified": {}
}
}
]
}
]
}
]
}
]
}顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 局状态码。成功通常为 20000 |
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 格式 |
status_code | integer | 任务状态码,通常位于 10000~60000 范围 |
status_message | string | 任务状态信息 |
time | string | 任务执行耗时,单位为秒 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | 提交任务时使用的参数 |
result | array | 查询结果数组 |
结果字段
抓取状态
| 字段 | 类型 | 说明 |
|---|---|---|
crawl_progress | string | 抓取状态,可取 in_progress 或 finished |
crawl_status | object | 抓取会话 |
crawl_status.max_crawl_pages | integer | 创建任务时设置的最大抓取页数 |
crawl_status.pages_in_queue | integer | 当前排队抓取的页面数量 |
crawl_status.pages_crawled | integer | 已抓取页面数量 |
crawl_status.items_count | integer | items 数组中的结果数量 |
items | array | 重复检测结果数组 |
items 字段
| 字段 | 类型 | 说明 |
|---|---|---|
url | string | 请求中指定的初始页面 URL |
total_count | integer | 检测到的重复页面总数 |
pages | array | 含重复的页面列表 |
重复页面字段
| 字段 | 类型 | 说明 |
|---|---|---|
similarity | object/number | 相似度。文档定义为相似度分值,范围为 0~10,默认 >=6 判定为重复 |
page | array/object | 重复页面的详细信息 |
page 页面字段
页面基础信息
| 字段 | 类型 | 说明 |
|---|---|---|
resource_type | string | 资源类型,通常为 html |
status_code | integer | 页面 HTTP 状态码 |
location | string | Location 响应头,表示页面重定向目标 URL |
url | string | 页面 URL |
meta | object | 页面属性,取决于资源类型 |
title | string | 页面标题 |
charset | integer | 页面字符集编码,例如 65001 |
follow | boolean | meta robots 是否爬虫跟随页面链接;为 false 时表示存在 nofollow |
generator | string | generator标签 |
htags | object | HTML 标题标签信息 |
description | string | description标签 |
favicon | string | 页面图标 URL |
meta_keywords | string | keywords标签 |
canonical | string | 规范页面 URL |
internal_links_count | integer | 页面链接数量 |
external_links_count | integer | 页面外部链接数量 |
inbound_links_count | integer | 指向该页面的链接数量 |
images_count | integer | 图片数量 |
images_size | integer | 图片总大小,单位为字节 |
scripts_count | integer | 脚本数量 |
scripts_size | integer | 脚本总大小,单位为字节 |
stylesheets_count | integer | 样式表数量 |
stylesheets_size | integer | 样式表总大小,单位为字节 |
title_length | integer | title 标签字符数 |
description_length | integer | description 标签字符数 |
render_blocking_scripts_count | integer | 阻塞页面渲染的脚本数量 |
render_blocking_stylesheets_count | integer | 阻塞页面渲染的样式表数量 |
cumulative_layout_shift | float | 累积布局偏移 CLS,用于衡量页面布局稳定性 |
content信息
| 字段 | 类型 | 说明 |
|---|---|---|
plain_text_size | integer | 页面纯文本总大小,单位为字节 |
plain_text_rate | integer/float | 纯文本占页面大小的比例,即 plain_text_size / size |
plain_text_word_count | float | 页面单词数量 |
automated_readability_index | float | 自动化可读性指数 |
coleman_liau_readability_index | float | Coleman-Liau 可读性指数 |
dale_chall_readability_index | float | Dale-Chall 可读性指数 |
flesch_kincaid_readability_index | float | Flesch-Kincaid 可读性指数 |
smog_readability_index | float | SMOG 可读性指数 |
description_to_content_consistency | float | 页面描述与正文的一致性,范围为 0~1 |
title_to_content_consistency | float | 页面标题与正文的一致性,范围为 0~1 |
meta_keywords_to_content_consistency | float | meta keywords 与正文的一致性,范围为 0~1 |
deprecated_tags | array | 页面中使用的过时标签 |
duplicate_meta_tags | array | 重复的标签 |
拼写、资源和社交标签
| 字段 | 类型 | 说明 |
|---|---|---|
spell | object | 拼写检查结果 |
spell.hunspell_language_code | string | 拼写检查语言代码 |
spell.misspelled | array | 拼写错误单词数组 |
spell.misspelled[].word | string | 拼写错误的单词 |
resource_errors | object | 页面资源错误与警告 |
resource_errors.errors | array | 资源错误列表 |
resource_errors.errors[].line | integer | 发现错误的行号 |
resource_errors.errors[].message | string | 错误信息 |
resource_errors.warnings | array | 资源警告列表 |
resource_errors.warnings[].line | integer | 警告对应的行号;0 表示警告与整个页面 |
resource_errors.warnings[].message | string | 警告信息。常见值 Has node with more than 60 childs.、Has more that 1500 nodes.、HTML depth more than 32 tags. |
social_media_tags | object | 页面中检测到的社交媒体标签及,支持 Open Graph、Twitter Card 等标签 |
page_timing 页面加载指标
| 字段 | 类型 | 说明 |
|---|---|---|
time_to_interactive | integer | 首次可交互时间 TTI,单位为毫秒 |
dom_complete | integer | 页面及子资源下载完成的时间,单位为毫秒 |
largest_contentful_paint | float | 最大绘制 LCP,单位为毫秒 |
first_input_delay | float | 首次延迟 FID,单位为毫秒 |
connection_time | integer | 建立服务器连接的耗时,单位为毫秒 |
time_to_secure_connection | integer | 建立连接的耗时,单位为毫秒 |
request_sent_time | integer | 发送请求的耗时,单位为毫秒 |
waiting_time | integer | 首字节时间 TTFB,单位为毫秒 |
download_time | integer | 浏览器接收响应的耗时,单位为毫秒 |
duration_time | integer | 接收完整响应的总耗时,单位为毫秒 |
fetch_start | integer | 开始下载 HTML 资源的时间 |
fetch_end | integer | 完成下载 HTML 资源的时间 |
页面性能和抓取信息
| 字段 | 类型 | 说明 |
|---|---|---|
onpage_score | float | 页面 SEO 优化得分,范围为 0~100,100 表示未发现严重页面问题 |
total_dom_size | integer | 页面 DOM 总大小 |
custom_js_response | string/object/integer | 执行自定义 JavaScript 的结果。只有创建任务时指定 custom_js 才会返回,类型取决于脚本结果 |
custom_js_client_exception | string | 执行自定义 JavaScript 时产生的错误信息 |
broken_resources | boolean | 页面是否存在损坏资源 |
broken_links | boolean | 页面是否存在失效链接 |
duplicate_title | boolean | 页面是否存在重复标题 |
duplicate_description | boolean | 页面是否存在重复描述 |
duplicate_content | boolean | 页面是否存在重复 |
click_depth | integer | 从首页到达该页面所需的点击层级 |
size | integer | 页面资源大小,单位为字节 |
encoded_size | integer | 编码后的页面大小,单位为字节 |
total_transfer_size | integer | 压缩后的页面传输大小 |
fetch_time | string | 资源抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00,例如 2019-11-15 12:57:46 +00:00 |
content_encoding | string | 编码类型 |
media_type | string | 页面使用的媒体类型 |
server | string | 服务器版本 |
is_resource | boolean | 页面是否为单一资源 |
cache_control 缓存信息
| 字段 | 类型 | 说明 |
|---|---|---|
cachable | boolean | 页面是否可缓存 |
ttl | integer | 缓存有效期,单位取决于接口返回值,表示浏览器缓存资源的时间 |
last_modified 最后修改时间
如果没有对应数据,last_modified 或子字段可能为 null。
| 字段 | 类型 | 说明 |
|---|---|---|
header | string | HTTP 响应头记录的最后修改时间 |
sitemap | string | Sitemap 中记录的最后修改时间 |
meta_tag | string | 标签中记录的最后修改时间 |
时间均使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。
checks 页面检查项
以下字段均为布尔值,用于表示页面是否存在对应问题:
| 字段 | 含义 |
|---|---|
no_content_encoding | 页面未使用压缩编码 |
high_loading_time | 页面加载时间 3 秒 |
is_redirect | 页面存在 3XX 重定向 |
is_4xx_code | 页面返回 4xx 状态码 |
is_5xx_code | 页面返回 5xx 状态码 |
is_broken | 页面返回小于 200 或大于 400 的状态码 |
is_www | 页面位于 www 子域名 |
is_https | 页面使用 HTTPS |
is_http | 页面使用 HTTP |
high_waiting_time | TTFB过 1.5 秒 |
no_doctype | 页面缺少 DOCTYPE 声明 |
canonical | 页面为规范页面 |
no_encoding_meta_tag | 页面缺少编码标签;在 canonical=true 时提供 |
no_h1_tag | 页面缺少或为空的 H1 标签;在 canonical=true 时提供 |
https_to_http_links | HTTPS 页面指向 HTTP 页面的链接;在 canonical=true 时提供 |
has_html_doctype | 页面 HTML DOCTYPE 声明 |
size_greater_than_3mb | 页面大小 3 MB;在 canonical=true 时提供 |
meta_charset_consistency | 页面声明的字符集与字符集不一致;在 canonical=true 时提供 |
has_meta_refresh_redirect | 页面 Meta Refresh 重定向;在 canonical=true 时提供 |
has_render_blocking_resources | 页面阻塞渲染的脚本或样式;在 canonical=true 时提供 |
redirect_chain | 页面到达前至少发生两次重定向 |
low_content_rate | 纯文本大小与页面大小的比值小于 0.1;在 canonical=true 时提供 |
high_content_rate | 纯文本大小与页面大小的比值大于 0.9;在 canonical=true 时提供 |
low_character_count | 页面字符数少于 1024;在 canonical=true 时提供 |
high_character_count | 页面字符数 256000;在 canonical=true 时提供 |
small_page_size | 页面大小小于 1024 字节;在 canonical=true 时提供 |
large_page_size | 页面大小 1 MB;在 canonical=true 时提供 |
low_readability_rate | Flesch-Kincaid 可读性得分低于 15;在 canonical=true 时提供 |
irrelevant_description | 页面描述与正文性低于 0.2;在 canonical=true 时提供 |
irrelevant_title | 页面标题与正文性低于 0.3;在 canonical=true 时提供 |
irrelevant_meta_keywords | keywords 与正文性低于 0.6;在 canonical=true 时提供 |
title_too_long | title过 65 个字符;在 canonical=true 时提供 |
title_too_short | title 少于 30 个字符;在 canonical=true 时提供 |
deprecated_html_tags | 页面使用过时 HTML 标签;在 canonical=true 时提供 |
duplicate_meta_tags | 页面存在多个相同类型的标签;在 canonical=true 时提供 |
duplicate_title_tag | 页面存在多个 title 标签;在 canonical=true 时提供 |
no_image_alt | 图片缺少 alt 属性;在 canonical=true 时提供 |
no_image_title | 图片缺少 title 属性;在 canonical=true 时提供 |
no_description | 页面缺少或为空的 description 标签;在 canonical=true 时提供 |
no_title | 页面缺少或为空的 title 标签;在 canonical=true 时提供 |
no_favicon | 页面缺少 favicon;在 canonical=true 时提供 |
seo_friendly_url | URL 不符合 SEO 友好标准;在 canonical=true 时提供 |
flash | 页面 Flash素 |
frame | 页面 frame、iframe 或 frameset 标签 |
lorem_ipsum | 页面 Lorem ipsum 占位文本;在 canonical=true 时提供 |
has_misspelling | 页面拼写错误 |
seo_friendly_url_characters_check | URL 使用大小写拉丁字母、数字和连字符 |
seo_friendly_url_dynamic_check | URL 不动态参数 |
seo_friendly_url_keywords_check | URL 与页面标题 |
seo_friendly_url_relative_length_check | URL 相对路径不 120 个字符 |
is_orphan_page | 页面没有站页面链接指向 |
is_link_relation_conflict | 指向页面的链接同时 follow 和 nofollow |
has_links_to_redirects | 页面链接指向返回 3XX 的页面 |
recursive_canonical | 页面规范链接指向另一页面,而另一页面又指回当前页面 |
canonical_chain | 规范链接形成链式指向,例如页面 A 指向 B,B 再指向 C |
canonical_to_redirect | 规范链接指向会发生 3XX 重定向的页面 |
canonical_to_broken | 规范链接指向返回 4xx 或 5xx 的失效页面 |
seo_friendly_url 综合以下四项判断:
- 相对路径长度小于 120 个字符;
- 不特殊字符;
- 不动态参数;
- URL 与页面。
任一项不满足时,该 URL 可能被判定为非 SEO 友好。
错误处理
请根据响应中的以下字段处理异常:
status_code:局或任务级状态码status_message:对应的错误或提示信息tasks_error:返回错误的任务数量
建议在客户端实现以下处理逻辑:
- 检查 HTTP 状态码;
- 检查顶层
status_code是否为20000; - 遍历
tasks,单独处理任务级错误; - 对
crawl_progress=in_progress的结果进行轮询或延迟重试; - 对网络时、限流和服务端错误执行带退避策略的重试。
实用场景
- 定位站重复页面:按相似度阈值筛选重复,减少耗并明确页面规范化策略。
- 审查模板化:批量识别商品页、分类页或地区页中的高度相似正文,指导差异化改写。
- 评估重复页面质量:结合
onpage_score、标题、描述、一致性和可读性指标,确定优优化页面。 - 排查重复伴随的技术问题:同时检查 canonical、重定向、失效链接、孤立页面和重复标签,完善索引控制。
- 建立理单:结合
similarity、duplicate_content、duplicate_title和duplicate_description字段,生成合并、删除或重写任务。