Skip to content

reCAPTCHA v2 image recognition

ReCaptchaV2Classification recognizes the image challenges of reCAPTCHA v2: send the image and the question ID, and get back which tiles to click; your code does the clicking in the browser. It does not return a token. It is synchronous (one createTask request returns the result); a 3x3 or 4x4 image costs 6 points (¥0.006), and a 1x1 tile costs less (see the table).

POSThttps://api.yescaptcha.com/createTaskGlobal endpoint
POSThttps://cn.yescaptcha.com/createTaskChina endpoint
Task typePriceModeNotes
ReCaptchaV2Classification6 points (¥0.006)Synchronous2 points for a 1x1 tile (100x100); 6 points for 3x3 (300x300) and 4x4 (450x450)
FieldTypeRequiredDescription
typestringYesTask type; see "Task types and pricing" on this page
imagestringYesBase64-encoded challenge image without the data: prefix
questionstringYesQuestion ID such as /m/0k4j; see "Question IDs" on this page
confidencenumberNoConfidence threshold from 0 to 1, only used for 3x3 images. If set (0.5 is a good start), every tile above it is returned; if omitted, the top 3 tiles are returned

Scale the image to a standard size; the server determines the challenge type from it:

Challenge Image size Returns
3x3 grid (“Select all images with …”) 300 × 300 objects: tiles to click
4x4 grid (“Select all squares with …”) 450 × 450 objects: tiles to click
1x1 tile (a single replacement image after clicking in a 3x3 grid) 100 × 100 hasObject: whether to click it

With screenshots, tell them apart by the wording: 3x3 says “Select all images with …”, 4x4 says “Select all squares with …”.

POST https://api.yescaptcha.com/createTask
{
"clientKey": "YOUR_CLIENT_KEY",
"task": {
"type": "ReCaptchaV2Classification",
"image": "BASE64_IMAGE",
"question": "/m/0k4j"
}
}

3x3 and 4x4:

{
"errorId": 0,
"status": "ready",
"solution": { "objects": [1, 5, 8], "type": "multi" },
"taskId": "3a9e8cb8-3871-11ec-9794-94e6f7355a0b"
}

1x1 tile:

{ "errorId": 0, "status": "ready", "solution": { "hasObject": true, "type": "single" } }
FieldTypeDescription
objectsarrayIndexes of the tiles to click, starting at 0, left to right and top to bottom
hasObjectbooleanReturned for a 1x1 tile; whether the tile contains the target
typestringChallenge type: multi (3x3 or 4x4 image, see objects), single (1x1 tile, see hasObject); drag for hCaptcha drag questions

Tiles are numbered from 0, left to right and top to bottom:

Tile numbers 0 to 8 of a 3x3 grid

Tile numbers 0 to 15 of a 4x4 grid

confidence: get every matching tile at once

Section titled “confidence: get every matching tile at once”

After you click a 3x3 grid, reCAPTCHA usually fades in new 1x1 tiles that also need checking. If those are hard to capture (for example in mobile apps), send confidence:

  • Without it, a 3x3 image returns the 3 highest-scoring tiles (reCAPTCHA requires at least 3 clicks).
  • With it (try 0.5), every tile scoring above the value is returned, which may be more or fewer than 3; an empty array if none match. You no longer need to send the 1x1 tiles.
  • It has no effect on 4x4 and 1x1 images.

question is the question ID (starting with /m/), not the question text. The ID comes with the image in the response of the request reCAPTCHA uses to load the challenge (reload or userverify). Common questions:

16 in total
Question IDQuestion (English)
/m/0pg52taxis
/m/01bjvbus
/m/04_svmotorcycles
/m/013xlmtractors
/m/01jk_4chimneys
/m/014xcscrosswalks
/m/015qfftraffic lights
/m/0199gbicycles
/m/015qbpparking meters
/m/0k4jcars
/m/015krbridges
/m/019jdboats
/m/0cdl1palm trees
/m/09d_rmountains or hills
/m/01pns0fire hydrant
/m/01lynhstairs

ERROR_UNKNOWN_QUESTION means the ID is wrong or not supported yet. ERROR_UNKNOW_450x450_QUESTION means the question isn’t supported on 4x4 images yet; reload the challenge on the page to get another one.

If the site rejects your clicks, report the tasks with report within 1 hour; refunds are settled after about 24 hours. Rules: Billing and refunds.