Grid CAPTCHA
Send separate tile images or one complete grid and get back the selected tile numbers.
Use this for challenges that ask the user to select matching squares from a tiled image.
01 / Prepare
Prepare the input
Choose one input mode: an array of separate tiles, or one image containing the whole grid. For separate tiles, send the top row first, from left to right. A 3 by 3 grid needs exactly 9 images. The instruction describes what the selected tiles must contain.
Each task reserves $0.015 from your wallet. Successful tasks cost 1.5 times the provider cost; unused reserved credit is returned. Failed tasks are not charged. Billing details
- Tile numbering starts at 1 in the top-left tile and moves left to right.
- Separate images are assembled left to right, then top to bottom. A returned click value of 1 refers to images[0], 2 to images[1], and so on.
- Tiles are fitted into equal square cells without cropping, with white padding when needed. The assembled JPEG is limited to 1000px per side and 600 KB.
- You can still send a complete grid using image. The provider receives one assembled image in either mode; returned click indexes are not x/y coordinates.
- Use canNoAnswer only when the challenge may genuinely contain no matching tile.
For the complete examples, prepare tile-1.png, tile-2.png, tile-3.png, tile-4.png, tile-5.png, tile-6.png, tile-7.png, tile-8.png, tile-9.png. You can change these filenames in the code.
02 / Request
Request parameters
/api/v1/captcha/tasksSend the JSON object directly, without a task wrapper. Set kind to grid. All fields below belong to the JSON body.
Required headers
Authorizationstringrequired- Bearer followed by your ScrapingBuddy API key. Keep it on your server.
Content-Typestringrequired- application/json.
Idempotency-KeyUUID v4required- Retain one generated UUID per new task. Do not submit the same task concurrently.
kindstringrequired- Always grid.
imagestring- One complete grid as a Base64 JPEG, PNG, or GIF image, or data URL. Up to 600 KB and 1000px on either side. Provide image or images, not both.
imagesstring[]- Alternative to image. Ordered tile images, exactly rows multiplied by columns. Each JPEG, PNG, or GIF may be up to 600 KB and 1000px per side; combined file size must not exceed 3 MB. Base64 and data URLs are supported.
commentstring- Describe which tiles should be selected. Required unless imgInstructions is provided.
imgInstructionsstring- Optional Base64 instruction image or data URL, up to 100 KB. Provide comment, imgInstructions, or both. This is not another grid tile.
rowsintegeroptional- Grid rows. Defaults to 3 and accepts 2 to 6.
columnsintegeroptional- Grid columns. Defaults to 3 and accepts 2 to 6.
minClicksintegeroptional- Minimum selections, 1 to rows multiplied by columns. Default: 1.
maxClicksintegeroptional- Maximum selections, at least minClicks and at most the tile count. Default: rows multiplied by columns.
canNoAnswerbooleanoptional- Allow a No_matching_images answer when no tile matches. Default: false.
Decoded file limits use 1 KB = 1,000 bytes. The complete JSON payload must fit within 5,000,000 bytes after Base64 encoding.
03 / Result
Understand the result
Creation returns HTTP 201. Fetching the task returns HTTP 200. Both wrap the task in task; always check its status before reading the solution.
The result is a list of tile numbers, not pixel coordinates. Numbering starts at 1. With click: [4, 5, 8], choose the first and second cells of row two, and the second cell of row three. Subtract 1 only when looking up an item in a zero-based programming array.
solution.clickinteger[]- One-based tile numbers, left to right and then top to bottom. [4, 5, 8] selects three tiles, not pixel coordinates.
solutionobject- With canNoAnswer enabled, handle a No_matching_images answer as no selection, not a tile index.
Shared task fields
idUUID- Save this ID to fetch the task or contact support.
statusstring- submitting or processing: wait. ready: use solution. failed: stop and read the error.
solutionobject | null- Null until a result is available. The shape depends on the CAPTCHA type.
errorCode / errorDescriptionstring | null- Task failure details. A failed task can still arrive with HTTP 200 or 201.
coststring | null- Provider-reported USD cost; not the customer debit.
chargedecimal string- Actual customer charge in USD: provider cost multiplied by 1.5. Zero before settlement or for legacy tasks.
billingStatusstring- reserved, charged, released, awaiting_credit, review, or legacy. A review requires support; awaiting_credit needs a top-up.
solveCountnumber | null- Provider-reported solving attempts when available.
createdAt / updatedAt / completedAttimestamp | null- Task timestamps; completedAt is null until the task has finished.
comment / requestMetastring / object- Saved instructions and input metadata. Raw files are not returned.
04 / Integrate
Complete examples
These Node.js and Python scripts prepare the input, create one task and poll until it is ready or failed. They stop waiting after approximately 3 minutes. A client timeout does not cancel the task.
- Set
SCRAPINGBUDDY_API_KEYin your server environment. - Place the input files beside your script, or update the filenames.
- For Node.js, use version 20+ and save as
solve.mjs. For Python, installrequestsand save assolve.py. - Run the script and retain the printed request and task IDs.
cURL shows task creation only. Use the GET example to retrieve its result.
When something goes wrong
Check whether you received an HTTP error or a task with status: failed. Fix validation errors before retrying. For HTTP 429, pause for Retry-After; all requests share the account limit of 60 per minute.
If creation times out, do not automatically submit another task. Keep your request ID and check the existing task or Usage first.