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

Grid CAPTCHA Image Solving

Solve grid-based image selection captchas with AI-powered recognition. Grid CAPTCHAs present images in a matrix where users must select specific objects with 99.4% accuracy.

What is Grid CAPTCHA Image?

Grid CAPTCHAs display images in a grid layout (typically 3x3 or 4x4) and ask users to select all images that match a specific criteria (e.g., "Select all images with cars" or "Select all images with traffic lights"). The challenge requires visual pattern recognition and object identification.

Captcha Type

Use the following captcha type identifier in your API requests:

"type": "GRID_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 "GRID_CAPTCHA_IMAGE"
captcha.metadata.siteUrl string required URL where captcha appears
captcha.payload.images array required Array of base64-encoded grid images
captcha.payload.question string required The selection criteria (e.g., "Select all images with cars")

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: 'GRID_CAPTCHA_IMAGE',
      metadata: {
        siteUrl: 'https://example.com'
      },
      payload: {
        images: ['img1_base64', 'img2_base64', 'img3_base64'],
        question: 'Select all images with traffic lights'
      }
    }
  })
});

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

Python Example

Python
import requests
import time

def solve_grid_captcha(images, question, site_url, api_key):
    """
    Solve grid captcha challenge

    Args:
        images: List of base64-encoded images
        question: Selection criteria
        site_url: URL where captcha appears
        api_key: Your MyDisct Solver API key

    Returns:
        List of selected indices
    """

    # 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': 'GRID_CAPTCHA_IMAGE',
                'metadata': {'siteUrl': site_url},
                'payload': {
                    'images': images,
                    'question': question
                }
            }
        }
    )

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

# Usage
solution = solve_grid_captcha(
    images=['img1_base64', 'img2_base64', 'img3_base64'],
    question='Select all images with traffic lights',
    site_url='https://example.com',
    api_key='YOUR_API_KEY'
)
print(f'Selected indices: {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": [0, 2, 5, 7],
      "timestamp": "2025-11-05T12:34:56.789Z"
    }
  }
}
Understanding the Response

The answers array contains the indices of images that should be selected. Indices start from 0 (top-left) and go from left-to-right, top-to-bottom in the grid.

Best Practices

Recommendations
  • Include the exact question text as displayed
  • Provide all images in the grid in correct order
  • Use high-quality images without compression
  • Grid size can vary (3x3, 4x4, etc.) - our API handles all sizes
  • Poll every 3 seconds for results

Common Issues

Issue: Wrong image order

Solution: Ensure images are provided in the same order they appear in the grid (left-to-right, top-to-bottom).

Issue: Missing or incomplete question text

Solution: Include the complete question text exactly as it appears. Even small differences can affect accuracy.

Issue: Dynamic grid sizes

Solution: Grid CAPTCHAs can have different sizes (3x3, 4x4, etc.). Our API automatically detects the grid size from the number of images provided.