Hello! I'm part of the MyDisct Solver team, and I help developers who work with web automation and form submission projects. Google reCAPTCHA v2 is the most widely used captcha system on the internet, and handling it properly is essential for successful automation.
Let me share how we approach reCAPTCHA v2 at MyDisct Solver and how you can integrate our solutions into your automation projects.
Understanding Google reCAPTCHA v2
Google reCAPTCHA v2 is the most recognizable captcha system worldwide, appearing on millions of websites. It comes in two main variants: the checkbox version where users click "I'm not a robot," and the invisible version that works automatically in the background.
When you're building web automation tools, form submission bots, or testing frameworks, you'll encounter reCAPTCHA v2 constantly. The challenge can appear as a simple checkbox, or it may present image-based puzzles asking users to identify specific objects in a grid.
The difficulty with reCAPTCHA v2 lies in its sophisticated detection mechanisms. Google analyzes browser fingerprints, mouse movements, click patterns, and behavioral signals to distinguish between legitimate users and bots.
Why Websites Use reCAPTCHA v2
Websites choose Google reCAPTCHA v2 for several compelling reasons. First, it's free for most websites and provides strong bot protection without requiring complex setup.
Second, reCAPTCHA v2 is trusted by users worldwide. The "I'm not a robot" checkbox has become a familiar part of the internet experience, and users generally accept it without frustration.
Third, it integrates seamlessly with Google's infrastructure and provides detailed analytics about bot traffic. Website owners can monitor attack patterns and adjust security settings accordingly.
For developers, this means you need reliable reCAPTCHA v2 solving solutions to handle these challenges across different websites and automation scenarios.
Common Automation Use Cases
Developers integrate reCAPTCHA v2 solving into various projects:
Form automation tools need to handle reCAPTCHA v2 when submitting contact forms, registration forms, or survey responses. Whether you're building lead generation tools or data collection systems, reCAPTCHA v2 can block your automation.
Testing frameworks require reCAPTCHA v2 solving to test user flows that include captcha-protected forms. QA teams need automated ways to verify that form submissions work correctly without manual intervention.
Account creation automation encounters reCAPTCHA v2 during signup processes. Whether you're creating test accounts or managing multiple user accounts, solving reCAPTCHA v2 is essential.
E-commerce automation tools use reCAPTCHA v2 solving when automating purchases, monitoring inventory, or tracking product availability on protected websites.
Getting Started with MyDisct Solver
Before you can start solving reCAPTCHA v2 challenges, you need to set up your MyDisct Solver account:
Step 1: Create Your Account
Sign up for a MyDisct Solver account through our registration page. The process is quick and requires only a valid email address.
After registration, verify your email to activate your account. This ensures security and enables notifications about your API usage.
Account creation is free, and you can start testing immediately with a small initial balance.
Step 2: Get Your API Key
Once verified, log in to your dashboard where your unique API key is displayed. This key authenticates all your API requests.
Store your API key securely using environment variables. Never expose it in client-side code or public repositories.
If compromised, you can regenerate your key instantly from your dashboard.
Step 3: Add Balance
MyDisct Solver uses pay-as-you-go pricing. Add balance through your dashboard using your preferred payment method.
You only pay for successfully solved captchas. Failed attempts don't consume your balance.
reCAPTCHA v2 Solving Methods
MyDisct Solver offers multiple approaches for solving reCAPTCHA v2, each designed for different integration scenarios.
Method 1: Token-Based Solving (Recommended for Most Cases)
Token-based solving is the most efficient method for reCAPTCHA v2. You provide the reCAPTCHA site key and URL, and our API returns a valid g-recaptcha-response token that bypasses the captcha.
This method handles all the complexity of browser fingerprinting, challenge solving, and token generation on our servers. You simply receive a ready-to-use token.
Token-based solving works for both checkbox and invisible reCAPTCHA v2 variants. It's faster, more reliable, and easier to implement than image-based solving.
Use API type: RECAPTCHA_V2_TOKEN
Here's how to implement token-based reCAPTCHA v2 solving:
require('dotenv').config();
const API_KEY = process.env.MYDISCT_API_KEY;
const API_BASE_URL = 'https://solver-api.mydisct.com';
async function solveRecaptchaV2Token(siteUrl, siteKey) {
try {
console.log('Creating reCAPTCHA v2 solving task...');
const createResponse = await fetch(`${API_BASE_URL}/createTask`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': API_KEY
},
body: JSON.stringify({
auth: { token: API_KEY },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'RECAPTCHA_V2_TOKEN',
metadata: {
siteUrl: siteUrl,
siteKey: siteKey
},
payload: {}
}
})
});
const createData = await createResponse.json();
if (!createData.success) {
throw new Error(createData.error.message);
}
console.log(`Task created: ${createData.task.id}`);
const taskId = createData.task.id;
// Poll for result
let attempts = 0;
const maxAttempts = 40;
while (attempts < maxAttempts) {
await new Promise(resolve => setTimeout(resolve, 5000));
const resultResponse = await fetch(`${API_BASE_URL}/fetchResult`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': API_KEY
},
body: JSON.stringify({ taskId: taskId })
});
const resultData = await resultResponse.json();
if (resultData.task.status === 'completed') {
console.log('✓ reCAPTCHA v2 solved!');
return resultData.task.result.token;
} else if (resultData.task.status === 'failed') {
throw new Error('Solving failed');
}
attempts++;
console.log(`Attempt ${attempts}/${maxAttempts}...`);
}
throw new Error('Timeout');
} catch (error) {
console.error('Error:', error.message);
throw error;
}
}
Method 2: Image-Based Solving (For Granular Control)
Image-based solving gives you complete control over the reCAPTCHA v2 solving process. With this method, you extract the challenge images and question text from reCAPTCHA, send them to our API, and receive the solution indices indicating which images match the question.
This approach is particularly useful when you need to understand exactly what's happening during the solving process, debug issues, or work with custom reCAPTCHA implementations.
Use API type: RECAPTCHA_IMAGE
Image-based solving works by sending an array of 9 or 16 base64-encoded images (for 3x3 or 4x4 grids) along with the challenge question. Our AI analyzes each image and returns an array of indices indicating which images contain the requested objects.
async function solveRecaptchaImages(images, question, siteUrl) {
const createResponse = await fetch(`${API_BASE_URL}/createTask`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': API_KEY
},
body: JSON.stringify({
auth: { token: API_KEY },
context: { source: 'api', version: '1.0.0' },
captcha: {
type: 'RECAPTCHA_IMAGE',
metadata: { siteUrl: siteUrl },
payload: {
images: images, // Array of 9 or 16 base64-encoded images
question: question, // e.g., "Select all images with traffic lights"
questionType: 'grid_3x3' // or 'grid_4x4' for 16 images
}
}
})
});
const createData = await createResponse.json();
const taskId = createData.task.id;
// Poll for result
while (true) {
await new Promise(resolve => setTimeout(resolve, 3000));
const resultResponse = await fetch(`${API_BASE_URL}/fetchResult`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikey': API_KEY
},
body: JSON.stringify({ taskId: taskId })
});
const resultData = await resultResponse.json();
if (resultData.task.status === 'completed') {
// Returns array like [0, 2, 5, 7] indicating which images to click
return resultData.task.result.answers;
} else if (resultData.task.status === 'failed') {
throw new Error('Solving failed');
}
}
}
For a 3x3 grid, images are indexed 0-8 from left to right, top to bottom. For a 4x4 grid, images are indexed 0-15.
Method 3: reCAPTCHA v3 Token Solving (For Invisible Verification)
reCAPTCHA v3 is Google's latest version that works completely invisibly. Unlike v2, it doesn't require any user interaction and returns a score from 0.0 to 1.0 indicating bot likelihood.
Use API type: RECAPTCHA_V3_TOKEN
reCAPTCHA v3 is commonly used alongside v2 on modern websites. Our API generates high-score tokens (0.7-1.0) that indicate human-like behavior.
Method 4: reCAPTCHA Enterprise Token Solving (For High-Security Sites)
reCAPTCHA Enterprise is Google's premium bot detection service for high-security applications. It provides advanced threat analysis and custom scoring models.
Use API type: RECAPTCHA_ENTERPRISE_TOKEN
Enterprise tokens work with Google's Enterprise API endpoints and include additional security features.
Method 5: Browser Extension (Easiest Integration)
If you're using browser-based automation tools like Puppeteer, Selenium, or Playwright, our browser extension provides the simplest integration. The extension automatically detects all reCAPTCHA variants (v2, v3, Enterprise), solves them using our API, and injects the solution.
This is perfect for developers who want zero captcha-specific code in their automation scripts.
const puppeteer = require('puppeteer');
const path = require('path');
async function runWithExtension() {
const extensionPath = path.join(__dirname, 'mydisct_solver');
const browser = await puppeteer.launch({
headless: false,
args: [
`--load-extension=${extensionPath}`,
`--disable-extensions-except=${extensionPath}`,
'--enable-extensions'
]
});
const page = await browser.newPage();
await page.goto('https://example.com/form-with-recaptcha');
// Extension automatically solves reCAPTCHA
await page.type('#email', '[email protected]');
await page.click('#submit-button');
await page.waitForNavigation({ waitUntil: 'networkidle2' });
console.log('Form submitted with automatic reCAPTCHA solving!');
}
Complete Puppeteer Integration Example
Here's a production-ready example for form automation with reCAPTCHA v2 solving:
require('dotenv').config();
const puppeteer = require('puppeteer');
const API_KEY = process.env.MYDISCT_API_KEY;
const API_BASE_URL = 'https://solver-api.mydisct.com';
async function automateFormWithRecaptcha(formUrl) {
const browser = await puppeteer.launch({
headless: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-blink-features=AutomationControlled'
]
});
try {
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36');
console.log(`Navigating to ${formUrl}...`);
await page.goto(formUrl, { waitUntil: 'networkidle2' });
// Fill form fields
await page.type('#name', 'John Doe');
await page.type('#email', '[email protected]');
await page.type('#message', 'This is a test message');
// Check for reCAPTCHA
await page.waitForTimeout(2000);
const recaptchaFrame = await page.$('iframe[src*="recaptcha"]');
if (recaptchaFrame) {
console.log('reCAPTCHA v2 detected');
// Extract site key
const siteKey = await page.evaluate(() => {
const element = document.querySelector('[data-sitekey]');
return element ? element.getAttribute('data-sitekey') : null;
});
if (!siteKey) {
throw new Error('Could not extract reCAPTCHA site key');
}
console.log(`Site key: ${siteKey}`);
// Solve reCAPTCHA
const token = await solveRecaptchaV2Token(page.url(), siteKey);
// Inject token
await page.evaluate((token) => {
const textarea = document.querySelector('textarea[name="g-recaptcha-response"]');
if (textarea) {
textarea.value = token;
}
// Trigger callback if exists
if (window.grecaptcha && window.grecaptcha.getResponse) {
const widgetId = 0; // Usually 0 for first widget
if (window.___grecaptcha_cfg && window.___grecaptcha_cfg.clients) {
const client = window.___grecaptcha_cfg.clients[widgetId];
if (client && client.callback) {
client.callback(token);
}
}
}
}, token);
console.log('Token injected successfully');
await page.waitForTimeout(1000);
}
// Submit form
console.log('Submitting form...');
await page.click('button[type="submit"]');
await page.waitForNavigation({
waitUntil: 'networkidle2',
timeout: 30000
}).catch(() => console.log('Navigation timeout'));
console.log('Form submitted successfully!');
} catch (error) {
console.error('Automation error:', error.message);
} finally {
await browser.close();
}
}
automateFormWithRecaptcha('https://example.com/contact');
Python Selenium Implementation
For Python developers, here's a complete implementation:
import os
import time
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv('MYDISCT_API_KEY')
API_BASE_URL = 'https://solver-api.mydisct.com'
def solve_recaptcha_v2(site_key, site_url):
create_response = requests.post(
f'{API_BASE_URL}/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_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}')
for attempt in range(40):
time.sleep(5)
result_response = requests.post(
f'{API_BASE_URL}/fetchResult',
headers={'Content-Type': 'application/json', 'apikey': API_KEY},
json={'taskId': task_id}
)
result_data = result_response.json()
if result_data['task']['status'] == 'completed':
print('✓ reCAPTCHA v2 solved!')
return result_data['task']['result']['token']
elif result_data['task']['status'] == 'failed':
raise Exception('Solving failed')
print(f'Attempt {attempt + 1}/40...')
raise Exception('Timeout')
def automate_form_with_recaptcha(form_url):
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-blink-features=AutomationControlled')
driver = webdriver.Chrome(options=options)
try:
print(f'Navigating to {form_url}...')
driver.get(form_url)
WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.TAG_NAME, 'body'))
)
# Fill form
driver.find_element(By.ID, 'name').send_keys('John Doe')
driver.find_element(By.ID, 'email').send_keys('[email protected]')
driver.find_element(By.ID, 'message').send_keys('Test message')
time.sleep(2)
# Check for reCAPTCHA
try:
recaptcha_element = driver.find_element(By.CSS_SELECTOR, '[data-sitekey]')
site_key = recaptcha_element.get_attribute('data-sitekey')
print(f'reCAPTCHA detected: {site_key}')
token = solve_recaptcha_v2(site_key, driver.current_url)
# Inject token
driver.execute_script(f"""
document.querySelector('textarea[name="g-recaptcha-response"]').value = '{token}';
if (window.grecaptcha && window.___grecaptcha_cfg) {{
const client = window.___grecaptcha_cfg.clients[0];
if (client && client.callback) {{
client.callback('{token}');
}}
}}
""")
print('Token injected')
time.sleep(1)
except:
print('No reCAPTCHA detected')
# Submit form
print('Submitting form...')
driver.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()
time.sleep(3)
print('Form submitted!')
except Exception as e:
print(f'Error: {e}')
finally:
driver.quit()
if __name__ == '__main__':
automate_form_with_recaptcha('https://example.com/contact')
Best Practices for reCAPTCHA v2 Automation
Use Realistic Browser Fingerprints
reCAPTCHA v2 analyzes browser fingerprints extensively. Use tools like puppeteer-extra-plugin-stealth to make your automation appear more like real browsers.
Implement Proper Delays
Don't rush through forms. Add random delays between actions to simulate human behavior. Use delays of 1-3 seconds between form field inputs.
Handle Token Expiration
reCAPTCHA v2 tokens expire after approximately 2 minutes. Use tokens immediately after receiving them from our API.
Implement proper error handling for expired tokens and retry logic when tokens are rejected.
Monitor Success Rates
Track your automation's success rates and solving times. Use this data to optimize your implementation and detect issues early.
Troubleshooting Common Issues
Token Rejected by Website
If websites reject your reCAPTCHA token, check timing first. Tokens must be used within their validity period. Also verify you're using the correct site key for the target page.
Ensure your browser fingerprint appears legitimate. reCAPTCHA may reject tokens if your browser characteristics are suspicious.
Site Key Not Found
reCAPTCHA site keys are usually found in the data-sitekey attribute of the reCAPTCHA div element. They can also be found in script tags or JavaScript initialization code.
Invisible reCAPTCHA Not Triggering
Invisible reCAPTCHA v2 requires proper triggering. Ensure you're calling the grecaptcha.execute() function or triggering the form submission that activates the invisible captcha.
High Failure Rate
High failure rates usually indicate browser fingerprint issues or automation detection. Review your setup and ensure you're following best practices for stealth automation.
Advanced Integration Patterns
Concurrent Solving
Handle multiple reCAPTCHA solving requests concurrently to improve throughput:
async function solveMultipleForms(urls) {
const results = await Promise.all(
urls.map(url => automateFormWithRecaptcha(url))
);
return results;
}
const urls = [
'https://example1.com/form',
'https://example2.com/form',
'https://example3.com/form'
];
solveMultipleForms(urls)
.then(results => console.log('All forms submitted:', results));
Retry Logic with Exponential Backoff
Implement smart retry logic:
async function solveWithRetry(siteUrl, siteKey, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await solveRecaptchaV2Token(siteUrl, siteKey);
} catch (error) {
if (i === maxRetries - 1) throw error;
const delay = Math.pow(2, i) * 1000;
console.log(`Retry ${i + 1} after ${delay}ms...`);
await new Promise(resolve => setTimeout(resolve, delay));
}
}
}
Legal and Ethical Considerations
When building automation tools with reCAPTCHA solving, respect website terms of service and applicable laws. Use automation for legitimate purposes such as:
Testing your own web applications and forms
Automating repetitive tasks with proper authorization
Building tools that enhance user experience with consent
Quality assurance and testing of web integrations
Always ensure your automation complies with applicable laws and website terms of service.
Performance Optimization
Connection Pooling
Reuse HTTP connections to our API to reduce latency and improve performance.
Caching
Cache site keys and other static data to reduce DOM queries and improve automation speed.
Async Processing
Structure your code to handle multiple operations concurrently when appropriate.
Getting Started
If you're building automation tools and need to handle reCAPTCHA v2, our service can help. We provide API access for headless automation and browser extensions for visible browser automation.
Check out our documentation for detailed integration examples. We have guides for all major automation frameworks including Puppeteer, Selenium, Playwright, and more.
Remember that successful automation requires attention to many details beyond captcha solving. Our team is here to help you build reliable systems.
Frequently Asked Questions
How long does reCAPTCHA v2 solving take?
Our API typically solves reCAPTCHA v2 in 10-30 seconds. This includes both checkbox and image challenge variants.
What's the success rate?
We maintain a 95%+ success rate for reCAPTCHA v2 challenges. Failed attempts don't consume your balance.
Can I use this for form automation?
Yes, many developers use our service for form automation projects. Ensure your automation complies with website terms of service and applicable laws.
Do I need proxies?
Proxies are not required for reCAPTCHA v2 solving, but they can improve success rates for high-volume automation by providing clean IP reputation.
Does it work with invisible reCAPTCHA v2?
Yes, our solution works with all reCAPTCHA v2 variants including checkbox, invisible, and image challenges.
Conclusion
Solving Google reCAPTCHA v2 is essential for modern web automation. MyDisct Solver provides the captcha solving capability you need to focus on building great automation tools.
By following best practices, using realistic browser fingerprints, and leveraging our API or browser extension, you can build reliable automation that works consistently with reCAPTCHA v2 protected sites.
Start your free trial today and see how MyDisct Solver can transform your automation projects.