主题
content_analysis/id_list
POST /v3/content_analysis/id_list
#分析任务 ID 列表
本接口使用 POST 方法,请求路径为:
/v3/content_analysis/id_list
用于查询指定时间范围创建的分析任务,返回任务 ID 及数据。结果同时已完成和未完成的任务。
> 注意: > > - 查询时间范围最长为当前时间往前 6 个月。 > - 当 include_metadata 设置为 true 时支持查询当前时间往前 1 个月创建的任务。 > - 每分钟最多调用 10 次。 > - 单次请求最多返回 1000 个任务 ID。 > - 本接口不收取调用费用。
请求地址
text
POST https://api.seermartech.cn/v3/content_analysis/id_list请求体使用 UTF-8 编码的 JSON 数组格式:
json
[
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": true
}
]请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
datetime_from | string | 是 | 任务创建时间的起始值。使用 UTC 时间格式:yyyy-mm-dd hh-mm-ss +00:00。当 include_metadata=true 时,最早只能查询当前时间往前 1 个月;当 include_metadata=false 时,最早可查询当前时间往前 6 个月。 |
datetime_to | string | 是 | 任务创建时间的结束值。不能晚于当前时间。使用 UTC 时间格式:yyyy-mm-dd hh-mm-ss +00:00。 |
limit | integer | 否 | 最多返回的任务数量。默认值为 1000,最大值为 1000。 |
offset | integer | 否 | 结果偏移量,默认值为 0。例如设置为 10,则跳过结果列表中的前 10 个任务。 |
sort | string | 否 | 按任务执行时间排序。可选值:asc、desc。默认值为 asc。 |
include_metadata | boolean | 否 | 是否在响应中返回任务数据。默认值为 false。 |
时间格式示例
text
2023-01-15 12:57:46 +00:00计费说明
本接口调用,不产生任务费用。
如业务链路中同时调用收费接口,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应结构
接口返回 JSON 数据 tasks 数组。
顶层响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。 |
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 | 任务 ID 列表及详细信息。 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID。 |
url | string | 创建该任务时使用的 API URL。 |
datetime_posted | string | 任务创建时间,使用 UTC 格式。 |
datetime_done | string | 任务完成时间,使用 UTC 格式。任务未完成时可能为空。 |
status | string | 任务状态说明。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
metadata | object | 创建任务时提交的参数在 include_metadata=true 时返回。 |
响应示例
json
{
"version": "0.1.20221214",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.2774 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "6f8c3f4a-0e9b-4f8d-9d8b-7a1f5f2d3c11",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1000 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"content_analysis",
"id_list"
],
"data": {
"api": "content_analysis",
"function": "id_list",
"datetime_from": "2023-01-11 00:00:00 +00:00",
"datetime_to": "2023-02-10 17:47:00 +00:00",
"limit": 100,
"sort": "desc",
"include_metadata": true
},
"result": [
{
"id": "8a1b2c3d-4e5f-6789-abcd-ef0123456789",
"url": "https://api.seermartech.cn/v3/content_analysis/summary",
"datetime_posted": "2023-01-15 12:57:46 +00:00",
"datetime_done": "2023-01-15 12:58:10 +00:00",
"status": "Ok.",
"cost": 0,
"metadata": {
"internal_list_limit": 8,
"positive_connotation_threshold": 0.5
}
}
]
}
]
}状态码
- 顶层
status_code用于表示本次请求的整体处理结果。 tasks[].status_code用于表示单个任务的处理结果。tasks_error表示任务结果中出现错误的数量。- 成功响应通常使用状态码
20000。 - 状态码和状态说明请参考错误码文档。
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/content_analysis/id_list" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": true
}
]'PHP
php
<?php
$apiUrl = 'https://api.seermartech.cn/v3/content_analysis/id_list';
$requestBody = json_encode([
[
'datetime_from' => '2023-01-31 00:00:00 +00:00',
'datetime_to' => '2023-02-01 00:00:00 +00:00',
'limit' => 100,
'offset' => 0,
'sort' => 'desc',
'include_metadata' => true
]
]);
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => $requestBody
]);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
print_r($result);TypeScript
typescript
import axios from "axios";
const requestBody = [
{
datetime_from: "2023-01-31 00:00:00 +00:00",
datetime_to: "2023-02-01 00:00:00 +00:00",
limit: 100,
offset: 0,
sort: "desc",
include_metadata: true
}
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/content_analysis/id_list",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
data: requestBody
})
.then((response) => {
// 处理响应数据
console.log(response.data);
})
.catch((error) => {
// 处理请求错误
console.error(error.response?.data || error.message);
});Python
python
import requests
url = "https://api.seermartech.cn/v3/content_analysis/id_list"
request_body = [
{
"datetime_from": "2023-01-31 00:00:00 +00:00",
"datetime_to": "2023-02-01 00:00:00 +00:00",
"limit": 100,
"offset": 0,
"sort": "desc",
"include_metadata": True
}
]
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.post(
url,
json=request_body,
headers=headers,
timeout=30
)
response.raise_for_status()
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败。状态码:%s,消息:%s"
% (result.get("status_code"), result.get("status_message"))
)C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class ContentAnalysisIdListExample
{
public static async Task Main()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Bearer",
"smt_live_YOUR_KEY"
);
var requestBody = new[]
{
new
{
datetime_from = "2023-01-31 00:00:00 +00:00",
datetime_to = "2023-02-01 00:00:00 +00:00",
limit = 100,
offset = 0,
sort = "desc",
include_metadata = true
}
};
var json = JsonSerializer.Serialize(requestBody);
using var content = new StringContent(
json,
Encoding.UTF8,
"application/json"
);
var response = await httpClient.PostAsync(
"https://api.seermartech.cn/v3/content_analysis/id_list",
content
);
var responseText = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<JsonElement>(responseText);
if (result.GetProperty("status_code").GetInt32() == 20000)
{
// 处理成功响应
Console.WriteLine(responseText);
}
else
{
var statusCode = result.GetProperty("status_code").GetInt32();
var statusMessage = result.GetProperty("status_message").GetString();
Console.WriteLine(
$"请求失败。状态码:{statusCode},消息:{statusMessage}"
);
}
}
}实用场景
- 检索指定时间范围的任务 ID,批量构建任务索引,便于后续查询、补偿和状态跟踪。
- 按执行时间倒序获取最近任务,快速定位最新提交的分析任务,提升运营排障效率。
- 使用分页参数遍历历史任务,在个月可查询范围分批同步任务记录,单次响应过大。
- 开启数据返回任务参数,核对历史任务的请求,为 SEO质量分析和结果复盘提供依据。
- 筛选未完成或异常任务,结合任务状态码识别需要重试或人工处理的任务,降低数据链路丢失风险。