Bounding Box Method
The method can be used to solve tasks where you need to select a specific object or draw a box around an object shown on an image.
Supported image formats: JPEG, PNG, GIF
Max file size: 600 kB
Max image size: 1000px on any side
BoundingBoxTask task type specification
Property | Type | Required | Description |
---|---|---|---|
type | String | Yes | BoundingBoxTask |
body | String | Yes | Image encoded into Base64 format. Data-URI format (containing data:content/type prefix) is also supported |
comment | String | Yes* | A comment will be shown to workers to help them to solve the captcha properly. The comment property is required if the imgInstructions property is missing. |
imgInstructions | String | Yes* | An optional image with instruction that will be shown to workers. Image should be encoded into Base64 format. Max file size: 100 kB. The imgInstructions property is required if the comment property is missing. |
canNoAnswer | Integer | No | 0 - not specified 1 - possibly there's no objects that fit the instruction. Set the value to 1 only if it's possible that there's no objects matching the instruction. We'll provide a button "No matching images" to worker and you will receive No_matching_images as answer. |
Request example
Method: createTask
API endpoint: https://api.2captcha.com/createTask
{
"clientKey":"YOUR_API_KEY",
"task": {
"type":"BoundingBoxTask",
"body":"/9j/4AAQSkZJRgABAQAAAQ..HIAAAAAAQwAABtbnRyUkdCIFhZ.wc5GOGSRF//Z",
"comment":"draw a tight box around the green apple"
}
}
Response example
Method: getTaskResult
API endpoint: https://api.2captcha.com/getTaskResult
{
"errorId": 0,
"status": "ready",
"solution": {
"bounding_boxes": [
{
"xMin": 310,
"xMax": 385,
"yMin": 231,
"yMax": 308
}
]
},
"cost": "0.0012",
"ip": "1.2.3.4",
"createTime": 1692863536,
"endTime": 1692863556,
"solveCount": 1
}