Chat with us, powered by LiveChat
← Return to MyDisct Solver

MTCaptcha Image Solving

Solve MTCaptcha image challenges with AI-powered recognition. MTCaptcha provides privacy-focused CAPTCHA solutions with 99.4% accuracy.

What is MTCaptcha Image?

MTCaptcha (MyCaptcha) is a privacy-focused CAPTCHA service that presents users with image-based challenges instead of text puzzles. It uses advanced AI to create unique challenges that are difficult for bots to solve but easy for humans. Our API automatically analyzes MTCaptcha images and returns the correct responses.

Captcha Type

Use the following captcha type identifier in your API requests:

"type": "MTCAPTCHA_IMAGE"

Request Format

POST /createTask

Request Parameters

Parameter Type Required Description
auth.token string required Your API key
captcha.type string required Must be "MTCAPTCHA_IMAGE"
captcha.metadata.siteUrl string required URL where captcha appears
captcha.payload.images array required Array of base64-encoded images
captcha.payload.module string optional MTCaptcha module (default: "mtcaptcha")
captcha.payload.maxLength number optional Maximum character length (default: 5)

Example Request

JavaScript
const response = await fetch('https://solver-api.mydisct.com/createTask', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'apikey': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    auth: { token: 'YOUR_API_KEY' },
    context: { source: 'api', version: '1.0.0' },
    captcha: {
      type: 'MTCAPTCHA_IMAGE',
      metadata: {
        siteUrl: 'https://example.com'
      },
      payload: {
        images: ['base64_image_1'],
        module: 'mtcaptcha',
        maxLength: 5
      }
    }
  })
});

const data = await response.json();
console.log('Task ID:', data.task.id);

Python Example

Python
import requests
import time

def solve_mtcaptcha_image(images, site_url, api_key, module='mtcaptcha', max_length=5):
    """
    Solve MTCaptcha image challenge

    Args:
        images: List of base64-encoded images
        site_url: URL where captcha appears
        api_key: Your MyDisct Solver API key
        module: MTCaptcha module (default: 'mtcaptcha')
        max_length: Maximum character length (default: 5)

    Returns:
        Solution text
    """

    # Step 1: Create task
    create_response = requests.post(
        'https://solver-api.mydisct.com/createTask',
        headers={
            'Content-Type': 'application/json',
            'apikey': api_key
        },
        json={
            'auth': {'token': api_key},
            'context': {'source': 'api', 'version': '1.0.0'},
            'captcha': {
                'type': 'MTCAPTCHA_IMAGE',
                'metadata': {'siteUrl': site_url},
                'payload': {
                    'images': images,
                    'module': module,
                    'maxLength': max_length
                }
            }
        }
    )

    create_data = create_response.json()

    if not create_data['success']:
        raise Exception(create_data['error']['message'])

    task_id = create_data['task']['id']

    # Step 2: Poll for result
    while True:
        time.sleep(3)

        result_response = requests.post(
            'https://solver-api.mydisct.com/fetchResult',
            headers={
                'Content-Type': 'application/json',
                'apikey': api_key
            },
            json={'taskId': task_id}
        )

        result_data = result_response.json()

        if result_data['task']['status'] == 'completed':
            return result_data['task']['result']['answers'][0]  # MTCaptcha returns single answer
        elif result_data['task']['status'] == 'failed':
            raise Exception('MTCaptcha solving failed')

# Usage
solution = solve_mtcaptcha_image(
    images=['base64_image_data'],
    site_url='https://example.com',
    api_key='YOUR_API_KEY'
)
print(f'Solution: {solution}')

Response Format

Create Task Response

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha is being processed",
  "task": {
    "id": "MyDisctSolver_abc123def456",
    "status": "processing"
  }
}

Fetch Result Response (Processing)

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha is being processed",
  "task": {
    "id": "MyDisctSolver_abc123def456",
    "status": "processing"
  }
}

Fetch Result Response (Completed)

JSON
{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha solved successfully",
  "task": {
    "id": "MyDisctSolver_abc123def456",
    "status": "completed",
    "result": {
      "answers": ["solution_text"],
      "timestamp": "2025-11-05T12:34:56.789Z"
    }
  }
}
Understanding the Response

The answers array contains the extracted text from the MTCaptcha image. For MTCaptcha, this is typically a single text string in the first element of the array.

Implementation Guide

Step 1: Extract MTCaptcha Image

MTCaptcha challenges appear in iframes. Extract the image from the challenge:

JavaScript
// Extract MTCaptcha image
function extractMTCaptchaImage() {
  const iframe = document.querySelector('iframe[src*="mtcaptcha"]');
  if (!iframe) return null;

  const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;

  const captchaImage = iframeDoc.querySelector('.mtcaptcha-verification-image img') ||
                      iframeDoc.querySelector('img[alt*="captcha"]') ||
                      iframeDoc.querySelector('.captcha-image img');

  if (!captchaImage) return null;

  const canvas = document.createElement('canvas');
  const ctx = canvas.getContext('2d');
  canvas.width = captchaImage.naturalWidth;
  canvas.height = captchaImage.naturalHeight;
  ctx.drawImage(captchaImage, 0, 0);

  return canvas.toDataURL('image/png').split(',')[1];
}

Step 2: Submit to API

JavaScript
async function solveMTCaptcha(siteUrl) {
  const imageBase64 = extractMTCaptchaImage();

  if (!imageBase64) {
    throw new Error('Could not extract MTCaptcha image');
  }

  const response = await fetch('https://solver-api.mydisct.com/createTask', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      auth: { token: 'YOUR_API_KEY' },
      context: { source: 'api', version: '1.0.0' },
      captcha: {
        type: 'MTCAPTCHA_IMAGE',
        metadata: { siteUrl },
        payload: {
          images: [imageBase64],
          module: 'mtcaptcha',
          maxLength: 5
        }
      }
    })
  });

  const data = await response.json();

  if (!data.success) {
    throw new Error(data.error.message);
  }

  const taskId = data.task.id;

  while (true) {
    await new Promise(resolve => setTimeout(resolve, 3000));

    const resultResponse = await fetch('https://solver-api.mydisct.com/fetchResult', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'apikey': 'YOUR_API_KEY'
      },
      body: JSON.stringify({ taskId })
    });

    const resultData = await resultResponse.json();

    if (resultData.task.status === 'completed') {
      return resultData.task.result.answers[0];
    } else if (resultData.task.status === 'failed') {
      throw new Error('MTCaptcha solving failed');
    }
  }
}

const solution = await solveMTCaptcha('https://example.com');
console.log('MTCaptcha solution:', solution);

Best Practices

Recommendations
  • Use high-quality images without compression artifacts
  • Set appropriate maxLength based on expected answer length
  • Include the exact site URL where the captcha appears
  • MTCaptcha typically uses numeric answers (set maxLength: 5)
  • Poll every 3 seconds for results

Common Issues

Issue: Incorrect answer length

Solution: Set maxLength parameter appropriately. MTCaptcha often uses 3-5 character numeric answers.

Issue: Image quality too low

Solution: Ensure images are captured at full resolution without compression. MTCaptcha requires clear text for accurate OCR.

Issue: Wrong module parameter

Solution: Use "mtcaptcha" as the module parameter for standard MTCaptcha challenges.