主题
content_analysis/summary/live
POST /v3/content_analysis/summary/live
#分析摘要实时接口
本接口通过 POST /v3/content_analysis/summary/live 获取目标的引用数据摘要引用来源域名、感倾向、文本类别、页面类别、页面类型、国家和语言分布等信息。
每次请求最多提交 1 个任务。平台限流以认证说明中的 30/60/120 次/分钟规则为准,同时进行的请求数最多为 30。所有 POST 请求体使用 UTF-8 编码的 JSON 数组格式。
计费说明
本接口按请求计费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体是 JSON 数组:
json
[
{
"keyword": "logitech",
"page_type": [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization"
],
"internal_list_limit": 8,
"positive_connotation_threshold": 0.5
}
]任务参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 目标。使用 UTF-8 编码。平台会将转换为小写格式。<br><br>如需匹完整短语,而不是独立,请使用双引号和反斜杠,例如:"keyword": "\"tesla palo alto\""。 |
keyword_fields | object | 否 | 指定需要匹的字段,用于按过滤数据。支持的字段:title、main_title、previous_title、snippet。<br><br>可同时指定多个字段。例如:<br>{"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。<br><br>默认值:1;最大值:20。 |
positive_connotation_threshold | float | 否 | 正面感概率阈值,取值范围为 0 至 1。设置后,响应中的 connotation_types 只统计正面感概率大于或等于该阈值的引用。<br><br>默认值:0.4。 |
sentiments_connotation_threshold | float | 否 | 感细分类别的概率阈值,取值范围为 0 至 1。设置后,响应中的 sentiment_connotations 只统计每种感概率大于或等于该阈值的引用。<br><br>默认值:0.4。 |
initial_dataset_filters | array | 否 | 在初始数据集阶段应用的过滤条件。过滤字段与 /v3/content_analysis/search/live 接口一致。<br><br>最多可同时设置 8 个过滤条件,并需要在条件之间指定逻辑运算符 and 或 or。支持的运算符:regex、not_regex、<、<=、>、>=、=、<>、in、not_in、like、not_like、has、has_not。<br><br>like 和 not_like 支持使用 % 匹零个或多个字符。 |
rank_scale | string | 否 | 指定 rank 字段的计算和展示范围。<br><br>one_hundred:按 0–100 展示;<br>one_thousand:按 0–1000 展示。<br><br>默认值:one_thousand。 |
tag | string | 否 | 用户自定义的任务标识,最长 255 个字符。可用于识别任务并与响应结果。提交的值会原样返回在响应的 data 对象中。 |
keyword_fields 示例
json
{
"keyword_fields": {
"snippet": "\"logitech mouse\"",
"main_title": "sale"
}
}initial_dataset_filters 示例
过滤条件的字段应符合分析搜索接口支持的字段定义。示例:
json
{
"initial_dataset_filters": [
["page_type", "=", "news"],
"and",
["title", "like", "%logitech%"]
]
}响应字段
接口返回 JSON 对象 tasks 数组。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 | 请求 URL 路径。 |
data | object | 本次请求中提交的任务参数。 |
result | array | 任务结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 content_analysis_summary。 |
total_count | integer | 数据库中与请求条件的结果总数。 |
rank | integer | 引用目标的 URL 的排名汇总值,即所有引用目标 URL 的排名归一化总和。 |
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, 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 payload = [
{
keyword: "logitech",
page_type: [
"ecommerce",
"news",
"blogs",
"message-boards",
"organization",
],
internal_list_limit: 8,
positive_connotation_threshold: 0.5,
},
];
axios
.post(
"https://api.seermartech.cn/v3/content_analysis/summary/live",
payload,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.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": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.9500 sec.",
"cost": 0.02003,
"result_count": 1,
"path": [
"v3",
"content_analysis",
"summary",
"live"
],
"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": [
{
"type": "content_analysis_summary",
"total_count": 1,
"rank": 0,
"top_domains": [],
"sentiment_connotations": {
"anger": 0,
"happiness": 22868,
"love": 175266,
"sadness": 12076,
"share": 0,
"fun": 1309
},
"connotation_types": {
"positive": 261992,
"negative": 68043,
"neutral": 108682
},
"text_categories": [
{
"category": "technology",
"count": 66122
},
{
"category": "business",
"count": 62107
}
],
"page_categories": [
{
"category": "computer_hardware",
"count": 14463
},
{
"category": "consumer_electronics",
"count": 14017
}
],
"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 和 status_message 判断请求是否成功。建议为以下设计异常处理机制:
- HTTP 请求失败;
- 顶层
status_code不等于20000; tasks_error大于0;- 单个任务的
status_code不等于20000; - 响应缺少
tasks或result字段。
完整错误码列表请参考 /v3/appendix/errors。
实用场景
- 分析品牌的感分布,统计正面、负面和中性引用数量,为品牌口碑监测和提供依据。
- 识别主要引用来源域名,定位高频提及目标的网站,为外链拓展、媒体合作和品牌评估提供线索。
- 拆分在不同页面类型中的引用占比,比较新闻、博客、电商和论坛等渠道的表现,优化投放策略。
- 对比不同国家和语言市场的引用,发现本地化 SEO 的重点市场和语言机会。
- 按文本类别与页面类别聚合引用数据,判断的主题领域,选题、专题规划和搜索意图分析。