主题
SERP / Seznam / 语言列表
GET /v3/serp/wp/languages
接口说明
用于获取搜索引擎支持的语言列表。
注意:Seznam 搜索引擎支持捷语。
- 请求方式:
GET - 请求地址:
https://api.seermartech.cn/v3/serp/wp/languages
调用本接口后,服务端会返回 JSON 格式数据,响应中 tasks 数组,每个任务对象对应一次请求结果。
计费说明
本接口不收费。
- 参考价约
¥0.0000 / 次 - 实扣费以响应头
X-SeerMarTech-Charge-CNY为准
响应结构
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | API 当前版本 |
status_code | integer | 接口整体状态码 |
status_message | string | 接口整体状态信息 |
time | string | 执行耗时,单位:秒 |
cost | float | 本次请求总费用,单位:USD |
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 |
result_count | integer | result 数组中的数量 |
path | array | URL 路径 |
data | object | GET 请求 URL 中传的参数 |
result | array | 结果数组 |
result[] 字段说明
| 字段名 | 类型 | 说明 |
|---|---|---|
language_name | string | 语言名称 |
language_code | string | 语言代码,符合 ISO 639-1 标准 |
调用示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/serp/wp/languages" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/serp/wp/languages"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
data = response.json
print(data)TypeScript
typescript
import axios from "axios";
// 获取语言列表
axios({
method: "get",
url: "https://api.seermartech.cn/v3/serp/wp/languages",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
})
.then((response) => {
// 输出返回结果
console.log(response.data);
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "3.20191128",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1773 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "serp",
"function": "languages",
"se": "wp"
},
"result": []
}
]
}状态码说明
20000:请求成功- 状态码可参考
/v3/appendix/errors
使用说明
本接口主要用于在发起 SERP 请求前,确认指定搜索引擎支持哪些语言参数,因语言值不受支持而导致请求失败。
对于 Seznam 场景,需特别注意支持捷语,因此通常无需在多语言之间做额外筛选。
实用场景
- 校验语言参数:在提交 SERP 采集任务前查询可用语言,传无效语言代码导致请求报错。
- 限制前端选项:根据接口返回的语言列表动态生成语言下拉框,减少用户误选并提升提交成功率。
- 适多搜索引擎流程:在统一采集系统中,按不同搜索引擎读取支持语言范围,保证任务分发逻辑准确。
- 构建中心:将支持的语言列表同步到表,便于运营或分析团队复用标准参数。
- 优化 Seznam 采集策略:识别 Seznam 支持捷语的限制,提前约束任务创建逻辑,减少无效请求与排查成本。