打码服务 / Cloudflare 5 秒盾

Cloudflare 5 秒盾

协议接口  ·  CloudFlareTaskS2

Cloudflare Challenge 的解法,返回 cf_clearance 之类的 cookie。

这个类型返回的是 cookie 而不是 token —— 你拿到 cf_clearance 后把它加进后续请求的 Cookie 头里即可。必须自带代理:Cloudflare 的 cookie 和出口 IP 强绑定,所以这个代理必须和你后面发请求用的是同一个。

Checking your browser before accessing example.com DDoS protection by Cloudflare
整站被 Cloudflare 拦下时出现的 interstitial 页。过掉之后拿到的是 cookie,不是 token。

请求

POST /v1/captcha/solve?timeout=180
Authorization: Bearer arp_xxx
Content-Type: application/json

请求参数

参数类型必填说明
typestring是固定填 CloudFlareTaskS2
websiteURLstring是目标页面地址
proxystring是必填。你的代理,格式 http://user:pass@ip:port
userAgentstring否与真实请求一致的 User-Agent
waitLoadboolean否是否等页面完全加载(更慢但内容更全)
requiredCookiesarray否要求返回的 cookie 名,如 ["cf_clearance"]

只传上表列出的参数即可,认证由网关自动处理。

请求示例

{
  "type": "CloudFlareTaskS2",
  "websiteURL": "https://example.com/",
  "proxy": "http://user:pass@1.2.3.4:8080",
  "requiredCookies": ["cf_clearance"]
}

响应示例

{
  "ok": true, "ready": true, "price": 10, "balance": 930,
  "solution": { "cookies": { "cf_clearance": "abc123..." }, "user_agent": "Mozilla/5.0 ..." },
  "cookies": { "cf_clearance": "abc123..." }
}
怎么取结果:取 cookies,把 cf_clearance 放进后续请求的 Cookie 头。

完整调用

curl -X POST 'https://api.xiaobaicap.com/v1/captcha/solve?timeout=180' \
  -H "Authorization: Bearer arp_xxx" \
  -H 'Content-Type: application/json' \
  -d '{
         "type": "CloudFlareTaskS2",
         "websiteURL": "https://example.com/",
         "proxy": "http://user:pass@1.2.3.4:8080",
         "requiredCookies": ["cf_clearance"]
       }'
import requests

r = requests.post(
    "https://api.xiaobaicap.com/v1/captcha/solve",
    headers={"Authorization": "Bearer arp_xxx"},
    params={"timeout": 180},
    json={
  "type": "CloudFlareTaskS2",
  "websiteURL": "https://example.com/",
  "proxy": "http://user:pass@1.2.3.4:8080",
  "requiredCookies": ["cf_clearance"]
},
    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 退避