主题
content_analysis/phrase_trends/live
POST /v3/content_analysis/phrase_trends/live
#分析短语趋势实时接口
接口说明
该接口用于获取目标在指定时间范围的引用趋势数据每个时间分组中的引用总量、综合排名、热门域名、感倾向、文本分类、页面分类、页面类型、国家和语言分布等信息。
历史数据最早可追溯至 2022-10-31。
- 请求方式:
POST - 请求地址:
https://api.seermartech.cn/v3/content_analysis/phrase_trends/live - 请求体格式:JSON 数组
[{ ... }] - 频率限制:最高
2000次/分钟 - 支持能力:
- 指定返回时间范围
- 按天 / 周 / 月聚合
- 结果过滤
- 结果分组
- 结果排序
参考价约以响应中的 cost 字段为准;扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
以下为任务设置字段说明。
| 字段名 | 类型 | 说明 |
|---|---|---|
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 |
internal_list_limit | integer | 可选。限制数组中的最大数量。适用于:top_domains、text_categories、page_categories、countries、languages。默认值:1,最大值:20 |
date_from | string | 起始日期。填。格式:yyyy-mm-dd,示例:"2019-01-15" |
date_to | string | 结束日期。可选。未指定时默认使用当天日期。格式:yyyy-mm-dd |
date_group | string | 可选。时间聚合粒度。可选值:day、week、month。默认值:month |
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 支持 % 通任意长度字符串。更多过滤规则可参考过滤文档。 |
rank_scale | string | 可选。定义 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/phrase_trends/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-09-01",
"date_group": "month"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/phrase_trends/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
data = [
{
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-09-01",
"date_group": "month"
}
]
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",
date_from: "2022-09-01",
date_group: "month"
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/content_analysis/phrase_trends/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 | 通用状态码 |
status_message | string | 通用状态消息 |
time | string | 执行耗时,单位秒 |
cost | float | 本次请求总费用,单位 USD |
tasks_count | integer | tasks 数组中的任务数量 |
tasks_error | integer | 返回错误的任务数量 |
tasks | array | 任务结果数组 |
建议在接时对状态码和异常场景进行完整处理。错误码列表可参考
/v3/appendix/errors。
tasks[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态信息 |
time | string | 任务执行耗时,单位秒 |
cost | float | 任务费用,单位 USD |
result_count | integer | result 数组中的数量 |
path | array | 请求路径 |
data | object | 与请求体中提交的参数一致 |
result | array | 趋势结果数组 |
result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 content_analysis_trends |
date | string | 当前结果对应的日期 |
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/ 获取 |
响应示例
json
{
"version": "0.1.20220819",
"status_code": 20000,
"status_message": "Ok.",
"time": "19.4363 sec.",
"cost": 0.02009,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "content_analysis",
"function": "phrase_trends",
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-09-01",
"date_group": "month"
},
"result": [
{
"sentiment_connotations": {
"anger": 33,
"happiness": 32457,
"love": 4976,
"sadness": 290,
"share": 33841,
"fun": 1212
},
"connotation_types": {
"positive": 390289,
"negative": 135916,
"neutral": 589516
},
"page_types": {
"blogs": 622032,
"organization": 118086,
"news": 230980,
"message-boards": 18590,
"ecommerce": 96451
},
"countries": {
"US": 86504,
"WW": 56826,
"DE": 30522,
"IN": 21831,
"VN": 20049,
"AU": 19544,
"BR": 16685,
"JP": 16651,
"GB": 16405,
"ES": 15335
},
"languages": {
"en": 712751,
"ja": 114912,
"de": 63841,
"es": 60616,
"fr": 53833,
"it": 27394,
"vi": 23817,
"ru": 16528,
"pt": 11518,
"hu": 8393
}
},
{
"type": "content_analysis_trends",
"date": "2022-10-01",
"total_count": 1430023,
"rank": 613,
"sentiment_connotations": {
"anger": 9,
"happiness": 36007,
"love": 4062,
"sadness": 128,
"share": 52651,
"fun": 971
},
"connotation_types": {
"positive": 735206,
"negative": 175341,
"neutral": 468693
},
"page_types": {
"blogs": 809466,
"organization": 44189,
"news": 256351,
"message-boards": 26910,
"ecommerce": 137036
},
"countries": {
"BE": 344693,
"US": 90030,
"WW": 68847,
"DE": 42458,
"AU": 32590,
"VN": 24763,
"PL": 21004,
"IN": 19569,
"BR": 18502,
"MX": 14819
},
"languages": {
"en": 963542,
"ja": 112659,
"de": 82151,
"es": 80681,
"fr": 57705,
"vi": 33349,
"it": 25147,
"pl": 9751,
"nl": 6994,
"nb": 6684
}
},
{
"type": "content_analysis_trends",
"date": "2022-11-01",
"total_count": 130203,
"rank": 462,
"sentiment_connotations": {
"anger": 0,
"happiness": 6607,
"love": 236,
"sadness": 8,
"share": 4486,
"fun": 1595
},
"connotation_types": {
"positive": 76016,
"negative": 20227,
"neutral": 24780
},
"page_types": {
"blogs": 78908,
"organization": 6034,
"news": 18164,
"message-boards": 5147,
"ecommerce": 12120
},
"countries": {
"BE": 42874,
"WW": 9893,
"US": 5008,
"AU": 3524,
"DE": 1722,
"IN": 1630,
"PL": 1570,
"FR": 1482,
"MX": 1457,
"VN": 1441
},
"languages": {
"en": 90074,
"es": 7246,
"ja": 5861,
"de": 5095,
"pt": 4022,
"vi": 3981,
"fr": 3344,
"pl": 2044,
"it": 1927,
"nb": 1311
}
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求的处理状态 tasks[].status_code表示单个任务的执行状态- 建议同时校验:
- HTTP 状态码
- 顶层
status_code tasks_error- 每个任务的
tasks[].status_code
常见处理建议:
| 场景 | 建议 |
|---|---|
| HTTP 请求失败 | 重试或记录网络异常 |
status_code 非成功 | 按 /v3/appendix/errors 对应错误码处理 |
tasks_error 大于 0 | 遍历任务结果,定位失败任务 |
| 返回结果为空 | 检查、日期范围、过滤条件是否过严 |
| 数据量过大 | 使用 internal_list_limit 控制数组返回规模 |
使用说明补
1. 精确短语匹
如果希望匹完整短语而不是单独词项,请在 keyword 或 keyword_fields 中使用转义双引号,例如:
json
[
{
"keyword": "\"tesla palo alto\"",
"date_from": "2023-01-01",
"date_group": "month"
}
]2. 控制数组长度
如果只心每个时间点的前几个域名、分类或国家,可设置:
json
[
{
"keyword": "logitech",
"date_from": "2022-09-01",
"date_group": "month",
"internal_list_limit": 5
}
]3. 按域名去重统计
如果需要同一域名重复影响趋势判断,可设置:
json
[
{
"keyword": "logitech",
"search_mode": "one_per_domain",
"date_from": "2022-09-01",
"date_group": "month"
}
]实用场景
- 监控品牌声量变化:按月或按周跟踪品牌被网引用的数量与
rank变化,快速识别传播高峰和声量下滑时点。 - 分析舆绪结构:结合
sentiment_connotations和connotation_types判断在不同时间段的正负面绪变化,与品牌管理。 - 识别核心传播渠道:通过
top_domains、page_types观察是新闻站点、博客还是论坛在推动传播,优化投放策略。 - 发现重点国家与语言市场:利用
countries、languages识别在哪些地区和语种中更活跃,为 SEO 与本地化运营提供依据。 - 评估主题演变:通过
text_categories、page_categories查看在不同主题分类中的引用趋势,帮助调整选题方向与布局。