主题
content_analysis/search/live
#分析搜索(实时)
接口说明
该接口用于按目标检索引用(citation)数据,并返回匹页面的详细信息页面 URL、域名、评分、抓取时间、页面类型、文本片段、感倾向、质量分等。
请求方式: POST接口地址: https://api.seermartech.cn/v3/content_analysis/search/live
计费与调用限制
- 按请求次数计费
- 参考价请以响应中的
cost字段为准 - 实扣费以响应头
X-SeerMarTech-Charge-CNY为准 - 请求体为
JSON,编码为UTF-8 - POST 请求体格式为 JSON 数组:
[{ ... }] - 每分钟最多可发送
2000次 API 调用
请求参数
以下为任务设置字段说明。
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | 目标。填。使用 UTF-8 编码。系统会自动转换为小写。若要精确匹完整短语而非单个,请使用双引号并进行转义,例如:"keyword": "\"tesla palo alto\"" |
keyword_fields | object | 可选。按指定字段中的过滤数据集。支持字段:title、main_title、previous_title、snippet。可同时指定多个字段。若需精确匹短语,同样使用双引号并转义。示例:"keyword_fields": { "snippet": "\"logitech mouse\"", "main_title": "sale" } |
page_type | array | 可选。按页面类型过滤。可选值:"ecommerce"、"news"、"blogs"、"message-boards"、"organization" |
search_mode | string | 可选。结果分组方式。as_is:返回目标 keyword 的引用;one_per_domain:每个域名返回一条引用。默认值:as_is |
limit | integer | 可选。返回的最大引用数量。默认值:100,最大值:1000 |
filters | array | 可选。结果过滤条件数组。最多支持 8 个过滤条件,条件之间可使用逻辑运算符 and、or。支持操作符:regex、not_regex、<、<=、>、>=、=、<>、in、not_in、like、not_like、match、not_match。 like 和 not_like 支持 % 作为任意长度通符。更多规则参考 /v3/content_analysis/filters |
order_by | array | 可选。结果排序规则。可使用与 filters 相同的字段路径。排序方式:asc 升序,desc 降序。单次请求最多支持 3 条排序规则 |
offset | integer | 可选。结果偏移量。默认值:0。例如设置为 10 时,将跳过前 10 条结果并返回后续数据。建议在获取不 10,000 条结果时使用 |
offset_token | string | 可选。用于后续翻页请求的偏移令牌。该值会在响应中返回。若要获取 10,000 条结果,建议使用此参数时。注意: 如果请求中指定了 offset_token,除 limit 外的参数都会被忽略 |
rank_scale | string | 可选。定义 domain_rank 和 url_rank 的展示尺度。one_hundred:0–100;one_thousand:0–1000。默认值:one_thousand |
tag | string | 可选。用户自定义任务标识,最大长度 255 个字符。可用于结果归因与任务追踪,返回时会出现在响应 data 对象中 |
请求示例
curl
bash
curl --location --request POST "https://api.seermartech.cn/v3/content_analysis/search/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "logitech",
"keyword_fields": {
"snippet": "logitech"
},
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"search_mode": "as_is",
"filters": [
["main_domain", "=", "reviewfinder.ca"]
],
"order_by": [
"content_info.sentiment_connotations.anger,desc"
],
"limit": 10
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/search/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
data = [
{
"keyword": "logitech",
"keyword_fields": {
"snippet": "logitech"
},
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"search_mode": "as_is",
"filters": [
["main_domain", "=", "reviewfinder.ca"]
],
"order_by": [
"content_info.sentiment_connotations.anger,desc"
],
"limit": 10
}
]
response = requests.post(url, headers=headers, json=data)
print(response.json)TypeScript
typescript
import axios from "axios";
const postData = [
{
keyword: "logitech",
keyword_fields: {
snippet: "logitech"
},
page_type: [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
search_mode: "as_is",
filters: [
["main_domain", "=", "reviewfinder.ca"]
],
order_by: [
"content_info.sentiment_connotations.anger,desc"
],
limit: 10
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/content_analysis/search/live",
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 数据,顶层 tasks 数组。
顶层响应字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 通用状态码。完整错误码参考 /v3/appendix/errors |
status_message | string | 通用状态信息 |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总成本,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 返回错误的任务数量 |
tasks | array | 任务结果数组 |
tasks[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时 |
cost | float | 任务成本,单位 USD |
result_count | integer | result 数组中的结果数 |
path | array | URL 路径 |
data | object | 与请求中提交的参数一致 |
result | array | 获取结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
offset_token | string | 下一页查询令牌。用于获取后续结果 |
total_count | integer | 数据库中与请求的总结果数 |
items_count | integer | items 数组中的返回条数 |
items | array | 引用及数据 |
items[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 content_analysis_search |
url | string | 发现引用的页面 URL |
domain | string | 域名 |
main_domain | string | 主域名 |
url_rank | integer | url 的排名值,基于反向链接数据计算 |
spam_score | string | url 的外链垃圾分数 |
domain_rank | string | domain 的排名值,基于域名反向链接数据计算 |
fetch_time | string | 爬虫访问该页面的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
country | string | 域名注册国家代码。可用国家列表参考 /v3/content_analysis/locations/ |
language | string | 域名主要语言。可用语言列表参考 /v3/content_analysis/languages/ |
score | string | 引用显著性评分。综合 url_rank、domain_rank 以及在 title、main_title、url、snippet 中的出现计算,值越高表示引用价值越高 |
page_category | array | 页面产品/服务分类。完整分类参考 /v3/content_analysis/categories/ |
page_types | array | 页面类型 |
ratings | array | 页面中基于微数据提取的评分信息 |
social_metrics | array | 社交媒体互动指标 |
content_info | object | 页面中该引用的详细信息 |
content_info 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
content_type | string | 类型,例如 page_content、comment |
title | string | 当前结果标题 |
main_title | string | 页面标题 |
previous_title | string | 上一个区块标题 |
level | integer | title 的标题层级,对应 HTML h1 到 h6 |
author | string | |
snippet | string | 片段 |
snippet_length | integer | 片段字符长度 |
social_metrics | array | 与该的社交互动指标 |
highlighted_text | string | 从 snippet 中提取的高亮文本 |
language | string | 语言。可用语言列表参考 /v3/content_analysis/languages/ |
sentiment_connotations | object | 感语义倾向及概率值。可能:anger、happiness、love、sadness、share、fun |
connotation_types | object | 感极性及概率值。可能:positive、negative、neutral |
text_category | array | 文本分类。完整分类参考 /v3/content_analysis/categories/ |
date_published | string | 发布时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
content_quality_score | integer | 质量分,基于词数、句数和字符数计算 |
semantic_location | string | 引用所在的 HTML 语义位置,例如 article、header |
rating | object | 与 content_info 的评分信息 |
group_date | string | 引用分组时间。通常表示发布时间,或平台首次抓取该页面的时间。可用于按日期分组并展示引用趋势 |
rating 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
name | string | 评分类型,例如 Max5、Percents、CustomMax |
rating_value | integer | 当前评分值 |
max_rating_value | integer | 该评分体系的最大值 |
rating_count | integer | 投票数 |
relative_rating | float | 相对评分值 |
响应示例
json
{
"version": "0.1.20220913",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.5305 sec.",
"cost": 0.0203,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "content_analysis",
"function": "search",
"keyword_fields": {
"snippet": "logitech"
},
"search_mode": "as_is",
"internal_list_limit": 8,
"limit": 10
},
"result": [
{
"items": [
{
"type": "content_analysis_search",
"url": "https://reviewfinder.ca/info/top-gaming-racing-wheels/logitech-g920/",
"domain": "reviewfinder.ca",
"main_domain": "reviewfinder.ca",
"url_rank": 64,
"spam_score": 0,
"domain_rank": 493,
"fetch_time": "2022-07-31 20:16:34 +00:00",
"country": "CA",
"language": "en",
"score": 5751.833,
"ratings": null,
"social_metrics": null,
"content_info": {
"content_type": "page_content",
"title": "Logitech G920 - Recommended and relevant!",
"main_title": "Logitech G920 - Reviews, Prices, Specs and Alternatives",
"previous_title": "ReviewFinder Gaming Racing Wheels Logitech G920",
"level": 2,
"author": null,
"snippet": "According to the meta ranking published on 3 July 2022, Logitech G920 is currently recommended as a high-quality Racing Wheel.",
"snippet_length": 1400,
"social_metrics": null,
"highlighted_text": null,
"language": "en",
"sentiment_connotations": {
"anger": null,
"happiness": 0.15027441084384918,
"love": 0.1787649393081665,
"sadness": 0.09101732820272446,
"share": null,
"fun": 0.0640750378370285
},
"connotation_types": {
"positive": 0.34157365560531616,
"negative": 0.3285507559776306,
"neutral": 0.32990556955337524
},
"date_published": null,
"content_quality_score": 94,
"semantic_location": 94,
"rating": null,
"group_date": "2021-09-13 05:05:18 +00:00"
}
}
]
}
]
}
]
}错误处理
- 顶层
status_code表示整个请求的执行状态 tasks[].status_code表示单个任务的执行状态- 建议同时检查:
- HTTP 状态码
- 顶层
status_code - 任务级
tasks[].status_code - 完整错误码与说明参考:
/v3/appendix/errors
使用建议
1. 精确短语匹
如果需要精确匹短语而不是分词匹,请对使用转义双引号,例如:
json
[
{
"keyword": "\"tesla palo alto\""
}
]2. 大结果集分页
- 获取少量结果时,优使用
offset-过10,000条结果时,建议使用offset_token - 使用
offset_token时,除limit外参数不会生效
3. 排序与过滤
filters最多 8 条order_by最多 3 条- 可以结合感字段、域名字段、质量字段等进行精准筛选
实用场景
- 监测品牌提及:按品牌词检索网引用,快速识别在哪些页面、栏目和域名中被提及,品牌舆与分析。
- 筛选高价值外部:结合
score、domain_rank、url_rank过滤高质量页面,优定位更传播价值或SEO价值的引用来源。 - 分析感倾向:利用
sentiment_connotations与connotation_types判断所在的正负面倾向,为品牌声量和口碑分析提供依据。 - 追踪行业趋势:通过
group_date按时间聚合引用数据,观察某个产品词、品牌词或话题词的热度变化趋势。 - 发现垂直页面类型机会:按
page_type、page_category和semantic_location分析更常出现在哪类页面与结构中,为选题和外链投放提供参考。