打码服务 / hCaptcha(自带代理)
hCaptcha(自带代理)
协议接口 ·
HCaptchaTaskhCaptcha + 自带代理。参数与不带代理版一致,多一组代理字段。
需要 rqdata 的站点(企业版 hCaptcha)也走这一档。
请求
POST /v1/captcha/solve?timeout=180
Authorization: Bearer arp_xxx
Content-Type: application/json请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | string | 是 | 固定填 HCaptchaTask |
websiteURL | string | 是 | 验证码所在页面的完整地址 |
websiteKey | string | 是 | hCaptcha 的 site key(UUID 形式) |
userAgent | string | 否 | 与真实请求一致的 UA |
isInvisible | boolean | 否 | 隐形挂件传 true |
rqdata | string | 否 | 企业版要求的 rqdata,照页面抄 |
proxyType | string | 是 | http / https / socks5 |
proxyAddress | string | 是 | 代理主机名或 IP |
proxyPort | integer | 是 | 代理端口 |
proxyLogin | string | 否 | 代理用户名(有认证才填) |
proxyPassword | string | 否 | 代理密码 |
只传上表列出的参数即可,认证由网关自动处理。
请求示例
{
"type": "HCaptchaTask",
"websiteURL": "https://example.com/login",
"websiteKey": "10000000-ffff-ffff-ffff-000000000001",
"proxyType": "http", "proxyAddress": "proxy.example.net", "proxyPort": 3000,
"proxyLogin": "user-region-US-sid-abc-t-30", "proxyPassword": "secret"
}响应示例
{ "ok": true, "ready": true, "token": "P1_eyJ0eXAiOiJKV1Qi...", "price": 30, "balance": 970 }怎么取结果:取
token,塞进表单的 h-captcha-response。完整调用
curl -X POST 'https://api.xiaobaicap.com/v1/captcha/solve?timeout=180' \
-H "Authorization: Bearer arp_xxx" \
-H 'Content-Type: application/json' \
-d '{
"type": "HCaptchaTask",
"websiteURL": "https://example.com/login",
"websiteKey": "10000000-ffff-ffff-ffff-000000000001",
"proxyType": "http", "proxyAddress": "proxy.example.net", "proxyPort": 3000,
"proxyLogin": "user-region-US-sid-abc-t-30", "proxyPassword": "secret"
}'
import requests
r = requests.post(
"https://api.xiaobaicap.com/v1/captcha/solve",
headers={"Authorization": "Bearer arp_xxx"},
params={"timeout": 180},
json={
"type": "HCaptchaTask",
"websiteURL": "https://example.com/login",
"websiteKey": "10000000-ffff-ffff-ffff-000000000001",
"proxyType": "http", "proxyAddress": "proxy.example.net", "proxyPort": 3000,
"proxyLogin": "user-region-US-sid-abc-t-30", "proxyPassword": "secret"
},
timeout=200,
)
d = r.json()
if not d.get("ok"):
raise SystemExit(d)
print(d.get("token") or d.get("text") or d.get("objects"))注意事项
- 出口要粘性。
- 与不带代理版同价。
错误
失败时返回 502,积分全额退回,可以安全重试:
{"error":"识别失败,已全额退回 10 积分:...","code":"mint_failed"}
| code | 含义 | 处理 |
|---|---|---|
insufficient_credits | 积分不足(402,未扣费) | 充值后重试 |
bad_request | 参数不合法或类型不支持(400) | 对照上方参数表改 |
mint_failed | 识别失败(502,已退回) | 退避 2~3 秒重试 |
rate_limited | 触发限流(429) | 按 Retry-After 退避 |