主题
content_analysis/summary/live
#分析摘要(实时)
接口说明
该接口用于返回目标的引用数据概览,适合快速了解某个在库中的整体提及:
- 引用该的结果总量
- 聚合后的综合 rank
- 主要引用域名 -绪倾向与感类型分布
- 文本分类、页面分类、页面类型分布
- 国家与语言分布
请求方式
POST https://api.seermartech.cn/v3/content_analysis/summary/live
计费说明
该接口按请求计费。 参考价约 ¥0.3205 / 次。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求规则
- 请求体为 UTF-8 编码的 JSON
- POST 请求体格式为 JSON 数组:
[{ ... }] - 每分钟最多可发送 2000 次 API 调用
- 支持按条件过滤、排序,并可指定返回聚合结果中的列表长度
请求参数
| 字段名 | 类型 | 说明 |
|---|---|---|
keyword | string | 目标。填。系统会自动转为小写。若需要匹完整短语而非独立,请使用双引号并进行转义,例如:"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" |
internal_list_limit | integer | 可选。限制数组中的最大数量。作用于:top_domains、text_categories、page_categories、countries、languages。默认值:1;最大值:20 |
positive_connotation_threshold | float | 可选。正向绪阈值。用于限定 connotation_types 中统计的引用:保留 positive 概率大于等于该值的数据。取值范围:0 到 1;默认值:0.4 |
sentiments_connotation_threshold | float | 可选。绪倾向阈值。用于限定 sentiment_connotations 中统计的引用:保留各绪概率大于等于该值的数据。取值范围:0 到 1;默认值:0.4 |
initial_dataset_filters | array | 可选。初始数据集过滤参数,作用于 /v3/content_analysis/search/live/ 可用的字段。最多支持 8 个过滤条件,条件之间需使用逻辑运算符 and / or 连接。支持操作符:regex、not_regex、<、<=、>、>=、=、<>、in、not_in、like、not_like、has、has_not。 like / not_like 支持使用 % 匹任意长度字符串。更多规则可参考 /v3/content_analysis/filters |
rank_scale | string | 可选。定义 rank 的计算与展示刻度。可选值:one_hundred(0–100)或 one_thousand(0–1000)。默认值:one_thousand |
tag | string | 可选。用户自定义任务标识,最大长度 255 字符。可用于请求与响应结果对,返回时会出现在响应的 data 对象中 |
响应结构
接口返回 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,完整列表参考 /v3/appendix/errors |
status_message | string | 任务状态说明 |
time | string | 任务执行耗时,单位秒 |
cost | float | 单任务成本,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | 回显请求中提交的参数 |
result | array | 结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 content_analysis_summary |
total_count | integer | 与请求条件匹的数据库结果总量 |
rank | integer | 所有引用该 keyword 的 URL 综合 rank,为归一化后的 rank 总和 |
top_domains | array | 主要引用域名列表,域名及对应引用次数 |
sentiment_connotations | object | 绪倾向分布,统计与目标引用的绪及次数。可选绪:anger、happiness、love、sadness、share、fun |
connotation_types | object | 感极性分布,统计不同极性的引用次数。可选值:positive、negative、neutral |
text_categories | array | 文本分类分布,分类及对应引用次数。完整分类可通过 /v3/content_analysis/categories/ 获取 |
page_categories | array | 页面分类分布,分类及对应引用次数。完整分类可通过 /v3/content_analysis/categories/ 获取 |
page_types | object | 页面类型分布及对应引用次数 |
countries | object | 国家分布及对应引用次数。完整国家列表可通过 /v3/content_analysis/locations/ 获取 |
languages | object | 语言分布及对应引用次数。完整语言列表可通过 /v3/content_analysis/languages/ 获取 |
请求示例
cURL
bash
curl --location --request POST "https://api.seermartech.cn/v3/content_analysis/summary/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "logitech",
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"internal_list_limit": 8,
"positive_connotation_threshold": 0.5
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/summary/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
payload = [
{
"keyword": "logitech",
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"internal_list_limit": 8,
"positive_connotation_threshold": 0.5
}
]
response = requests.post(url, json=payload, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const payload = [
{
keyword: "logitech",
page_type: [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
internal_list_limit: 8,
positive_connotation_threshold: 0.5
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/content_analysis/summary/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: payload
})
.then((response) => {
// 输出返回结果
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});响应示例
json
{
"version": "0.1.20220913",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.0290 sec.",
"cost": 0.02003,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "content_analysis",
"function": "summary",
"keyword": "logitech",
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"internal_list_limit": 8,
"positive_connotation_threshold": 0.5
},
"result": [
{
"sentiment_connotations": {
"anger": 0,
"happiness": 22868,
"love": 175266,
"sadness": 12076,
"share": 0,
"fun": 1309
},
"connotation_types": {
"positive": 261992,
"negative": 68043,
"neutral": 108682
},
"text_categories": [
{
"count": 66122
},
{
"count": 62107
},
{
"count": 40433
},
{
"count": 25706
},
{
"count": 24088
},
{
"count": 21864
},
{
"count": 20646
}
],
"page_categories": [
{
"count": 14463
},
{
"count": 14017
},
{
"count": 13000
},
{
"count": 12041
},
{
"count": 11963
},
{
"count": 11938
},
{
"count": 7747
}
],
"page_types": {
"blogs": 60789,
"organization": 27201,
"news": 270865,
"message-boards": 33883,
"ecommerce": 314434
},
"countries": {
"US": 88807,
"UA": 58655,
"UN": 40394,
"DE": 30334,
"FR": 27221,
"JP": 24619,
"VN": 20387,
"PL": 19671
},
"languages": {
"en": 351137,
"ja": 97085,
"ru": 83271,
"vi": 54182,
"de": 53040,
"fr": 45802,
"es": 43180,
"pl": 21421
}
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整次请求的处理状态 tasks[].status_code表示单个任务的执行状态- 建议同时校验顶层状态码和任务状态码
- 错误码完整列表参考:
/v3/appendix/errors
常见处理建议:
- 当顶层
status_code不为20000时,优按请求级失败处理 - 当顶层成功但
tasks_error > 0时,需逐个检查tasks[] - 当
result_count = 0时,表示当前条件下没有可返回的摘要数据 - 使用
tag为任务打标,便于异步链路追踪、日志定位和业务对账
使用说明补
1. 精确短语匹
如果希望匹完整短语,而不是拆分后的独立,请使用带转义的双引号,例如:
json
[
{
"keyword": "\"tesla palo alto\""
}
]2. 限制聚合列表长度
如果只需要查看前几项国家、语言、分类或域名分布,可通过 internal_list_limit 控制返回规模,降低结果冗余。
3. 使用初始过滤条件缩小统计范围
initial_dataset_filters 可在摘要计算前过滤基础数据集,例如只统计特定标题、正文摘要、语言或搜索字段匹的数据。该能力适合做垂直主题、品牌语境或媒体类型下的局部分析。
实用场景
- 评估品牌声量:品牌词,快速查看该品牌在新闻、博客、电商等页面类型中的整体引用规模与分布,品牌评估。
- 判断舆倾向:结合
sentiment_connotations与connotation_types,识别某个品牌词或产品词的正负面绪结构,支持舆监测与预警。 - 筛选重点市场:根据
countries和languages分布,识别主要集中在哪些国家和语言环境,为 SEO 与区域投放提供依据。 - 识别阵地:通过
top_domains、page_types、page_categories判断主要出现在哪类网站和页面中,帮助制定外链或合作策略。 - 分析主题归类:基于
text_categories与page_categories了解所属主题,为策划、行业研究和竞品监测提供方向。