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

Click CAPTCHA Image Solving

Solve captchas requiring specific click coordinates with AI-powered recognition. Click CAPTCHAs require precise coordinate identification with 99.2% accuracy.

What is Click CAPTCHA Image?

Click CAPTCHAs present a single image and ask users to click on specific points or objects within that image (e.g., "Click on all traffic lights" or "Click on the center of the circle"). The challenge requires precise coordinate identification rather than simple image selection.

Captcha Type

Use the following captcha type identifier in your API requests:

"type": "CLICK_CAPTCHA_IMAGE"

Request Format

POST /createTask

Request Parameters

Parameter Type Required Description
auth.token string required Your API key
captcha.type string required Must be "CLICK_CAPTCHA_IMAGE"
captcha.metadata.siteUrl string required The URL where the captcha appears
captcha.payload.images array required Array of base64-encoded images
captcha.payload.question string required The click instruction (e.g., "Click on all traffic lights")
captcha.payload.referenceImages array optional Additional reference images (if provided)

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: 'CLICK_CAPTCHA_IMAGE',
      metadata: {
        siteUrl: 'https://example.com'
      },
      payload: {
        images: ['base64_encoded_main_image'],
        question: 'Click on all traffic lights',
        questionType: 'click',
        referenceImages: []
      }
    }
  })
});

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

Response Format

Create Task Response (Processing)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Task created successfully",
  "task": {
    "id": "MyDisctSolver_click123def456",
    "status": "processing",
    "timestamp": "2025-11-05T12:00:00.000Z"
  }
}

Fetch Result Response (Processing)

{
  "success": true,
  "service": "MyDisct Solver",
  "task": {
    "id": "MyDisctSolver_click123def456",
    "status": "processing",
    "timestamp": "2025-11-05T12:00:00.000Z"
  }
}

Fetch Result Response (Completed)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha solved successfully",
  "task": {
    "id": "MyDisctSolver_click123def456",
    "status": "completed",
    "result": {
      "answers": [[120, 85], [245, 150]],
      "timestamp": "2025-11-05T12:00:05.000Z"
    }
  }
}
Understanding the Response

The answers array contains [x, y] coordinate pairs representing the pixel coordinates where you should click. Multiple coordinate pairs may be returned if the task requires clicking on multiple objects (e.g., "Click on all traffic lights").

Implementation Guide

Step 1: Extract Images

// Get the main image
const mainImage = document.querySelector('.captcha-image img');
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');

canvas.width = mainImage.naturalWidth;
canvas.height = mainImage.naturalHeight;
ctx.drawImage(mainImage, 0, 0);

const imageBase64 = canvas.toDataURL('image/png').split(',')[1];

const questionText = document.querySelector('.captcha-instruction').textContent;

Step 2: Send to API and Poll

async function solveClickCaptcha(siteUrl, imageBase64, question) {
  const createResponse = 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: 'CLICK_CAPTCHA_IMAGE',
        metadata: { siteUrl },
        payload: {
          images: [imageBase64],
          question: question,
          questionType: 'click',
          referenceImages: []
        }
      }
    })
  });

  const createData = await createResponse.json();
  if (!createData.success) throw new Error(createData.error.message);

  const taskId = createData.task.id;

  while (true) {
    await new Promise(resolve => setTimeout(resolve, 2000)); // Wait 2 seconds

    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;
    } else if (resultData.task.status === 'failed') {
      throw new Error('Click captcha solving failed');
    }
  }
}

Step 3: Apply Solution

// Usage
async function handleClickCaptcha() {
  const imageBase64 = getImageBase64();
  const question = getQuestionText();
  const answers = await solveClickCaptcha(window.location.href, imageBase64, question);

  for (const [x, y] of answers) {
    const event = new MouseEvent('click', {
      clientX: x,
      clientY: y,
      bubbles: true
    });
    document.elementFromPoint(x, y).dispatchEvent(event);
    await new Promise(resolve => setTimeout(resolve, 500)); // Small delay between clicks
  }
}

Python Example

Python
import requests
import base64
import time

def solve_click_captcha(site_url, image_path, question, api_key):
    """Solve click captcha challenge"""
    # Step 1: Convert image to base64
    with open(image_path, 'rb') as image_file:
        image_base64 = base64.b64encode(image_file.read()).decode('utf-8')

    # Step 2: 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': 'CLICK_CAPTCHA_IMAGE',
                'metadata': {'siteUrl': site_url},
                'payload': {
                    'images': [image_base64],
                    'question': question,
                    'questionType': 'click',
                    'referenceImages': []
                }
            }
        }
    )

    create_data = create_response.json()
    if not create_data['success']:
        raise Exception(create_data['error']['message'])

    task_id = create_data['task']['id']
    print(f'Task created: {task_id}')

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

        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']
        elif result_data['task']['status'] == 'failed':
            raise Exception('Click captcha solving failed')

        print('Waiting for solution...')

# Example usage
answers = solve_click_captcha(
    site_url='https://example.com/captcha',
    image_path='captcha_image.png',
    question='Click on all traffic lights',
    api_key='YOUR_API_KEY'
)

print(f'Click coordinates: {answers}')
# Output: [[120, 85], [245, 150]]

Best Practices

Recommendations
  • Image Quality: Ensure images are captured at full resolution without compression
  • Question Extraction: Include the complete instruction text for accurate processing
  • Polling Intervals: Use 2-3 second intervals between fetchResult requests
  • Coordinate Application: Apply click coordinates in sequence with small delays
  • Error Handling: Implement retry logic for failed tasks
  • Timeout Management: Set reasonable timeouts (max 2 minutes) for solving

Common Issues

Issue: Coordinates not working

Solution: Ensure you're using the correct coordinate system. Coordinates are relative to the image, not the page. Convert them to page coordinates if needed.

Issue: Question text incorrect

Solution: Extract the complete question text exactly as it appears. Partial text may lead to incorrect solutions.

Issue: Multiple objects not detected

Solution: For tasks like "Click on all X", ensure all objects are visible in the image. If objects are partially hidden, the captcha may not be solvable.