UNLOCK API
งานรูปภาพซับซ้อน

งานรูปภาพซับซ้อน

วิธีส่งงาน งานรูปภาพซับซ้อน ไปที่ UNLOCK API ด้วย createTask หรือ in.php: ชื่อประเภทงาน พารามิเตอร์ทุกตัว ออบเจ็กต์ solution ฟิลด์ proxy และตัวอย่างโค้ด 7 ภาษา
ราคา
$0.60 $0.0006 ต่องาน
สิ่งที่ส่ง
class (recaptcha, hcaptcha, funcaptcha หรือ recognition), รูปภาพ และข้อความงาน
สิ่งที่ได้
รูปหรือช่องที่ตรงกัน

ภาพรวมและราคา

ชื่อประเภทงาน

ประเภทนี้มีชื่อเดียว
ComplexImageTask

ออบเจ็กต์ task

type
Stringจำเป็น
ชื่อประเภทงาน ไม่สนตัวพิมพ์เล็กหรือใหญ่ ComplexImageTask
class
Stringจำเป็น
challenge รูปภาพแบบใด เช่น recaptcha หรือ hcaptcha
imagesBase64
Arrayจำเป็น
รูปภาพเป็นรายการสตริง base64
metadata
Objectไม่บังคับ
คำถามและรูปแบบตาราง เช่น Task และ Grid

ฟิลด์ที่ไม่ได้ระบุไว้ที่นี่จะส่งต่อให้ผู้แก้ตามที่ส่งมา

คำขอ

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

คืนใน solution เมื่อ status เป็น ready
answer
Array
คำตอบที่ต้องส่ง
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
}

ตัวอย่างโค้ด

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")

method ฟอร์มของ in.php

ประเภทนี้ใช้ได้กับ method แบบ JSON เท่านั้น