MTCaptcha Task
Solve MTCaptcha and retrieve a token with the NoCaptchaAI API.
Loading…
Solve MTCaptcha and retrieve a token with the NoCaptchaAI API.
Loading…
POST https://api.nocaptchaai.com/createTask
{
"clientKey": "YOUR_API_KEY",
"task": {
"type": "MTCaptchaTask",
"websiteURL": "https://example.com",
"websiteKey": "YOUR_WEBSITE_KEY"
}
}
The API returns a taskId:
{ "errorId": 0, "status": "idle", "taskId": "CFQ2yP5DOL" }
Poll POST https://api.nocaptchaai.com/getTaskResult until status is ready:
{ "clientKey": "YOUR_API_KEY", "taskId": "CFQ2yP5DOL" }
{
"errorId": 0,
"status": "ready",
"solution": { "token": "0.WdWV79pV71mHDjQ...." }
}
# pip install requests
import requests, time
API_KEY = "YOUR_API_KEY"
BASE = "https://api.nocaptchaai.com"
task = requests.post(f"{BASE}/createTask", json={
"clientKey": API_KEY,
"task": {
"type": "MTCaptchaTask",
"websiteURL": "https://example.com",
"websiteKey": "YOUR_WEBSITE_KEY",
}
}).json()
task_id = task["taskId"]
while True:
time.sleep(2)
res = requests.post(f"{BASE}/getTaskResult", json={"clientKey": API_KEY, "taskId": task_id}).json()
if res.get("status") == "ready":
print(res["solution"]["token"]); break
if res.get("status") == "failed" or res.get("errorId"):
raise SystemExit(res)