UNLOCK API
ตารางรูปภาพ

ตารางรูปภาพ

วิธีส่งงาน ตารางรูปภาพ ไปที่ UNLOCK API ด้วย createTask หรือ in.php: ชื่อประเภทงาน พารามิเตอร์ทุกตัว ออบเจ็กต์ solution ฟิลด์ proxy และตัวอย่างโค้ด 7 ภาษา
ราคา
$0.36 $0.00036 ต่องาน
สิ่งที่ส่ง
รูปตารางแบบ base64 และคำสั่ง เช่น วัตถุที่ต้องเลือก
สิ่งที่ได้
หมายเลขช่องที่ต้องคลิก

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

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

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

ชื่ออื่นที่รับได้: GridTaskProxyless

ออบเจ็กต์ task

type
Stringจำเป็น
ชื่อประเภทงาน ไม่สนตัวพิมพ์เล็กหรือใหญ่ GridTask
body
Stringจำเป็น
รูปภาพเป็น base64 (JPG, PNG หรือ GIF) ขนาดไม่เกินประมาณ 100 KB ใส่คำนำหน้า data: ได้
comment
Stringไม่บังคับ
คำแนะนำสำหรับผู้แก้ เช่น คำถามที่แสดงเหนือรูป
rows
Integerไม่บังคับ
จำนวนแถวในตาราง
columns
Integerไม่บังคับ
จำนวนคอลัมน์ในตาราง
imgType
Stringไม่บังคับ
ชนิดของรูป ถ้าทราบ
previousId
Stringไม่บังคับ
id ของงานก่อนหน้า เมื่อตารางเปลี่ยนหลังคำตอบแรก
canSkip
Booleanไม่บังคับ
true ถ้าคำตอบอาจเป็นว่าไม่มีช่องใดตรง

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

คำขอ

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "GridTask",
    "body": "/9j/4AAQSkZJRgABAQ...",
    "comment": "Select all squares with traffic lights",
    "rows": 3,
    "columns": 3
  }
}

ออบเจ็กต์ solution

คืนใน solution เมื่อ status เป็น ready
click
Array
หมายเลขช่องที่ต้องคลิก นับจาก 1 จากซ้ายไปขวาและบนลงล่าง
POST /getTaskResult
{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "click": [
      1,
      4,
      9
    ]
  },
  "cost": "0.00036",
  "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": "GridTask",
      "body": "/9j/4AAQSkZJRgABAQ...",
      "comment": "Select all squares with traffic lights",
      "rows": 3,
      "columns": 3
    }
}).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

งานเดียวกันด้วยคำขอแบบฟอร์มดั้งเดิม res.php คืนคำตอบเป็นข้อความ
in.php, res.php
curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&method=base64&recaptcha=1&textinstructions=Select+all+traffic+lights&body=BASE64_IMAGE&json=1"
# {"status":1,"request":"1001"}

curl -s "https://unlock-api.com/res.php?key=YOUR_API_KEY&action=get&id=1001&json=1"
# {"status":0,"request":"CAPCHA_NOT_READY"}  then  {"status":1,"request":"ANSWER"}

Form API: in.php และ res.php