UNLOCK API
इमेज ग्रिड

इमेज ग्रिड

createTask या in.php से UNLOCK API को इमेज ग्रिड टास्क कैसे भेजें: टास्क टाइप के नाम, हर पैरामीटर, solution ऑब्जेक्ट, proxy फील्ड और 7 भाषाओं में कोड उदाहरण।
कीमत
$0.36 $0.00036 प्रति टास्क
आप भेजते हैं
base64 में ग्रिड इमेज और निर्देश, जैसे कौन सी चीज़ चुननी है
आपको मिलता है
क्लिक करने वाले सेल के नंबर

ओवरव्यू और कीमत

टास्क टाइप के नाम

इस टाइप का एक ही नाम है।
GridTask

ये भी स्वीकार होते हैं: GridTaskProxyless

टास्क ऑब्जेक्ट

type
Stringज़रूरी
टास्क टाइप का नाम। किसी भी letter case में मिलाया जाता है। 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 ऑब्जेक्ट

status ready होने पर solution में लौटाया जाता है।
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")

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

फॉर्म API: in.php और res.php