Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

通过 createTask方法 创建识别任务,然后通过 getTaskResult 方法 获取识别结果

如果你获得了无效的token,请联系我们,通常在我们优化之后都可以正常工作

任务类型

任务类型

描述

价格

价格(美元)

HcaptchaTaskProxyless

HCaptcha 解决方案,使用服务器内置代理

9 POINTS

$0.9/1k

创建任务

通过 createTask方法 创建识别任务

请求节点: https://api.ez-captcha.com

请求地址: https://api.ez-captcha.com/createTask

请求格式:POST application/json

对象结构

属性

类型

必须

说明

clientKey

string

您账号的用户密钥

type

string

任务类型: HcaptchaTaskProxyless

websiteURL

string

使用Funcaptcha的网页地址,一般固定值。

websiteKey

string

使用Funcaptcha网站密钥,固定值。

enterprisePayload

object

HCaptcha企业版额外参数,目前仅支持rqdata (beta版本):

"enterprisePayload": {"rqdata": "xxxxxxxxx"}

isInvisible

Bool

HCaptcha类型是否为invisible

请求示例

POST https://api.ez-captcha.com/createTask
Content-Type: application/json

{
  "clientKey": "7e5ffc29e3354a19991002f2a19978bb696679",
  "task": {
    "websiteURL": "https://discord.com/register",
    "websiteKey": "4c672d35-0701-42b2-88c3-78380b0db560",
    "type": "HcaptchaTaskProxyless"
  }
}

响应示例

{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // 请记录此ID
}

获取结果

使用 getTaskResult 方法获取识别结果

请求节点: https://api.ez-captcha.com

请求地址: https://api.ez-captcha.com/getTaskResult

请求格式:POST application/json

根据系统负载,您将在大约 10s 到 20s 的时间间隔内得到结果

请求示例

POST https://api.ez-captcha.com/getTaskResult
Content-Type: application/json
 
{
    "clientKey":"YOUR_API_KEY",
    "taskId": "TASKID OF CREATETASK" //由createTask方法创建的ID
}

响应结果

参数

类型

说明

errorId

Integer

错误提示: 0 - 没有错误,1 - 有错误

errorCode

string

错误代码,🔗 点这里查看全部错误列表

errorDescription

string

错误详细描述

status

String

processing - 正在识别中,请1秒后重试
ready - 识别完成,在solution参数中找到结果

solution

Object

识别结果,不同类型的captcha的结果会有所区别,对于Funcaptcha而言,结果为对象中的token。

solution.token

string

识别结果:token值,用于POST或模拟提交给目标网站。

一次性使用,建议获取后立即使用。

响应示例

{
    "errorId": 0,
    "solution": {
        "token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.hKdwY......"
    },
    "status": "ready"
}

 

响应说明

  • 识别成功:当errorId等于0 并且status等于 ready,结果在solution里面。

  • 正在识别中:当errorId等于0 并且status等于 processing,请1秒后重试。

  • 出错了:当errorId 大于0,请根据errorDescription了解出错误信息 🔗 全部错误说明

  • No labels