UNLOCK API

MTCaptcha 辨識 API

向 API 傳送 MTCaptcha 任務,取得你的程式碼要提交到頁面的答案。頁面網址和 MTCaptcha site key。你會得到:用於 mtcaptcha-verifiedtoken 的權杖。

概覽

每 1,000 次價格
$0.725 (每個任務 $0.000725)
createTask 類型
MtCaptchaTaskProxyless, MtCaptchaTask
in.php 方法
mt_captcha
你傳送
頁面網址和 MTCaptcha site key
你得到
用於 mtcaptcha-verifiedtoken 的權杖

在哪裡找到這些值

site key 是頁面上 mtcaptchaConfig 物件中的 sitekey 值。

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": "MtCaptchaTaskProxyless",
      "websiteURL": "https://example.com/login",
      "websiteKey": "6LcR_RsTAAAAAFJR_5ZdbQd0SMxL7yIDmSXH1-lo"
    }
}).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"]["token"])
        break
else:
    raise SystemExit("timed out")

in.php 和 res.php

使用經典表單 API 傳送同樣的任務。加上 json=1 可獲得 JSON 回覆;不加則回覆純文字,例如 OK|1001。

curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&method=mt_captcha&sitekey=SITE_KEY&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 參考:所有參數和 solution 物件