UNLOCK API

इमेज ग्रिड सॉल्विंग API

API को इमेज ग्रिड टास्क भेजें और वह जवाब पाएं जो आपका कोड पेज पर सबमिट करता है। base64 में ग्रिड इमेज और निर्देश, जैसे कौन सी चीज़ चुननी है। आपको मिलता है: क्लिक करने वाले सेल के नंबर।

एक नज़र में

प्रति 1,000 कीमत
$0.36 ($0.00036 प्रति टास्क)
createTask type
GridTask
in.php method
post, recaptcha=1
आप भेजते हैं
base64 में ग्रिड इमेज और निर्देश, जैसे कौन सी चीज़ चुननी है
आपको मिलता है
क्लिक करने वाले सेल के नंबर

वैल्यू कहां मिलेंगी

पूरी ग्रिड को एक इमेज के रूप में और निर्देश को comment के रूप में भेजें। rows और columns डिफ़ॉल्ट रूप से 3 हैं।

createTask और getTaskResult

टास्क बनाएं, लगभग 5 सेकंड इंतजार करें, फिर हर 5 सेकंड में रिजल्ट चेक करें जब तक स्टेटस 'ready' न हो जाए। अगर टास्क फेल होता है, तो API एक एरर देता है और चार्ज आपके क्रेडिट में वापस आ जाता है।

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

वही टास्क, क्लासिक फॉर्म API के साथ। JSON जवाब के लिए json=1 जोड़ें। इसके बिना जवाब सादे टेक्स्ट में आते हैं, जैसे: OK|1001

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 रेफरेंस: हर पैरामीटर और solution ऑब्जेक्ट