Skip to content

reCAPTCHA image grid

Summary

PropertyValue
v1 typeimage.grid.recaptcha
Compatibility namesReCaptchaV2Classification
Proxynot used
Deadline60 seconds (starting value). A task not solved by then fails with timeout and is not charged.
2captcha legacy APImethod=base64&recaptcha=1 (details)

Parameters

The params object of POST /v1/tasks. Unknown fields are rejected with 422 invalid_params.

FieldTypeDescription
image
required
string

Base64 of the whole challenge image (3x3 or 4x4 grid) or of a single 1x1 tile.

min length 1 · max length 1,000,000
question
required
string

Question ID such as /m/0k4j.

min length 1 · max length 1,024
grid
optional
enum

Grid shape. Inferred from the image size when omitted.

one of "1x1", "3x3", "4x4"
confidence
optional
number

3x3 only: return every tile scoring above this threshold instead of the top 3.

≥ 0 · ≤ 1

Solution

The solution object of a solved task.

Give at least one of objects, has_object.

FieldTypeDescription
objects
optional
array of integer

Zero-based indexes of the images or tiles to select, left to right, top to bottom.

max items 64 · unique items
has_object
optional
boolean

1x1 tile: whether the tile contains the target.

confidences
optional
array of numbermax items 64

Example: native API (v1)

Runs as is with a test key (nop_test_…) in the sandbox; use a live key for real tasks.

POST /v1/tasks
{
"type": "image.grid.recaptcha",
"params": {
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "/m/015qff"
}
}
Terminal window
export NOPTCHA_KEY=nop_test_... # your test or live key
# waits up to 60 s; 200 = finished (solved or failed), 202 = still processing
IDEMPOTENCY_KEY=$(uuidgen) # one key per task you want; a retry of the same request reuses it
curl -s -X POST "https://api.noptcha.com/v1/tasks" \
-H "Authorization: Bearer $NOPTCHA_KEY" \
-H 'Prefer: wait=60' \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"type": "image.grid.recaptcha",
"params": {
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "/m/015qff"
}
}
EOF
# on 202: long-poll with the "id" from the response
TASK_ID=...
curl -s "https://api.noptcha.com/v1/tasks/$TASK_ID?wait=60" \
-H "Authorization: Bearer $NOPTCHA_KEY"

In the sandbox the task is solved at once and solution is:

{
"objects": [
0
]
}

Compatibility API

NameProxyNotes
ReCaptchaV2Classificationignored

Task fields (in task, next to type) and the v1 parameter each one becomes:

Compatibility fieldv1 parameter
bodyimage
confidenceconfidence
imageimage
questionquestion

Solution fields in getTaskResult:

Compatibility fieldv1 solution field
objectsobjects
hasObjecthas_object
confidencesconfidences

Example: compatibility API

POST /createTask
{
"clientKey": "nop_test_…",
"task": {
"type": "ReCaptchaV2Classification",
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "/m/015qff"
}
}
Terminal window
export NOPTCHA_KEY=nop_test_... # your test or live key
# 1. create the task
curl -s -X POST "https://api.noptcha.com/createTask" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"clientKey": "$NOPTCHA_KEY",
"task": {
"type": "ReCaptchaV2Classification",
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "/m/015qff"
}
}
EOF
# 2. poll with the taskId from step 1 every few seconds until "status" is "ready"
TASK_ID=...
curl -s -X POST "https://api.noptcha.com/getTaskResult" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"clientKey": "$NOPTCHA_KEY",
"taskId": $TASK_ID
}
EOF

In the sandbox getTaskResult returns "status": "ready" and solution:

{
"objects": [
0
]
}