In this article, we have tried to answer all the key questions. The first step in solving the task is to determine which protection system is being used. To do this, you can refer to the list of popular captchas and anti-bot protection systems, where you will find visual examples and key indicators that help you quickly understand what you are dealing with.
If you discover that your site uses MTCaptcha, the next step is to study its properties and operation in more detail. In this article, you can also review the instructions on how to integrate MTCaptcha so that you fully understand how it functions on your site. This will help you not only understand the current protection, but also properly plan its maintenance.
When testing forms that include MTCaptcha, you often need to verify that the captcha works and is integrated correctly.
You can verify the captcha embedded on your site manually.
For automatic solving you can use tools like CapMonster Cloud, which accepts captcha parameters, processes them on its servers, and returns a ready-to-use token. Insert this token into the form to pass the check without user interaction.
Working with CapMonster Cloud via API typically involves the following steps:
type - MTCaptchaTask
websiteURL - The address of the main page where the captcha is solved.
websiteKey - The MTcaptcha key, passed in the request parameters as “sk”.
pageAction - The action parameter is passed in the request as “act” and is displayed during token validation. Specify it only if the value differs from the default – %24.
isInvisible - Specify true if the captcha is invisible, meaning it has a hidden confirmation field. If bot activity is suspected, an additional check is triggered.
https://api.capmonster.cloud/createTask{
"clientKey": "API_KEY",
"task":
{
"type": "MTCaptchaTask",
"websiteURL": "https://www.example.com",
"websiteKey": "MTPublic-abCDEFJAB",
"isInvisible": false,
"pageAction": "login"
}
}
{
"errorId":0,
"taskId":407533072
}https://api.capmonster.cloud/getTaskResult{
"clientKey":"API_KEY",
"taskId": 407533072
}
{
"errorId": 0,
"errorCode": null,
"errorDescription": null,
"solution": {
"token": "v1(155506dc,c8c2e356,MTPublic-abCDEFJAB,70f03532a53...5FSDA**)"
},
"status": "ready"
}
// npm install playwright @zennolab_com/capmonstercloud-client
import { chromium } from 'playwright';
import { CapMonsterCloudClientFactory, ClientOptions, MTCaptchaRequest } from '@zennolab_com/capmonstercloud-client';
const API_KEY = 'YOUR_API_KEY';
const TARGET_URL = 'https://example.com';
async function main() {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
let websiteKey = null;
page.on('request', request => {
const url = request.url();
if (url.startsWith('https://service.mtcaptcha.com/mtcv1/api/getchallenge.json')) {
const params = new URL(url).searchParams;
const sk = params.get('sk');
if (sk) {
websiteKey = sk;
console.log('Extracted websiteKey (sk):', websiteKey);
}
}
});
await page.goto(TARGET_URL, { waitUntil: 'networkidle' });
if (!websiteKey) {
console.error('Failed to extract websiteKey (sk) from the page');
await browser.close();
return;
}
const client = CapMonsterCloudClientFactory.Create(
new ClientOptions({ clientKey: API_KEY })
);
const mtcaptchaRequest = new MTCaptchaRequest({
websiteURL: TARGET_URL,
websiteKey: websiteKey,
isInvisible: false,
pageAction: 'login'
});
// Captcha solution
const result = await client.Solve(mtcaptchaRequest);
const verifiedToken = typeof result?.solution?.value === 'string'
? result.solution.value
: JSON.stringify(result.solution.token);
console.log('VerifiedToken:', verifiedToken);
// Insert token and submit form (replace with the required selector)
await page.evaluate((token) => {
const input = document.querySelector('#mtcaptcha-verifiedtoken-1');
if (input) input.value = token;
}, verifiedToken);
console.log('Token inserted into input');
// await page.click('button[type="submit"]');
await page.waitForTimeout(5000);
await browser.close();
}
main().catch(err => {
console.error('An error occurred:', err);
});1. Register or log in to your MTCaptcha account.
2. After registration, add your website. You will receive two keys.
Example:
3. Set up the MTCaptcha client-side:
Insert the code into the <head> of the page.
Replace <YOUR SITE KEY> with your Site Key obtained from the MTCaptcha dashboard.
<head>
<script>
var mtcaptchaConfig = {
sitekey: "<YOUR SITE KEY>"
};
(function() {
var mt_service = document.createElement('script');
mt_service.async = true;
mt_service.src = 'https://service.mtcaptcha.com/mtcv1/client/mtcaptcha.min.js';
(document.head || document.body).appendChild(mt_service);
var mt_service2 = document.createElement('script');
mt_service2.async = true;
mt_service2.src = 'https://service2.mtcaptcha.com/mtcv1/client/mtcaptcha2.min.js';
(document.head || document.body).appendChild(mt_service2);
})();
</script>
</head>
Add the captcha container to the <body>
Where you want to display the captcha (e.g., inside a form):
<div class="mtcaptcha"></div>The widget will load automatically.
You can use ready-made SDKs and plugins for quick integration:
MTCaptcha also provides a convenient demo page to test and configure protection before deploying to your website.
4. Working with the server-side. Get Verified-Token on the client.
Via hidden form field:
<input type="hidden" name="mtcaptcha-verifiedtoken" />Or via JS:
mtcaptcha.getVerifiedToken() / mtcaptchaVerifiedCallback(status)Send the token to the server along with the form or request.
Verify token via API (server-side check):
GET https://service.mtcaptcha.com/mtcv1/api/checktoken?privatekey=<PRIVATE_KEY>&token=<TOKEN>Alternative URL for servers with firewall:
https://service2.mtcaptcha.com/mtcv1/api/checktokenProcess response:
success: true → captcha passed, continue processing.
{
"success": true,
"tokeninfo": {
"v": "1.0",
"code": 201,
"codeDesc": "valid:captcha-solved",
"tokID": "ae1e60a1e249c217cb7b05c4dba8dd0d",
"timestampSec": 1552185983,
"timestampISO": "2019-03-10T02:46:23Z",
"hostname": "some.example.com",
"isDevHost": false,
"action": "",
"ip": "10.10.10.10"
}
}success: false → error (token expired, reused, etc.)
const { MTCaptcha } = require('mtcaptcha');
const PRIVATE_KEY = 'YOUR_PRIVATE_KEY';
const tokenFromClient = 'TOKEN';
const mt = new MTCaptcha(PRIVATE_KEY, tokenFromClient);
mt.verify((result) => {
if (result.success) {
console.log('Captcha passed!', result.tokeninfo);
} else {
console.error('Captcha failed:', result.fail_codes || result.error);
}
});For a detailed study of MTCaptcha features — widget customization, client/server configuration, framework integration, and other aspects — refer to the official documentation.
If you’ve taken over a website that already has a captcha or another protection system installed, but you don’t have access to the code, don’t worry! It’s quite easy to identify which technology is being used. To verify that everything works correctly, you can use the CapMonster Cloud recognition service in an isolated test environment to make sure that the token processing mechanism and the validation logic are functioning properly.
In the case of MTCaptcha, it’s enough to detect the system, observe its behavior, and confirm that the protection is working correctly. In this article, we showed how to identify MTCaptcha and where to find instructions on how to integrate or reconfigure it, so you can confidently maintain the protection and keep its operation under control.