约定
所有求解接口共用同一套 JSON 外壳。厂商差异只出现在 POST /v1/solve/:type 的请求参数和成功时的 data。
Base URL
text
https://api.hitcaptcha.com下文路径均相对该根地址。本地自建可用 {BASE} 自行替换。
接口一览
| 方法 | 路径 | 鉴权 | 说明 |
|---|---|---|---|
| GET | /health | 否 | 探活 |
| GET | /v1/solvers | 是 | 可用厂商列表 |
| POST | /v1/solve/:type | 是 | 求解 |
type 目前为 akamai / kasada / datadome / reese84(小写)。未知或不支持的 type 返回 NOT_FOUND。
鉴权方式见 鉴权。
Content-Type
请求体必须是 JSON 对象,大小上限 2MB:
http
Content-Type: application/json数组、空 body、非对象会 INVALID_INPUT。
成功
json
{
"ok": true,
"type": "kasada",
"data": {},
"cost_ms": 123,
"charged_points": 2,
"balance_points": 998
}| 字段 | 类型 | 说明 |
|---|---|---|
ok | boolean | 恒为 true |
type | string | 路径里的厂商 |
data | object | 厂商结果,见各厂商页 |
cost_ms | number | 服务端耗时(毫秒) |
charged_points | number | 本次扣点(若有计费) |
balance_points | number | 扣费后余额(若有计费) |
失败
HTTP 状态码随错误变化;body 形状固定:
json
{
"ok": false,
"type": "kasada",
"error": { "code": "TIMEOUT", "message": "kasada timeout after 90000ms" },
"cost_ms": 90001
}| 字段 | 类型 | 说明 |
|---|---|---|
ok | boolean | 恒为 false |
type | string | null | 能解析到 type 时带回,否则 null |
error.code | string | 见 错误码 |
error.message | string | 可读原因 |
cost_ms | number | null | 已开始计时则有值 |
未预期异常不会把内部 stack 返回给调用方,统一成 INTERNAL。