PerimeterX 任务
通过 createTask方法 创建识别任务,然后通过 getTaskResult 方法 获取识别结果
任务类型
对于PerimeterX 任务的解决方案,我们提供的任务类型如下:
任务类型 | 描述 | 价格(美元) |
|---|---|---|
PxCaptcha | PxCaptcha Press&Hold解决方案 | $2.0/1k |
PxInvisibleCaptcha | PxCaptcha 无感Cookie解决方案 | $0.5/1k |
创建任务
通过以下方法创建任务
请求host: https://api.ez-captcha.com
请求api: https://api.ez-captcha.com/createTask
请求format:POST application/json
参数
参数 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
clientKey | string | yes | 你的clientkey |
type | string | yes | PxCaptcha |
websiteKey | string | yes | 网站Key |
示例
POST https://api.ez-captcha.com/createTask
Content-Type: application/json
{
"clientKey": "YourClientKey",
"task": {
"type": "PxCaptcha",
"websiteKey": "PXxxxxxxx",
}
}返回示例
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // Please save this ID for next step
}获取结果
使用 getTaskResult 方法获取结果
请求 host: https://api.ez-captcha.com
请求 api: https://api.ez-captcha.com/getTaskResult
请求 format:POST application/json
请求示例
POST https://api.ez-captcha.com/getTaskResult
Content-Type: application/json
{
"clientKey":"YOUR_API_KEY",
"taskId": "TASKID OF CREATETASK" //ID created by createTask method
}返回参数
参数 | 类型 | 描述 |
|---|---|---|
errorId | Integer | 错误提示: 0 - 没有错误,1 - 有错误 |
errorCode | string | 错误代码, 点这里查看全部错误列表 |
errorDescription | string | 错误详细描述 |
status | String | processing - 正在识别中,请3秒后重试 |
solution | Object | 识别结果,不同类型的任务结果会有所区别。 |
返回示例
{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"_px3":"xxx",
"_pxvid": "xxx",
"_pxde":"xxxx",
},
"status": "ready"
}响应说明
识别成功:当
errorId等于0并且status等于ready,结果在solution里面。正在识别中:当
errorId等于0并且status等于processing,请1-3秒后重试。出错了:当
errorId大于0,请根据errorDescription了解出错误信息 全部错误说明