跳转到主要内容

简介

hCaptcha 是 Ace Data Cloud 提供的验证码服务,hCaptcha 解决方案。通过 Ace Data Cloud 统一 API,你可以使用 cURL 快速调用 hCaptcha,实现hCaptcha Token 获取、hCaptcha 图片识别等功能。

前置条件

  • 拥有 Ace Data Cloud 账号并获取 API Token
  • 安装了 cURL 的终端环境

基础用法

调用 hCaptcha API 的主端点为:
POST https://api.acedata.cloud/captcha/token/hcaptcha
完整 cURL 命令示例:
curl -X POST https://api.acedata.cloud/captcha/token/hcaptcha \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"website_key": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", "website_url": "https://accounts.hcaptcha.com/demo"}'
请将 YOUR_API_TOKEN 替换为你在 Ace Data Cloud 平台获取的实际 Token。

响应示例

成功调用后返回 JSON 格式数据,例如:
{
  "status": "success",
  "data": {
    ...
  }
}

使用 jq 处理响应

推荐使用 jq 工具格式化输出:
curl -s -X POST https://api.acedata.cloud/captcha/token/hcaptcha \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"website_key": "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2", "website_url": "https://accounts.hcaptcha.com/demo"}' | jq .

错误处理

常见错误码:
状态码说明
401认证失败,请检查 API Token
403余额不足或无权访问
429请求频率超限
500服务器内部错误

下一步