Application Process
To use the API, you need to first apply for the corresponding service on the hCaptcha Image Recognition API page. After entering the page, click the “Acquire” button, as shown in the image below:
If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.
There is a free quota available for first-time applicants, allowing you to use the API for free.
Basic Usage
First, understand the basic usage method, which is to input the hCaptcha verification image that needs to be processed to obtain the processed result. You need to simply pass aqueries field, which is the specific hCaptcha verification image. We need to capture this verification image from a website with hCaptcha verification; an example website link is: https://democaptcha.com/demo-form-eng/hcaptcha.html. Click the checkbox to display the complete verification image, as shown in the image below:

queries field is a screenshot of the verification image mentioned above. It is recommended that the image size does not exceed 100kb. You also need to take a screenshot of the area indicated by the red arrow in the image above, compress the image size, and convert it to Base64 encoding, as shown in the image below:

question related to the verification image. This supports translation in both Chinese and English, and you can directly input the relevant recognition content. From the content executed by the yellow arrow in the image above, the question input should be Please click on the UNIQUE object among the others. The specific content is as follows:

accept: the format of the response result you want to receive, here filled in asapplication/json, which is JSON format.authorization: the key for calling the API, which can be selected directly after application.
queries: a list of Base64 encoded verification images.question: the recognition content parameter related to the verification image, supporting direct input in Chinese and English.

solution, the verification result after processing the hCaptcha verification image task.label, the content recognized from the hCaptcha verification image.box, the location information of the recognition result of the hCaptcha verification image, which is composed of the coordinate information of the image.confidences, the confidence level of the recognition content satisfied after recognizing the hCaptcha verification image.
box position information of the result to pass the verification.
Next, we will introduce how to click based on the position information of the box in the result. First, establish a right-angle coordinate system for the uploaded verification image, where the center origin is at the lower left corner of the image. The value 360 corresponds to the horizontal coordinate, and 276 corresponds to the vertical coordinate. We only need to simulate a click at the coordinates corresponding to the verification code, as shown in the image below:

Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

