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
Properties | Type | Required | Description |
---|---|---|---|
type | String | Required | HCaptchaClassification |
queries | List[string] | Required | Base64 encoded image, do not include "data:image/***; base64," Assembles the picture as a list: [base64,base64,base64...] |
question | String | Required | English 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:
Type | Question | Description |
---|---|---|
![]() | Supported | Click the picture containing XXX |
![]() | Supported | Draw a box |
Example request
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "HCaptchaClassification",
// Upload the problem directly, support up to 18 pictures
"question": "Please click each image containing a truck",
"queries": [
"/9j/4AAQS.....",
"/9j/4AAQ1.....",
"/9j/4AAQ2.....",
"/9j/4AAQ3.....",
"/9j/4AAQ4.....",
]
}
}
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "HCaptchaClassification",
"question": "Please draw a box around the biggest cat",
// Draw Box recognition can only identify one picture every time
"queries": [
"base64",
],
}
}
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
],
"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,"queue-it.jpg")
with open(img_path,'rb') as f:
solution = capsolver.solve({
"type": "HCaptchaClassification",
"question": "Please click each image containing a truck",
"queries": [
"/9j/4AAQS.....",
"/9j/4AAQ1.....",
"/9j/4AAQ2.....",
"/9j/4AAQ3.....",
"/9j/4AAQ4.....",
]
})
print(solution)
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.