Vision Engine
WARNING
Create the task with the createTask.
This interface does not need to obtain the results separately, will directly return the image recognition results!
The task type
field is as follows
VisionEngine
Create Task
Create the task with the createTask.
Task Object Structure
Note that this type of task returns the task execution result directly after createTask, rather than getting it asynchronously through getTaskResult.
Properties | Type | Required | Description |
---|---|---|---|
type | String | Required | VisionEngine |
module | String | Required | All supported models are shown in the table below |
websiteURL | String | Optional | Page source url to improve accuracy |
image | String | Required | base64 encoded content of the image (no newlines, no data:image/***;charset=utf-8;base64,) |
imageBackground | String | Required | base64 encoded content of the background image (no newlines, no data:image/***;charset=utf-8;base64,) |
question | String | Optional | space_detection requires |
SUPPORT IMG TYPES
module | Captcha Example | image | imageBackground |
---|---|---|---|
slider_1 | ![]() | ![]() | ![]() |
rotate_1 | ![]() | ![]() | ![]() |
space_detection | ![]() | ![]() |
Example Request
Example request using slider module
text
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "VisionEngine",
"module": "slider_1",
"image": "/9j/4AAQSkZJRgABA......",
"imageBackground": "/9j/4AAQSkZJRgABA......",
"websiteURL": "https://xxxx.com"
}
}
Example Response using slider module
json
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"status": "ready",
"solution": {
"distance": 213,
},
"taskId": "..."
}
Example request using rotate module
text
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "VisionEngine",
"module": "rotate_1",
"image": "/9j/4AAQSkZJRgABA......",
"imageBackground": "/9j/4AAQSkZJRgABA......",
"websiteURL": "https://xxxx.com"
}
}
Example Response using rotate module
json
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"status": "ready",
"solution": {
"angle": 154,
},
"taskId": "..."
}
Example request using space_detection module
text
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "VisionEngine",
"module": "space_detection",
"image": "/9j/4AAQSkZJRgABA......",
"question": "Please click on the unique object",
"websiteURL": "https://xxxx.com"
}
}
Example Response using space_detection module
json
{
"errorId": 0,
"errorCode": "",
"errorDescription": "",
"status": "ready",
"solution": {
"box": [163.5, 107.5]
},
"taskId": "..."
}
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, "queue-it.jpg")
with open(img_path, 'rb') as f:
solution = capsolver.solve({
"type": "VisionEngine",
"module": "slider_1",
"image": "/9j/4AAQSkZJRgABA......",
"imageBackground": "/9j/4AAQSkZJRgABA......"
})
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": "VisionEngine",
"module": "slider_1",
"image": "/9j/4AAQSkZJRgABA......",
"imageBackground": "/9j/4AAQSkZJRgABA......"
})
if err != nil {
log.Fatal(err)
return
}
fmt.Println(solution)
}