主题
错误码附录
概述
本接口用于返回平台 API 的通用错误信息与状态码列表。你可以通过它获取:
- HTTP 响应码说明
- API 响应中的
status_code - 对应的
status_message - 错误码与错误消息映射表
建议在业务系统中记录错误码、状态消息及请求上下文,并建立统一的异常处理机制,便于排障、重试和告警。
说明:
- 除少数外,平台 API 通常会返回 HTTP
200- 更的执行结果,请以响应体中的
status_code和status_message为准status_message可能会根据触发场景附带更多说明,因此同一状态码下的消息文本可能存在扩展
HTTP 响应码
| Code | Message | 说明 |
|---|---|---|
401 | Unauthorized | 无权访问该资源,请检查认证信息 |
402 | Payment Required | 账户计费失败或余额不足,请检查账户余额 |
404 | Not Found | 请求的接口不存在 |
500 | Internal Server Error | 服务器错误,暂时无法处理请求,请稍后重试 |
##部状态码与消息
以下状态码通常出现在 API 响应体中的 status_code 和 status_message 字段。
| Code | Message | 说明 |
|---|---|---|
20000 | Ok. | 请求已成功完成 |
20100 | Task Created. | 请求成功,任务已创建 |
40000 | You can set only one task at a time. | 单次 POST 数组中只能提交一个任务 |
40001 | This id is used by another client, check the id. | 任务 id 已被客户端占用 |
40002 | This id is used by another search engine, check the Path. | 任务 id 与 URL 路径中的搜索引擎不匹 |
40003 | This id is used by another search type, check the Path. | 任务 id 与 URL 路径中的搜索类型不匹 |
40004 | This id is used by another function, check the id. | 任务 id 与 URL 路径中的功能类型不匹 |
40006 | You can set no more than 100 tasks at a time. | 单次 POST 最多提交 100 个任务 |
40100 | You are not authorized to access this resource. | 认证失败,请检查密钥或权限 |
40101 | Internal SE server error. | 请求的搜索引擎侧处理失败 |
40102 | No Search Results. | 未找到符合条件的搜索结果 |
40103 | Task execution failed, please try to resubmit the task. | 任务执行失败,建议重新提交 |
40104 | Please verify your account before using the API. | 使用 API 前需完成账户验证 |
40200 | Payment Required. | 余额不足,请后重试 |
40201 | We noticed some unusual activity in your account... | 检测到账户异常活动,接口访问被临时暂停 |
40202 | The rate-limit per minute has been exceeded. | 出每分钟请求限制 |
40203 | The cost limit has been exceeded. | 出账户设置的成本上限 |
40204 | Access denied. | 当前接口无访问权限,通常与订或套餐限制 |
40205 | The duplicate task limit per hour has been exceeded. | 出每小时重复任务限制 |
40206 | The duplicate task limit per day has been exceeded. | 出每日重复任务限制 |
40207 | Access denied. Your IP is not whitelisted. | 当前 IP 未白名单 |
40209 | Too many simultaneous queries. | 并发请求过多,单用户同时请求上限为 30 |
40210 | Insufficient Funds. Your account’s balance is too low to complete this request. | 账户余额不足,无法完成本次请求 |
40400 | Not found. | 请求资源不存在,请检查 URL |
40401 | Task Not Found. | 指定任务不存在 |
40402 | Invalid Path. | 请求路径无效 |
40403 | Results Expired. | 任务结果已过期,通常无法获取一个月前的结果 |
40404 | No Prepared Data Found.Please Contact Our Support Team. | 沙箱中没有与该任务匹的预置数据 |
40405 | Textual content on the target page is insufficient. | 目标页面文本不足,建议更换页面 |
40406 | Requested page was not submitted for crawling. | 目标页面未在任务提交时抓取范围 |
40407 | Duplicate Host. | 请求中存在重复主机 |
40408 | Target URL is invalid. | 目标 URL 无效,或目标站点返回 404 |
40501 | Invalid Field. | POST 请求中的某个字段无效 |
40502 | POST Data Is Empty. | POST 请求体为空 |
40503 | POST Data is Invalid. | POST 请求体结构不合法 |
40504 | The number of intersecting keywords for the specified domains exceeds 10 million. Try specifying different domains. | 指定域名的交叉数量 1000 万,建议更换域名组合 |
40505 | You are using old data. | 使用了过期的位置参数,请更新参数 |
40506 | Unknown Fields in POST Data. | POST 请求体未知字段,请核对接口文档 |
40601 | Task Handed. | 任务已接收,但尚未处理队列 |
40602 | Task in Queue. | 任务已处理队列 |
50000 | Internal Error. | 平台异常,请联系技术支持 |
50001 | Error While Checking the Balance. | 余额检查失败,请联系技术支持 |
50100 | Not Implemented. | 指定了不存在的任务或参数 |
50301 | 3rd Party API Service Unavailable. | 第三方数据源暂时不可用,错误消息可能因平台服务而变化 |
50303 | Update is in progress. Please try after a few minutes | 接口正在更新,请稍后重试 |
50304 | This function is temporarily unavailable. Please contact support for more information. | 当前功能暂时不可用 |
50401 | Internal Error – Timeout. | 实时模式任务在 120 秒未完成处理 |
50402 | Target page took too long to respond. | 目标页面响应时间过长, 50 秒 |
接口信息
请求方式: GET请求地址: https://api.seermartech.cn/v3/appendix/errors
该接口返回可用错误码及描述信息。
计费说明
本接口不收费。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应结构
接口返回 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 | 任务数组 |
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 | array | 与请求参数对应的数据 |
result | array | 返回结果数组 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 错误码 |
message | string | 错误消息 |
请求示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/appendix/errors" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/appendix/errors"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
result = response.json
if result.get("status_code") == 20000:
print(result)
else:
print(f'error. Code: {result.get("status_code")} Message: {result.get("status_message")}')TypeScript
typescript
import axios from "axios";
axios({
method: "get",
url: "https://api.seermartech.cn/v3/appendix/errors",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
})
.then((response) => {
// 返回结果
console.log(response.data);
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "0.1.20260525",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0843 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "appendix",
"function": "errors"
},
"result": []
}
]
}错误处理建议
在接本接口及 /v3/... 端点时,建议采用以下处理策略:
- 优判断 HTTP 状态码
- 若为
401、402、404、500,处理认证、余额、路径或服务异常问题
- 再判断响应体中的
status_code
- 即使 HTTP 为
200,任务依然可能失败 - 应始终校验顶层和任务级
status_code
- 记录完整上下文
- 记录请求路径、请求参数、时间、任务 ID、
status_code、status_message - 便于后续重试与问题定位
- 建立可恢复重试机制
- 对
50301、50303、50401、50402等临时性错误可采用指数退避重试 - 对参数错误、权限错误、余额不足等问题不建议盲目重试
- 区分错误与临时错误
- 永错误如
40402、40501、40503 - 临时错误如
50301、50303、50401
实用场景
- 统一映射错误码:将平台错误码同步到系统,建立标准错误字,便于前后端和运维统一识别问题。
- 设计自动重试策略:基于
50301、50401等状态码区分可重试场景,减少瞬时障对采集任务的影响。 - 监控账户与权限异常:针对
40100、40200、40207等状态码告警,及时发现认证失效、余额不足或白名单问题。 - 优化任务提交流程:通过识别
40000、40006、40503等请求错误,提前在客户端校验参数,降低无效请求比例。 - 构建运营分析报表:统计不同错误码的发生频率,分析失败原因分布,持续优化 SEO 数据采集稳定性。