UNLOCK API
कस्टम टास्क (Imperva, Temu और दूसरे)

कस्टम टास्क (Imperva, Temu और दूसरे)

createTask या in.php से UNLOCK API को कस्टम टास्क (Imperva, Temu और दूसरे) टास्क कैसे भेजें: टास्क टाइप के नाम, हर पैरामीटर, solution ऑब्जेक्ट, proxy फील्ड और 7 भाषाओं में कोड उदाहरण।
कीमत
$0.90 $0.0009 प्रति टास्क
आप भेजते हैं
class (Imperva, Temu, HUNT, tspd, Basilisk और दूसरे) और उसका metadata
आपको मिलता है
वे वैल्यू जो वह class लौटाती है

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

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

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

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

type
Stringज़रूरी
टास्क टाइप का नाम। किसी भी letter case में मिलाया जाता है। CustomTask
class
Stringज़रूरी
कौन सी सुरक्षा हल करनी है, जैसे Imperva या Temu।
websiteURL
Stringवैकल्पिक
उस पेज का पूरा एड्रेस जहां CAPTCHA दिखता है, http:// या https:// से शुरू।
metadata
Objectवैकल्पिक
चुनी गई class को जो अतिरिक्त वैल्यू चाहिए, ऑब्जेक्ट के रूप में।
userAgent
Stringवैकल्पिक
हल करते समय इस्तेमाल होने वाला ब्राउज़र User-Agent। जवाब सबमिट करते समय वही भेजें।

जो फील्ड यहां नहीं दिए गए, वे जैसे भेजे गए वैसे ही सॉल्वर को दिए जाते हैं।

रिक्वेस्ट

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "CustomTask",
    "class": "Imperva",
    "websiteURL": "https://example.com/login",
    "metadata": {
      "incapsulaScriptUrl": "_Incapsula_Resource?SWJIYLWA=...",
      "incapsulaCookie": "incap_ses_..."
    }
  }
}

Solution ऑब्जेक्ट

status ready होने पर solution में लौटाया जाता है।
data
Object
चुनी गई class के लिए जवाब की वैल्यू।
POST /getTaskResult
{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "data": {
      "...": "..."
    }
  },
  "cost": "0.0009",
  "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": "CustomTask",
      "class": "Imperva",
      "websiteURL": "https://example.com/login",
      "metadata": {
        "incapsulaScriptUrl": "_Incapsula_Resource?SWJIYLWA=...",
        "incapsulaCookie": "incap_ses_..."
      }
    }
}).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=incapsula&pageurl=https://example.com/login&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