主题
按 ID 获取 Seznam 自然搜索结果(常规)
GET /v3/serp/seznam/organic/task_get/regular/{id}
接口说明
HTTP 方法: GET
接口路径: /v3/serp/seznam/organic/task_get/regular/$id
根据任务 ID 获取 Seznam 自然搜索结果。任务 ID 为 UUID 格式,可在任务发布后的 30 天重复查询结果。
text
GET https://api.seermartech.cn/v3/serp/seznam/organic/task_get/regular/{id}本接口为查询接口,无需提交请求体。任务发布接口的 POST 请求体使用 JSON 数组格式:
json
[
{
"keyword": "cnn news"
}
]计费说明
- 在发布任务时计费。
- 任务结果可在 30 天查询。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务发布后 30 天可使用该 ID 查询结果。 |
响应说明
接口返回 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 | 请求 URL 路径信息。 |
data | object | 发布任务时提交的参数。 |
result | array | SERP 结果数组。 |
result 结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 发布任务时提交的。返回值会对 URL 编码进行解码,+ 会被解码为空格。 |
type | string | 发布任务时指定的搜索引擎类型。 |
se_domain | string | 发布任务时指定的搜索引擎域名。 |
location_code | integer | 发布任务时指定的地区代码。 |
language_code | string | 发布任务时指定的语言代码。 |
check_url | string | 对应的搜索结果页 URL,可用于验证返回结果的准确性。 |
datetime | string | 获取结果的 UTC 日期和时间,格式为 yyyy-MM-dd HH:mm:ss +00:00。 |
spell | object | 搜索引擎自动纠错信息。 |
refinement_chips | object | 搜索细化选项。当前固定为 null。 |
item_types | array | 当前 SERP 中出现的结果类型。 |
se_results_count | integer | SERP 中的结果总数。 |
pages_count | integer | 已抓取的结果页数量。 |
items_count | integer | items 数组中的结果数量。 |
items | array | SERP 结果项数组。 |
spell 字段
当搜索引擎对进行了自动纠错时返回该对象。
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 搜索引擎纠正后的,结果对应纠正后的。 |
type | string | 自动纠错类型。可能值:did_you_mean、showing_results_for、no_results_found_for、including_results_for。 |
item_types 可能值
item_types 会列出返回的 SERP 中出现的所有结果类型,可能:
imageslocal_packorganicrelated_searchestop_storiesfeatured_snippetvideo
本接口返回 organic 类型的结果。如需获取 SERP 中的结果类型、SERP 特征和富摘要,请使用 Seznam 自然搜索高级结果接口:
text
/v3/serp/seznam/organic/task_get/advanceditems 中的自然结果字段
每个自然搜索结果对象的类型为 organic_element_in_serp。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 结果类型,固定为 organic。 |
rank_group | integer | 同类型结果中的分组排名。不同类型结果之间的间隔不会计该字段。 |
rank_absolute | integer | 在整个 SERP 中的绝对排名。 |
page | integer | 该结果所在的搜索结果页码。 |
domain | string | 结果所属域名。 |
title | string | 搜索结果标题。 |
description | string | 搜索结果描述。 |
url | string | 搜索结果对应 URL。 |
breadcrumb | string | 搜索结果面屑路径。 |
请求示例
cURL
bash
id="09171517-0696-0242-0000-a96bc1ad0bce"
curl --location --request GET \
"https://api.seermartech.cn/v3/serp/seznam/organic/task_get/regular/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "09171517-0696-0242-0000-a96bc1ad0bce"
url = (
"https://api.seermartech.cn"
f"/v3/serp/seznam/organic/task_get/regular/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
response.raise_for_status()
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败:",
result.get("status_code"),
result.get("status_message"),
)TypeScript
typescript
const taskId = "02201650-1073-0066-2000-1d132bb28897";
const response = await fetch(
`https://api.seermartech.cn/v3/serp/seznam/organic/task_get/regular/${taskId}`,
{
method: "GET",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
const result = await response.json();
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`请求失败:${result.status_code} ${result.status_message}`
);
}PHP
php
<?php
$taskId = '09171517-0696-0242-0000-a96bc1ad0bce';
$url = 'https://api.seermartech.cn'
. '/v3/serp/seznam/organic/task_get/regular/'
. $taskId;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
if (($result['status_code'] ?? null) === 20000) {
print_r($result);
} else {
echo '请求失败:'
. ($result['status_code'] ?? 'unknown')
. ' '
. ($result['status_message'] ?? '');
}响应示例
json
{
"version": "0.1.20220428",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1045 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "09171517-0696-0242-0000-a96bc1ad0bce",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0912 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"serp",
"seznam",
"organic",
"task_get",
"regular"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "seznam",
"se_type": "organic",
"language_code": "cs",
"location_code": 2203,
"keyword": "cnn news",
"tag": "some_string_123",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "cnn news",
"type": "organic",
"se_domain": "seznam.cz",
"location_code": 2203,
"language_code": "cs",
"check_url": "https://search.seznam.cz/?q=cnn%20news",
"datetime": "2019-11-15 12:57:46 +00:00",
"spell": null,
"refinement_chips": null,
"item_types": [
"organic",
"related_searches"
],
"se_results_count": 100000,
"pages_count": 1,
"items_count": 10,
"items": [
{
"type": "organic",
"rank_group": 1,
"rank_absolute": 1,
"page": 1,
"domain": "example.com",
"title": "示例搜索结果标题",
"description": "示例搜索结果描述。",
"url": "https://example.com/cnn-news",
"breadcrumb": "example.com > news"
}
]
}
]
}
]
}处理建议
- 使用
tasks[].status_code判断任务是否成功。 - 当
tasks[].result为空或任务状态码表示错误时,应读取status_message并执行重试或异常处理。 - 通过
check_url对搜索结果页,验证返回数据是否符合预期。 - 任务结果保留 30 天,建议在获取后及时持化排名和 SERP 数据。
- 生产环境应同时处理 HTTP 错误、顶层
status_code错误和任务级状态码错误。
实用场景
- 监控自然排名:定期获取 Seznam 的自然结果排名,评估 SEO 优化效果和排名波动。
- 分析竞争对手可见度:提取竞争页面的标题、描述、域名和排名,比较不同网站在目标中的。
- 验证搜索结果采集质量:结合
check_url与返回的 SERP 项目进行抽样校验,及时发现地区、语言或设备参数问题。 - 构建排名历史库:按、地区和语言保存每日结果,为排名趋势分析和 SEO 报告提供数据基础。
- 识别 SERP 结果类型:利用
item_types判断目标是否图片、视频、搜索等结果类型,制定和 SERP 优化策略。