版本比较

密钥

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。
说明

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

创建任务

通过 createTask方法 创建识别任务

...

Use the createTask method to create a recognition task, and then use the getTaskResult method to retrieve the recognition result.

Create Task

Create a recognition task using the createTask method.

Request Nodes:

...

Request URL:
请求地址: https://api.yescaptcha.com/createTask

请求格式:Request Format:
POST application/json

...

Object Structure:

属性

Property

类型

Type

必须

Required

说明

Description

type

string

True

TurnstileTaskProxyless

状态
colourGreen
title15

点数

points

TurnstileTaskProxylessM1

状态
colourGreen
title30

点数

points

websiteURL

string

网页地址,一般固定值。

True

Web Address: Generally a fixed value.

websiteKey

String

网站密钥,一般固定值。

...

True

Site Key: Generally a fixed value.

Request Example

代码块
languagejson
{
    "clientKey":"cc9c18d3e263515c2c072b36a7125eecc078618f",
    "task":
    {
        "type":"TurnstileTaskProxyless",
        "websiteURL":"https://react-turnstile.vercel.app",
        "websiteKey":"1x00000000000000000000AA"
    }
}

...

Response Example

代码块
{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // 请记录此ID Please record this ID.
}

...

Get Result

使用 getTaskResult 方法获取识别结果

请求节点:

状态
colourGreen
title国际节点
Use the getTaskResult method to obtain the recognition result.

Request Nodes:

...

Request URL:
请求地址: https://api.yescaptcha.com/getTaskResult

请求格式:Request Format:
POST application/json

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

...

Depending on the system load, you will receive the result within a time interval of 10 to 80 seconds.

Request Example

代码块
{
    "clientKey":"cc9c18d3e263515c2c072b36a7125eecc078618f3",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

...

Response Result

参数

Property

类型

Type

说明

Description

errorId

Integer

错误提示:

Error Message:0 -

没有错误,1 - 有错误

No error,1 - Error occurred.

errorCode

string

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

Error Code

errorDescription

string

错误详细描述

Error Detailed Description

status

String

processing -

正在识别中,请3秒后重试

Recognition in progress, please try again in 3 seconds.
ready -

识别完成,在solution参数中找到结果

Recognition completed, find the result in the solution parameter.

solution

Object

识别结果,不同类型的任务结果会有所区别。

Identification results, different types of task results will be different.

gRecaptchaResponse

string

识别结果:response值。

一次性使用,有效期120s,建议在60s内使用。

...

Identification result: response value.

One-time use, valid for 120 seconds, recommended to use within 60 seconds.

Request Example

代码块
languagejson
{
    "errorId": 0,
    "errorCode": null,
    "errorDescription": null,
    "solution": {
        "token": "0.ufq5RgSVZd11DPSX1brdrxnEs28KcVlKj2ORchqxSy2q9yAW6ciq3hriXDF4x……",
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", 
    },
    "status": "ready"
}

响应说明

...

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

...

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

...

Response Description

  • Successful identification: When errorId is equal to 0 and status is equal to ready, the result is in solution.

  • Identifying: When errorId is equal to 0 and status is equal to processing, please try again after 3 seconds.

  • Error: When errorId is greater than 0, please understand the error information according to errorDescription All error descriptions