UNLOCK API
Complex image task

Complex image task

How to send a Complex image task task to UNLOCK API with createTask or in.php: task type names, every parameter, the solution object, proxy fields and code samples in 7 languages.
Price
$0.60 $0.0006 per task
You send
class (recaptcha, hcaptcha, funcaptcha or recognition), the images and the task text
You get
Which images or cells match

Overview and price

Task type names

This type has one name.
ComplexImageTask

Task object

type
StringRequired
Task type name. Matched in any letter case. ComplexImageTask
class
StringRequired
Which image challenge this is, for example recaptcha or hcaptcha.
imagesBase64
ArrayRequired
The images as a list of base64 strings.
metadata
ObjectOptional
The question and the layout, for example Task and Grid.

Fields not listed here are passed to the solver as sent.

Request

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "ComplexImageTask",
    "class": "recaptcha",
    "imagesBase64": [
      "/9j/4AAQSkZJRgABAQ..."
    ],
    "metadata": {
      "Task": "Select all images with a bus",
      "Grid": "3x3"
    }
  }
}

Solution object

Returned in solution when status is ready.
answer
Array
The answer to submit.
POST /getTaskResult
{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "answer": [
      false,
      true,
      false,
      false,
      true,
      false,
      false,
      false,
      true
    ]
  },
  "cost": "0.0006",
  "createTime": 1791640000,
  "endTime": 1791640014,
  "solveCount": 1
}

Code samples

import time, requests

API = "https://unlock-api.com"
KEY = "YOUR_API_KEY"

task = requests.post(f"{API}/createTask", json={
    "clientKey": KEY,
    "task": {
      "type": "ComplexImageTask",
      "class": "recaptcha",
      "imagesBase64": [
        "/9j/4AAQSkZJRgABAQ..."
      ],
      "metadata": {
        "Task": "Select all images with a bus",
        "Grid": "3x3"
      }
    }
}).json()
if task["errorId"]:
    raise SystemExit(task["errorCode"])

for _ in range(60):   # 60 x 5 s = the 5 minute task limit
    time.sleep(5)
    r = requests.post(f"{API}/getTaskResult", json={"clientKey": KEY, "taskId": task["taskId"]}).json()
    if r["errorId"]:
        raise SystemExit(f"{r['errorCode']}: {r.get('errorDescription', '')}")   # failed tasks are refunded
    if r["status"] == "ready":
        print(r["solution"])
        break
else:
    raise SystemExit("timed out")

in.php form method

This type is available with the JSON methods only.