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

reCAPTCHA v2 Invisible Token Solving

Solve Google reCAPTCHA v2 Invisible captchas. The invisible variant works automatically in the background without requiring user interaction, triggered programmatically on page actions like form submission.

What is reCAPTCHA v2 Invisible?

Google reCAPTCHA v2 Invisible is a variant that does not display a checkbox to the user. Instead, it runs in the background and is triggered by a JavaScript callback (e.g., on form submit or button click). It provides the same level of bot protection as the standard checkbox variant but with a seamless user experience. This service generates valid verification tokens for invisible reCAPTCHA implementations.

Captcha Type

"type": "RECAPTCHA_V2_INVISIBLE_TOKEN"

Request Format

POST /createTask

Request Parameters

Parameter Type Required Description
auth.token string required Your API key
captcha.type string required Must be "RECAPTCHA_V2_INVISIBLE_TOKEN"
captcha.metadata.siteUrl string required URL where the invisible captcha appears
captcha.metadata.siteKey string required reCAPTCHA site key (data-sitekey attribute)
captcha.payload.recaptcha_data_s string optional The "data-s" attribute value if present on the reCAPTCHA element
captcha.payload.userAgent string optional Your browser's user agent to improve solving accuracy
captcha.payload.cookies array optional Array of cookie objects (see Cookie Object Structure below)
captcha.payload.cookies[].name string required* Cookie name
captcha.payload.cookies[].value string required* Cookie value
captcha.payload.cookies[].domain string required* Cookie domain (e.g., ".example.com")
captcha.payload.domain string optional reCAPTCHA API endpoint domain if the site uses an alternative
captcha.payload.proxy object optional Proxy configuration object
captcha.payload.proxy.protocol string required* Proxy protocol: "http", "https", "socks4", "socks5"
captcha.payload.proxy.host string required* Proxy IP address
captcha.payload.proxy.port number required* Proxy port number
captcha.payload.proxy.username string optional Proxy authentication username
captcha.payload.proxy.password string optional Proxy authentication password

* Required only if parent object (proxy/cookies) is 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: 'RECAPTCHA_V2_INVISIBLE_TOKEN',
      metadata: {
        siteUrl: 'https://example.com/signup',
        siteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-'
      },
      payload: {
        userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...',
        proxy: {
          protocol: 'http',
          host: '1.2.3.4',
          port: 8080,
          username: 'proxyuser',
          password: 'proxypass'
        }
      }
    }
  })
});

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

Response Format

Create Task Response (Processing)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha task created successfully",
  "task": {
    "id": "MyDisctSolver_abc123",
    "status": "processing"
  }
}

Fetch Result Response (Processing)

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

Fetch Result Response (Completed)

{
  "success": true,
  "service": "MyDisct Solver",
  "message": "Captcha solved successfully",
  "task": {
    "id": "MyDisctSolver_abc123",
    "status": "completed",
    "result": {
      "token": "03AGdBq27QF...",
      "timestamp": "2025-12-13T12:00:00.000Z"
    }
  }
}
Understanding the Response

The token field contains the g-recaptcha-response value. Submit this token in the g-recaptcha-response form field or use it in your API requests. Invisible reCAPTCHA tokens work the same way as standard v2 tokens.

Implementation Guide

Step 1: Identify Invisible reCAPTCHA

// Invisible reCAPTCHA has data-size="invisible" or data-callback attribute
function isInvisibleRecaptcha() {
  const recaptchaDiv = document.querySelector('.g-recaptcha');
  if (recaptchaDiv) {
    return recaptchaDiv.getAttribute('data-size') === 'invisible';
  }
  // Also check for programmatic rendering with size: 'invisible'
  return false;
}

function getInvisibleSiteKey() {
  const recaptchaDiv = document.querySelector('.g-recaptcha, [data-sitekey]');
  if (recaptchaDiv) {
    return recaptchaDiv.getAttribute('data-sitekey');
  }
  return null;
}

const siteKey = getInvisibleSiteKey();
console.log('Invisible Site Key:', siteKey);

Step 2: Solve Invisible Token

JavaScript
async function solveRecaptchaV2Invisible(siteUrl, siteKey) {
  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: 'RECAPTCHA_V2_INVISIBLE_TOKEN',
        metadata: { siteUrl, siteKey },
        payload: {
          userAgent: navigator.userAgent
        }
      }
    })
  });

  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, 5000));

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

const token = await solveRecaptchaV2Invisible(
  'https://example.com/signup',
  '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-'
);
console.log('Invisible Token:', token);

Step 3: Submit Token

// Inject token and trigger the callback
function injectInvisibleToken(token) {
  let responseField = document.querySelector('[name="g-recaptcha-response"]');
  if (!responseField) {
    responseField = document.createElement('textarea');
    responseField.name = 'g-recaptcha-response';
    responseField.style.display = 'none';
    document.querySelector('form').appendChild(responseField);
  }
  responseField.value = token;

  // Trigger the callback if defined
  const recaptchaDiv = document.querySelector('.g-recaptcha');
  const callbackName = recaptchaDiv?.getAttribute('data-callback');
  if (callbackName && typeof window[callbackName] === 'function') {
    window[callbackName](token);
  } else {
    document.querySelector('form').submit();
  }
}

Python Example

Python
import requests
import time

def solve_recaptcha_v2_invisible(site_url, site_key, api_key):
    """Solve reCAPTCHA v2 Invisible token challenge"""

    # 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': 'RECAPTCHA_V2_INVISIBLE_TOKEN',
                'metadata': {
                    'siteUrl': site_url,
                    'siteKey': site_key
                },
                'payload': {}
            }
        }
    )

    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 2: Poll for result
    while True:
        time.sleep(5)

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

        print('Waiting for solution...')

# Example usage
token = solve_recaptcha_v2_invisible(
    site_url='https://example.com/signup',
    site_key='6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
    api_key='YOUR_API_KEY'
)

print(f'Invisible Token: {token}')

# Submit with form
response = requests.post(
    'https://example.com/signup',
    data={
        'email': '[email protected]',
        'password': 'securepassword',
        'g-recaptcha-response': token
    }
)

print(f'Signup response: {response.status_code}')

Best Practices

Recommendations
  • Invisible reCAPTCHA uses the same site key format as standard v2
  • Check for data-size="invisible" attribute to confirm invisible variant
  • Include user agent for better success rates
  • Poll every 5 seconds for token-based captchas
  • Tokens expire after ~2 minutes, use immediately after receiving
  • Some sites require triggering the callback function after token injection

Common Issues

Issue: Token rejected by website

Solution: Ensure you're using the correct site key and URL. The invisible variant may require triggering the data-callback function after injecting the token.

Issue: Wrong captcha type

Solution: Verify the site uses invisible reCAPTCHA by checking for data-size="invisible" on the reCAPTCHA element. If it shows a checkbox, use RECAPTCHA_V2_TOKEN instead.