Skip to content
On this page
Home
>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!

The task type 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
select.pngPlease click each image containing a chair
choice.pngduck$penguin$shark$elephant
area.pngplease click on the panda

Example Request

txt
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
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

json
{
  "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

python
# 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)
go
package main

import (
	"fmt"
	capsolver_go "github.com/capsolver/capsolver-go"
	"log"
)

func main() {
	// first you need to install sdk
	//go get github.com/capsolver/capsolver-go
	//export CAPSOLVER_API_KEY='...' or
	//capSolver := CapSolver{ApiKey:"..."}

	capSolver := capsolver_go.CapSolver{}
	solution, err := capSolver.Solve(map[string]any{
		"type":     "HCaptchaClassification",
		"question": "Please click each image containing a truck",
		"queries": []string{
			"/9j/4AAQS.....",
			"/9j/4AAQ1.....",
			"/9j/4AAQ2.....",
			"/9j/4AAQ3.....",
			"/9j/4AAQ4.....",
		},
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}

Classification Support

Query interface, directly submit the whole sentence of the problem, if you encounter a new category, please contact customer service to add.

Because the HCaptcha is updated so frequently, the document no longer lists all the categories, and you just upload the questions you get from the web page.

If it is a new category, we will support it within 3 working days

If it's an existing category and it's just a different way of asking the question, we'll update it every day.