Guide
Task(Recognition)
Hcaptchaclassification

HCaptcha Images Recognize

WARNING

Create the task with the createTask.

This interface does not need to obtain the results separately, will synchronously return the image recognition results!

hCaptcha SERVICE INSTABILITY ANNOUNCEMENT

We apologize for the recent instability of the hCaptcha service caused by image updates and other issues. We deeply regret any inconvenience caused. If you encounter new images that render the service unavailable, please wait for us to update them. For any other questions, feel free to contact us at any time.

The task type is as follows

  • HCaptchaClassification

Create Task

Create the task with the createTask.

Task Object Structure

PropertiesTypeRequiredDescription
typeStringRequiredHCaptchaClassification
websiteURLStringOptionalPage source url to improve accuracy
websiteKeyStringOptionalWebsite key to improve accuracy
queriesList[string]RequiredBase64 encoded image, do not include “data:image/***; base64,”
Assembles the picture as a list: [base64,base64,base64…]
questionStringRequiredEnglish is supported only. Please convert other languages by yourself
WARNING

queries parameter image count description

select Sorting problem, only 18 images can be recognized at one time.

draw a box problem, only one image can be recognized at a time.

Supported Types

The supported image types are as follows:

TypeQuestion
hcap_select.pngPlease click each image containing a chair
hcap_choice.pngduck$penguin$shark$elephant
hcap_area.pngplease click on the panda

Example Request

POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "HCaptchaClassification",
    "websiteURL": "https://xxxx.com",
    "question": "Please click each image containing a chair",
    //    "question": "duck$penguin$shark$elephant",
    //    "question": "please click on the panda",
    "queries": [
      "/9j/4AAQS.....",
      "/9j/4AAQ1.....",
      "/9j/4AAQ2.....",
      "/9j/4AAQ3.....",
      "/9j/4AAQ4....."
    ]
  }
}

Example Response

{
  "errorId": 0,
  "errorCode": "",
  "status": "ready",
  "solution": {
    // Please click each response
    "objects": [
      true,
      false,
      false,
      true,
      true,
      false,
      true,
      true
    ],
    // Please draw a box response
    "box": [
      //x1
      198.2198,
      //y1
      629.8307,
      //x2
      851.69403,
      //y2
      817.2047
    ],
    "tags": [
      "duck",
      "penguin",
      "shark",
      "elephant",
    ],
    "imageSize": [
      //height,width
      1072,
      1000
    ]
  },
  "taskId": "5aa8be0c-94a5-11ec-80d7-00163f00a53c"
}

Use SDK Request

# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'
 
import capsolver
 
# capsolver.api_key = "..."
img_path = os.path.join(Path(__file__).resolve().parent, "chair.jpg")
with open(img_path, 'rb') as f:
    solution = capsolver.solve({
        "type": "HCaptchaClassification",
        "question": "Please click each image containing a chair",
        "queries": [
            "/9j/4AAQS.....",
            "/9j/4AAQ1.....",
            "/9j/4AAQ2.....",
            "/9j/4AAQ3.....",
            "/9j/4AAQ4.....",
        ]
    })
    print(solution)