主题
content_analysis/phrase_trends/live
POST /v3/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(UTF-8)
- 请求体格式:JSON 数组
- 单次 Live 请求最多 1 个任务 平台限流以认证说明中的 30/60/120 次/分钟规则为准
- 同时处理的请求数最多为 30 个
- 支持设置返回结果数量、筛选条件和排序方式
每个请求的任务参数都放在通用请求数组中,例如:
json
[
{
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-10-31",
"date_group": "month"
}
]计费说明
每次请求都会产生费用。参考价以本平台为准,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应中的 cost 字段(平台原始 USD 成本兼容字段)表示任务费用,币种和最终扣费请以响应头为准。
请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 目标。使用 UTF-8 编码。会被转换为小写。若要匹完整短语而不是独立,请使用双引号和反斜杠进行转义,例如:"\"tesla palo alto\""。 |
keyword_fields | object | 否 | 按指定字段中的筛选数据。可用字段:title、main_title、previous_title、snippet。可同时指定多个字段。匹完整短语时,同样需要使用双引号和反斜杠,例如:{"snippet": "\"logitech mouse\"", "main_title": "sale"}。 |
page_type | array | 否 | 按页面类型筛选数据。可选值:ecommerce、news、blogs、message-boards、organization。 |
search_mode | string | 否 | 结果分组方式。as_is:返回目标的引用;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。历史数据最早支持 2022-10-31。 |
date_to | string | 否 | 时间范围结束日期,格式为 yyyy-mm-dd。未指定时默认使用当天日期。 |
date_group | string | 否 | 结果的时间分组方式。可选值:day、week、month。默认值:month。 |
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 对象中,可用于请求和结果。 |
initial_dataset_filters 支持的运算符
支持以下运算符:
regex、not_regex、<、<=、>、>=、=、<>、in、not_in、like、not_like、has、has_not、match、not_match
使用 like 和 not_like 时,可使用 % 匹任意长度的字符串空字符串。
示例:
json
[
{
"keyword": "logitech",
"date_from": "2022-10-31",
"initial_dataset_filters": [
[
"and",
[
"page_type",
"in",
["blogs", "news"]
]
]
]
}
]筛选器的详细规则,请参考分析筛选器文档。
响应结构
接口返回 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 | 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_trends。 |
date | string | 当前结果对应的日期或时间分组起始日期。 |
total_count | integer | 与请求条件、且位于数据集中的结果总数。 |
rank | integer | 引用目标的 URL 的综合排名。该值为指定日期所有引用目标 URL 的排名总和归一化结果,取值范围受 rank_scale 影响。 |
top_domains | array | 引用目标的热门域名及各域名的引用数量。返回数量受 internal_list_limit 限制。 |
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 | 语言代码及对应引用数量。 |
text_categories、page_categories、top_domains 中的通常名称和数量字段,例如:
json
{
"category": "technology",
"count": 112695
}国家、语言和页面类型通常以键值对形式返回,例如:
json
{
"page_types": {
"blogs": 622032,
"organization": 118086,
"news": 230980,
"message-boards": 18590,
"ecommerce": 96451
},
"countries": {
"US": 86504,
"DE": 30522,
"IN": 21831
},
"languages": {
"en": 712751,
"ja": 114912,
"de": 63841
}
}请求示例
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-10-31",
"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",
}
payload = [
{
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-10-31",
"date_group": "month",
}
]
response = requests.post(url, headers=headers, json=payload, timeout=120)
if response.ok:
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
f"错误码:{result.get('status_code')},"
f"错误信息:{result.get('status_message')}"
)
else:
print(f"HTTP 错误:{response.status_code}")TypeScript
typescript
import axios from "axios";
const payload = [
{
keyword: "logitech",
search_mode: "as_is",
date_from: "2022-10-31",
date_group: "month",
},
];
axios
.post(
"https://api.seermartech.cn/v3/content_analysis/phrase_trends/live",
payload,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
const result = response.data;
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`错误码:${result.status_code},错误信息:${result.status_message}`
);
}
})
.catch((error) => {
console.error("请求失败:", error.message);
});响应示例
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": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "19.4363 sec.",
"cost": 0.02009,
"result_count": 1,
"path": [
"v3",
"content_analysis",
"phrase_trends",
"live"
],
"data": {
"api": "content_analysis",
"function": "phrase_trends",
"keyword": "logitech",
"search_mode": "as_is",
"date_from": "2022-10-31",
"date_group": "month"
},
"result": [
{
"type": "content_analysis_trends",
"date": "2022-11-01",
"total_count": 130203,
"rank": 462,
"top_domains": [
{
"domain": "example.com",
"count": 12500
}
],
"sentiment_connotations": {
"anger": 0,
"happiness": 6607,
"love": 236,
"sadness": 8,
"share": 4486,
"fun": 1595
},
"connotation_types": {
"positive": 76016,
"negative": 20227,
"neutral": 24780
},
"text_categories": [
{
"category": "technology",
"count": 42547
}
],
"page_categories": [
{
"category": "computers",
"count": 3444
}
],
"page_types": {
"blogs": 78908,
"organization": 6034,
"news": 18164,
"message-boards": 5147,
"ecommerce": 12120
},
"countries": {
"US": 5008,
"DE": 1722,
"IN": 1630
},
"languages": {
"en": 90074,
"es": 7246,
"ja": 5861
}
}
]
}
]
}错误处理
请根据顶层或任务级别的 status_code 和 status_message 判断请求是否成功:
20000:请求成功- 状态码:请求或任务处理异常
建议客户端同时检查:
- HTTP 响应状态;
- 顶层
status_code; tasks_error;- 每个任务的
status_code; X-SeerMarTech-Charge-CNY响应头,以确认扣费。
完整错误码请参考错误码文档。
实用场景
- 监测引用量趋势:按日、周或月统计品牌词、产品词的网引用变化,识别声量增长或下降节点。
- 分析品牌舆变化:结合
sentiment_connotations和connotation_types统计正面、负面及中性提及,为和策略提供依据。 - 定位高价值引用来源:通过
top_domains找出频繁提及目标的域名,支持外链拓展、媒体合作和竞品研究。 - 比较不同市场的覆盖:利用
countries和languages分析在国家及语言市场中的传播范围,化 SEO 和本地化运营。 - 评估渠道表现:根据
page_types、text_categories和page_categories对博客、新闻、电商及论坛等来源进行拆分,优化投放与选题规划。