ReCaptchaV2Classification: reCaptcha V2 image recognition
This object will not return a RESPONSE, only image recognition results! Please avoid using it if you do not have integration capabilities.
We have provided a demonstration of simulated clicks using Python Selenium. Those with the ability can reference it for learning purposes.
The development difficulty of this interface is relatively high. We recommend that those who want to save time can install our browser extension to automatically click through instead. Click here.
Create Tasks
To create a recognition task using the createTask
method.
Request node: INTERNATIONAL NODE
https://api.yescaptcha.com
CHINA NODEhttps://cn.yescaptcha.com
Method address::
https://api.yescaptcha.com/createTask
Request format:
POST
application/json
Example Structure
Parameters | Type | Required | Purpose |
---|---|---|---|
type | string | Yes | ReCaptchaV2Classification |
image | string | Yes | The image encoded in Base64 should not include "data:image/***;base64," in the code. |
question | String | Yes | Please refer to the table to find the Problem ID, which starts with /m/. |
confidence | int | No | The confidence score of the result is optional, with a range of 0.0 indicating no match to 1.0 indicating a perfect match (the higher the score, the higher the match degree). The default value is empty. For Specifying this value is meaningless for Please see the explanation below for specific usage scenarios. |
Request Example
{
"clientKey": "cc9c18d3e263515c2c072b36a7125eecc078618f",
"task": {
"type": "ReCaptchaV2Classification",
"image": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDc....",
"question": "/m/0k4j"
}
}
Response Example
{
"errorId": 0,
"errorCode": "",
"errorDescription": "null",
"status": "ready",
"taskId": "3a9e8cb8-3871-11ec-9794-94e6f7355a0b",
"solution": {
"objects": [1,5,8], // The position where the image needs to be clicked.
"type": "multi"
}
}
The image format:
Standard Size 3x3: (300x300) 8 POINTS The image can be a screenshot:click on the corresponding position based on the returned results.
"solution": {
"objects": [0,2,6], // The position where the image needs to be clicked.
"type": "multi"
}
Standard Size 4x4: (450x450) 8 POINTS The image can be a screenshot:click on the corresponding position based on the returned results.
Standard Size 1x1: (100x100) 2 POINTS :
After selecting the 3x3 checkbox, if it is not an imageselect type, the small image will be refreshed.
The small image should be resized to 100x100 pixels and sent to the backend through the API. The API will return whether or not clicking is required.
"hasObject" represents whether or not clicking is required.
To find the Problem ID
ID Comparison Table: The Chinese translation is not an official translation from ReCaptcha, and is provided for reference only.
errorCodes
errorCode | errorDescription | Purpose |
---|---|---|
ERROR_INTERNAL_SERVER_ERROR | Internal server error | If the issue persists, please contact customer service |
ERROR_UNKNOWN_QUESTION | Incorrect question ID | Please check whether the question ID is correct |
ERROR_ILLEGAL_IMAGE | Image size does not meet the requirements | Please scale the image to the specified size: 450x450/300x300/100x100 |
ERROR_UNKNOW_450x450_QUESTION | This size is currently not supported for this question | The system may not be able to recognize images related to this question type. Please retry with other types of images |
ERROR_PARSE_IMAGE_FAIL | Failed to parse image | Please confirm whether the image BASE64 encoding is correct |
Here's the explanation for the "confidence" field:
For reCaptcha, there are three types of images to be recognized: 3x3, 4x4, and 1x1 image (which appears after clicking on a 3x3 grid image).
When developing for web, it is easy to obtain the 1x1 image, but for mobile developers, it may be inconvenient to capture the 1x1 image. Therefore, we provide a "confidence" field. When this field is included in the request for a 3x3 grid image, it will not return only the top three scoring results by default (as Google requires at least three clicks on the image targets), but will return all matching results that meet the specified confidence threshold. This makes it unnecessary to capture the 1x1 image separately, as the clicked positions can be obtained directly from the uploaded 3x3 grid image.
Using the image below as an example:
If we request to identify the car /m/0k4j, the default API will return three results.
Request Sample
Here's an example response, which returns the top three matching results: 1, 2, and 7.
If we add the "confidence" parameter with a value of 0.5 and send the request again...
We will get five results because all of them have a score of 0.5 or higher, due to the inclusion of the "confidence" parameter.
If there are no matching results, an empty array will be returned.
In this case, we can click again based on the results.
How to determine whether a screenshot is a 3x3 or 4x4 grid for image verification.
If the image processing is performed on a webpage, we can directly obtain the image and pass it to the API. The server will automatically determine the grid type based on the image size.
If we are dealing with a screenshot, it can be inconvenient to determine the grid type based on image size. In this case, we can determine the grid type based on the type of problem presented in the image.
3x3: Select all images with xxx
4x4:Select all squares with xxx