Skip to content

hCaptcha image grid

Summary

PropertyValue
v1 typeimage.grid.hcaptcha
Compatibility namesHCaptchaClassification
Proxynot used
Deadline60 seconds (starting value). A task not solved by then fails with timeout and is not charged.

Parameters

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

Give at least one of question, anchors.

FieldTypeDescription
images
required
array of image

Base64 of each challenge image in page order.

min items 1 · max items 20
question
optional
string

The full question as shown on the page.

min length 1 · max length 1,024
anchors
optional
array of image

Base64 of the example images shown next to the question.

min items 1 · max items 10

Solution

The solution object of a solved task.

FieldTypeDescription
objects
required
array of integer

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

max items 64 · unique items
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.hcaptcha",
"params": {
"images": [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
],
"question": "Please click each image containing a bicycle"
}
}
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.hcaptcha",
"params": {
"images": [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
],
"question": "Please click each image containing a bicycle"
}
}
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
HCaptchaClassificationignored

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

Compatibility fieldv1 parameter
anchorsanchors (a single value is wrapped in an array)
queriesimages
questionquestion

Solution fields in getTaskResult:

Compatibility fieldv1 solution field
objectsobjects (one boolean per image: true = selected)
top_kobjects
confidencesconfidences

Example: compatibility API

POST /createTask
{
"clientKey": "nop_test_…",
"task": {
"type": "HCaptchaClassification",
"queries": [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
],
"question": "Please click each image containing a bicycle"
}
}
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": "HCaptchaClassification",
"queries": [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
],
"question": "Please click each image containing a bicycle"
}
}
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": [
true,
false
],
"top_k": [
0
]
}