主题
content_analysis/rating_distribution/live
POST /v3/content_analysis/rating_distribution/live
#分析-评分分布实时接口
接口说明
该接口用于返回指定及筛选条件下的评分分布数据。你可以基于在库中的引用结果,查看不同评分区间的量、绪倾向、页面类型、国家、语言、分类等统计信息。
- 请求方式:
POST - 接口地址:
https://api.seermartech.cn/v3/content_analysis/rating_distribution/live
计费说明
该接口按请求计费。
参考价:原文未提供固定单价,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求说明
- 所有 POST 数据均需使用
JSON格式(UTF-8 编码) - 请求体为 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" |
internal_list_limit | integer | 可选。限制数组返回数量。适用于:top_domains、text_categories、page_categories、countries、languages。默认值:1;最大值:20 |
search_mode | string | 可选。结果分组方式。可选值:as_is 表示返回目标 keyword 的引用;one_per_domain 表示每个域名返回一条引用。默认值:as_is |
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、match、not_match。 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 | URL 路径 |
data | object | 与请求中提交的参数一致 |
result | array | 结果数组 |
result 数组字段
每个代表一个评分区间的统计结果。
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 content_analysis_rating_distribution |
min | float | 当前评分区间的最小值 |
max | float | 当前评分区间的最大值 |
metrics | object | 当前评分区间下的统计指标 |
metrics 字段说明
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 类型,固定为 content_analysis_summary |
total_count | integer | 与请求条件匹的总结果数 |
rank | integer | 所有引用目标 keyword 的 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/rating_distribution/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "logitech",
"search_mode": "as_is",
"internal_list_limit": 10
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/rating_distribution/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
data = [
{
"keyword": "logitech",
"search_mode": "as_is",
"internal_list_limit": 10
}
]
response = requests.post(url, json=data, headers=headers)
print(response.json)TypeScript
typescript
import axios from "axios";
const postData = [
{
keyword: "logitech",
search_mode: "as_is",
internal_list_limit: 10,
},
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/content_analysis/rating_distribution/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
{
"version": "0.1.20220819",
"status_code": 20000,
"status_message": "Ok.",
"time": "16.8783 sec.",
"cost": 0.0203,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "content_analysis",
"function": "rating_distribution",
"keyword": "logitech",
"search_mode": "as_is",
"internal_list_limit": 10
},
"result": [
{
"type": "content_analysis_rating_distribution",
"min": 0.0,
"max": 0.1,
"metrics": {
"sentiment_connotations": {
"anger": 0,
"happiness": 18,
"love": 0,
"sadness": 0,
"share": 0,
"fun": 2
},
"connotation_types": {
"positive": 51,
"negative": 32,
"neutral": 67
},
"page_types": {
"blogs": 35,
"organization": null,
"news": 1,
"message-boards": null,
"ecommerce": 61
},
"countries": {
"DE": 56,
"US": 5,
"WW": 1
},
"languages": {
"de": 175,
"en": 14
}
}
},
{
"type": "content_analysis_rating_distribution",
"min": 0.1,
"max": 0.2,
"metrics": {
"type": "content_analysis_summary",
"total_count": 1840,
"rank": 270,
"sentiment_connotations": {
"anger": 5,
"happiness": 75,
"love": 0,
"sadness": 5,
"share": 38,
"fun": 6
},
"connotation_types": {
"positive": 280,
"negative": 648,
"neutral": 905
},
"page_types": {
"blogs": 146,
"organization": 89,
"news": 8,
"message-boards": null,
"ecommerce": 445
},
"countries": {
"RO": 190,
"US": 90,
"PL": 32,
"WW": 30,
"DE": 26,
"FR": 18,
"UA": 17,
"GR": 13,
"GB": 12,
"AR": 9
},
"languages": {
"en": 1094,
"pl": 181,
"de": 141,
"nl": 68,
"ro": 65,
"ru": 59,
"es": 55,
"it": 44,
"fr": 41,
"vi": 32
}
}
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求的执行状态 tasks[].status_code表示单个任务的处理状态- 建议在接时同时处理:
- HTTP 状态码异常
- 顶层
status_code非成功 tasks_error大于0- 单任务
status_code非成功
常见成功状态:
| 状态码 | 说明 |
|---|---|
20000 | 请求成功 |
完整错误码与状态说明请参考 /v3/appendix/errors。
使用建议
- 当你希望查看某个在库中的评分分层表现时,优使用本接口。
- 如需控制结果中的域名、分类、国家、语言返回数量,可设置
internal_list_limit。 - 如需去重分析,可将
search_mode设为one_per_domain,同一域名多次引用造成偏差。 - 若你只心高置信度绪结果,可结合
positive_connotation_threshold和sentiments_connotation_threshold缩小统计范围。 - 若需要按页面属性、标题、摘要等条件过滤,再统计评分分布,可使用
keyword_fields或initial_dataset_filters。
实用场景
- 评估品牌口碑结构:按查看不同评分区间的正负绪分布,快速识别品牌在生态中的口碑层级。
- 筛选高质量来源:结合
top_domains、page_types、rank,定位高评分区间中最有价值的来源与站点类型。 - 分析地区与语言差异:通过
countries和languages查看不同市场中同一的评分分布,为 SEO 与区域传播提供依据。 - 识别分类机会:利用
text_categories与page_categories观察高评分集中在哪些主题类别,指导选题布局与生产。 - 监控绪变化趋势:针对品牌词、产品词或活动词周期性请求该接口,比较各评分区间的绪极性变化,及时发现舆风险或增长机会。