BoundingBoxRecognition
Get a bounding box drawn around an object in an image. Covers the request schema, an example and each provider's price per 1,000.
BoundingBoxRecognition asks a worker to draw a box around a specific object in an image and returns the box coordinates. Use it for CAPTCHAs that ask for an object to be selected or outlined.
What the image should contain
Send the whole CAPTCHA image as base64 in imageBase64. A data-URI prefix is removed for you. Limits documented by providers:
| Limit | Value |
|---|---|
| Formats | JPEG, PNG, GIF |
| Size | 600 kB maximum, and 1000 px on any side (2Captcha) |
| Scaling | Anti-Captcha downscales images larger than 500 px on a side in the worker interface, so keep the image small when you can |
Tell the worker what to box
Send comment, imgInstructions, or both. The worker needs at least one of them to know which object to box.
commentis a text instruction such asdraw a tight box around the green apple. English has the widest provider support.imgInstructionsis a base64 instruction image of up to 100 kB, for an instruction that is itself a picture. Not every provider supports it, and those that do not ignore it.canNoAnswerset totruelets the worker answer that nothing matches. Set it only when the image may contain no matching object. Not every provider supports it.
Read the answer
boundingBoxes is a list of boxes. Each has xMin, yMin, xMax and yMax, in pixels from the top-left corner of the image you sent. To click the box centre, use (xMin + xMax) / 2 and (yMin + yMax) / 2.
Check Provider stats for live success rates and solve times before you pick a provider.
Supported Providers
| Provider | Price per 1,000 | Routing |
|---|---|---|
2Captcha | $1.20 | |
Anti-Captcha | $2.00 |
Request Schema
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in a workspace of the AnySolver dashboard. Example: |
task* | object | Yes | The task body. Required fields depend on the task type. See Tasks for per-task schemas. View task properties |
settings | object | No | Per-request settings for routing, Auto Retry, Auto Fallback, proxy reuse, response statistics and detailed analytics. Each field overrides the API key's value. See Routing modes. View settings reference |
Task Object Properties
The task field accepts an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
type* | Yes | ||
imageBase64* | string | Yes | Base64-encoded JPEG, PNG or GIF image to draw boxes on. A data URI prefix is stripped automatically. Keep it under 600 kB and 1000 px per side; some providers downscale anything wider than 500 px. Example: |
comment | string | No | Instruction shown to the worker, for example "draw a tight box around the green apple". Send this or imgInstructions; use English for the widest provider support. Example: |
imgInstructions | string | No | Base64-encoded instruction image (max 100 kB) shown to the worker. Send this or comment. Not every provider supports it; those that do not ignore it. Example: |
canNoAnswer | boolean | No | Set true when the image may contain no matching object, so the worker can answer that nothing matches instead of guessing. Not every provider supports it. Example: |
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "BoundingBoxRecognition",
"imageBase64": "/9j/4AAQSkZJRgABAQAAAQ..HIAAAAAAQwAABtbnRyUkdCIFhZ.wc5GOGSRF//Z"
}
}Optional fields are not guaranteed across providers
Response Schema
| Field | Type | Required | Description |
|---|---|---|---|
status* | Yes | Task status: "processing", "ready", or "failed". Example: | |
errorId* | Yes |
Example: | |
taskId | string | No | Unique identifier returned when the task was created. Example: |
errorCode | No | Machine-readable error code. Example: | |
errorDescription | string | No | Human-readable error message with resolution hints. Example: |
cost | number | No | Actual cost charged for this task in USD. Example: |
taskType | No | The type of CAPTCHA task to solve. Example: | |
provider | No | Provider that handled this task. While processing, the provider currently solving it. Example: | |
solution | object | No |
Solution Object Properties
The solution field contains an object with the following properties:
| Field | Type | Required | Description |
|---|---|---|---|
boundingBoxes* | object[] | Yes | Boxes drawn around the matching objects, in pixels relative to the top-left corner of the image. Example: |
raw* | Record<string, unknown> | Yes | Raw provider response data for advanced use cases. |