UNLOCK API
MTCaptcha

MTCaptcha

如何通过 createTask 或 in.php 向 UNLOCK API 发送 MTCaptcha 任务:任务类型名称、全部参数、solution 对象、代理字段,以及 7 种语言的代码示例。
价格
$0.725 每个任务 $0.000725
你发送
页面网址和 MTCaptcha site key
你得到
用于 mtcaptcha-verifiedtoken 的令牌

简介和价格

任务类型名称

不使用代理时用第一个名称。要通过你自己的代理识别,用第二个名称并加上代理字段。价格相同。
MtCaptchaTaskProxyless不使用代理
MtCaptchaTask使用你的代理

task 对象

type
String必填
任务类型名称。不区分大小写。 MtCaptchaTaskProxyless | MtCaptchaTask
websiteURL
String必填
出现验证码的页面完整地址,以 http:// 或 https:// 开头。
websiteKey
String必填
验证码组件的站点密钥,可在页面源代码中找到(例如 data-sitekey)。

此处未列出的字段会原样传给识别方。

代理字段

仅用于代理类型名称。可以分别发送各字段,也可以发送一个 proxy 字符串。
proxyType
String必填
http、https、socks4 或 socks5。
proxyAddress
String必填
代理 IP 地址或主机名。
proxyPort
Integer必填
代理端口。
proxyLogin
String可选
代理用户名(如果代理需要)。
proxyPassword
String可选
代理密码(如果代理需要)。
proxy
String
把所有代理字段写成一个字符串,例如 http://user:pass@1.2.3.4:8080。

使用代理

请求

POST /createTask
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "MtCaptchaTaskProxyless",
    "websiteURL": "https://example.com/login",
    "websiteKey": "6LcR_RsTAAAAAFJR_5ZdbQd0SMxL7yIDmSXH1-lo"
  }
}

solution 对象

status 为 ready 时在 solution 中返回。
token
String
随页面表单提交的令牌。
POST /getTaskResult
{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "token": "v1(03,79a6aa8f,MTPublic-hoiLlq1VS,...)"
  },
  "cost": "0.000725",
  "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": "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 以文本形式返回答案。
in.php, res.php
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:in.php 和 res.php