主题
content_analysis/rating_distribution/live
POST /v3/content_analysis/rating_distribution/live
#分析:评分分布(实时)
本接口使用 POST 方法,路径为:
/v3/content_analysis/rating_distribution/live
用于根据指定及筛选条件,返回引用该的评分分布、感倾向、页面类型、国家/地区和语言等统计数据。
接口信息
- 请求方式:POST
- 接口地址:
https://api.seermartech.cn/v3/content_analysis/rating_distribution/live - 请求格式:JSON(UTF-8)
- 单次请求任务数:1
- 每分钟最大调用次数:以认证说明中的 30/60/120 次/分钟规则为准
- 最大并发调用数:30
- 请求体格式:JSON 数组,例如
[{ ... }]
计费说明
本接口按请求计费,参考价约 ¥0.1462 / 次。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求体中的每个数组代表一个任务。单次 Live 请求只能提交一个任务。
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 目标。使用 UTF-8 编码。会被转换为小写。若要匹完整短语而非独立,请使用双引号和反斜杠,例如:"\"tesla palo alto\""。 |
keyword_fields | object | 否 | 字段筛选条件。用于筛选指定字段中目标的数据。可用字段:title、main_title、previous_title、snippet。 |
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:返回目标的所有引用;one_per_domain:每个域名返回一个引用。默认值为 as_is。 |
positive_connotation_threshold | float | 否 | 正向感概率阈值,取值范围为 0 至 1,默认值为 0.4。设置后,响应中的 connotation_types 统计正向感概率大于或等于该阈值的引用。 |
sentiments_connotation_threshold | float | 否 | 感 connotation 概率阈值,取值范围为 0 至 1,默认值为 0.4。设置后,响应中的 sentiment_connotations 统计各感概率大于或等于该阈值的引用。 |
initial_dataset_filters | array | 否 | 初始数据集筛选条件,作用于搜索接口支持的字段。最多支持 8 个筛选条件,条件之间需要使用 and 或 or 连接。 |
rank_scale | string | 否 | rank 的计算和展示范围。one_hundred:0–100;one_thousand:0–1000。默认值为 one_thousand。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。该值会原样返回在响应任务的 data 对象中。 |
keyword_fields 示例
json
{
"keyword_fields": {
"snippet": "\"logitech mouse\"",
"main_title": "sale"
}
}initial_dataset_filters
该参数支持以下操作符:
regex、not_regex、<、<=、>、>=、=、<>、in、not_in、like、not_like、has、has_not、match、not_match
like 和 not_like 支持使用 % 匹任意长度的字符串。
筛选条件应使用嵌套数组表示,并在条件之间指定逻辑运算符 and 或 or。字段和筛选规则,请参考分析搜索接口的筛选条件说明。
请求示例
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",
}
payload = [
{
"keyword": "logitech",
"search_mode": "as_is",
"internal_list_limit": 10,
}
]
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",
search_mode: "as_is",
internal_list_limit: 10,
},
];
axios
.post(
"https://api.seermartech.cn/v3/content_analysis/rating_distribution/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 数据,顶层 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 | 请求路径信息。 |
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 | 引用目标的 URL 的综合排名,基于 URL 的排名归一化计算。 |
top_domains | array | 引用目标最多的域名及引用数量。 |
sentiment_connotations | object | 绪反应及对应的引用数量。可选绪 anger、happiness、love、sadness、share、fun。 |
connotation_types | object | 感极性及对应的引用数量。可选值 positive、negative、neutral。 |
text_categories | array | 文本类别及每个类别中的引用数量。 |
page_categories | array | 页面类别及每个类别中的引用数量。 |
page_types | object | 页面类型及每种类型的引用数量。 |
countries | object | 国家或地区代码及对应的引用数量。 |
languages | object | 语言代码及对应的引用数量。 |
top_domains、text_categories 和 page_categories素
json
{
"domain": "example.com",
"count": 25
}文本类别和页面类别对象通常:
| 字段 | 类型 | 说明 |
|---|---|---|
category | string | 类别名称。 |
count | integer | 该类别中的引用数量。 |
响应示例
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": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "16.8783 sec.",
"cost": 0.0203,
"result_count": 2,
"path": [
"v3",
"content_analysis",
"rating_distribution",
"live"
],
"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.1,
"max": 0.2,
"metrics": {
"type": "content_analysis_summary",
"total_count": 1840,
"rank": 270,
"top_domains": [
{
"domain": "example.com",
"count": 103
}
],
"sentiment_connotations": {
"anger": 5,
"happiness": 75,
"love": 0,
"sadness": 5,
"share": 38,
"fun": 6
},
"connotation_types": {
"positive": 280,
"negative": 648,
"neutral": 905
},
"text_categories": [
{
"category": "technology",
"count": 103
}
],
"page_categories": [
{
"category": "shopping",
"count": 15
}
],
"page_types": {
"blogs": 146,
"organization": 89,
"news": 8,
"message-boards": null,
"ecommerce": 445
},
"countries": {
"RO": 190,
"US": 90,
"PL": 32,
"WW": 30
},
"languages": {
"en": 1094,
"pl": 181,
"de": 141
}
}
}
]
}
]
}状态码与异常处理
建议客户端同时检查以下状态字段:
- 顶层
status_code - 任务级
tasks[].status_code - 对应的
status_message
当 status_code 不等于 20000 时,应记录错误码和错误信息,并根据业务需要执行重试、降级或告警处理。
实用场景
- 统计的评分区间分布,评估品牌或产品的整体评价结构,为优化和口碑管理提供依据。
- 对比正面、负面和中性引用数量,识别品牌舆倾向,制定 SEO和策略。
- 分析不同页面类型的覆盖,判断博客、新闻、电商页面或组织站点的贡献,优化渠道布局。
- 识别高频引用域名及来源国家/语言,发现重要外链、媒体和海外市场影响力,支持链接建设与 SEO 决策。
- 结合字段和初始数据集筛选条件,聚焦标题、摘要或指定页面类别中的,提高竞品和主题分析的准确性。