January 20, 2024
Speed meets simplicityβlearn how to bypass reCAPTCHA in just seconds using CaptchaAI. This hands-on guide includes a full working code example to help you integrate CAPTCHA-solving into your project effortlessly.
Let’s be honest — few things are as annoying as watching your automation script fail just because it ran into a reCAPTCHA challenge. Whether you’re scraping data, automating logins, or testing forms, Google’s CAPTCHA system can bring everything to a halt.
But what if solving reCAPTCHA was as easy as sending an API request?
This guide walks you through a real-world code example of how to bypass reCAPTCHA v2 using CaptchaAI — an advanced CAPTCHA-solving API that turns frustrating puzzles into simple tokens you can use in seconds.
Before jumping into code, let’s understand the problem.
reCAPTCHA v2 comes in two main forms:
β
The checkbox: "I’m not a robot"
π§© The image challenge: “Select all boats, buses, or crosswalks”
While humans click boxes and pick images, CaptchaAI does it behind the scenes — instantly.
CaptchaAI is designed for developers who want:
Simple, developer-friendly API access
Flat monthly pricing (no pay-per-solve nonsense)
Support for reCAPTCHA v2, v3, and 27,000+ CAPTCHA types
Fast solving (6–10 seconds on average)
High accuracy, even on image challenges
Let’s put it to the test.
To solve reCAPTCHA with CaptchaAI, you need:
apikey: Your CaptchaAI API key
sitekey: The public reCAPTCHA key on the target site
pageurl: The full URL of the webpage where reCAPTCHA appears
Open the webpage with the CAPTCHA
Right-click → Inspect → Search for data-sitekey
Example:
Copy the data-sitekey. That’s what we’ll send to the API.
import time
import requests
API_KEY = 'your_captchaai_api_key' # π Replace with your actual CaptchaAI API key
SITEKEY = '6Lc_example_key' # β This is the reCAPTCHA site key from the target page
PAGEURL = 'https://example.com/login' # β The page where the CAPTCHA appears
# πΉ Step 1: Submit the CAPTCHA task
submit_payload = {
'key': API_KEY,
'method': 'userrecaptcha',
'googlekey': SITEKEY,
'pageurl': PAGEURL,
'json': 1
}
submit_response = requests.post('https://ocr.captchaai.com/in.php', data=submit_payload)
submit_result = submit_response.json()
if submit_result.get('status') != 1:
print("β Error submitting CAPTCHA:", submit_result.get('request'))
exit()
captcha_id = submit_result['request']
print("β CAPTCHA submitted successfully. ID:", captcha_id)
# πΉ Step 2: Poll for the solution
while True:
time.sleep(5) # Wait between polls
result_payload = {
'key': API_KEY,
'action': 'get',
'id': captcha_id,
'json': 1
}
result_response = requests.get('https://ocr.captchaai.com/res.php', params=result_payload)
result_data = result_response.json()
if result_data.get('status') == 1:
solved_token = result_data['request']
print("β CAPTCHA Solved! Token:", solved_token)
break
elif result_data.get('request') == 'CAPCHA_NOT_READY':
print("β³ Waiting for CAPTCHA to be solved...")
else:
print("β Error retrieving CAPTCHA result:", result_data.get('request'))
break
# πΉ Step 3: Use the token in your automation or form submission
# Example using Selenium:
# (inject token to hidden field where g-recaptcha-response is expected)
# driver.execute_script("""
# document.querySelector('textarea[name="g-recaptcha-response"]').style.display = 'block';
# document.querySelector('textarea[name="g-recaptcha-response"]').value = arguments[0];
# """, solved_token)
CaptchaAI works seamlessly with:
π§ͺ Selenium
π·οΈ Scrapy / BeautifulSoup
π§ Playwright
π§ Custom Python or Node.js bots
π Any backend that can send HTTP requests
Want to solve 100+ CAPTCHAs at once? CaptchaAI supports multithreaded solving with plans up to 5,000 threads.
Plan |
Threads |
Price/month |
Basic |
5 |
$15 |
Standard |
15 |
$30 |
Advanced |
50 |
$90 |
Enterprise |
200+ |
$300+ |
VIP |
1000+ |
Custom |
No per-CAPTCHA charges. Just unlimited solves per thread.
You don’t need to wrestle with reCAPTCHA anymore.
CaptchaAI turns complex CAPTCHA-solving into clean API logic that fits right into your code. With just a few lines, you can bypass Google’s reCAPTCHA system and keep your automation running 24/7.
βοΈ No images to click
βοΈ No browser emulation
βοΈ Just results — fast and reliable
π― Ready to solve CAPTCHAs like a pro?
π Sign up and get started with CaptchaAI
The 1st reCAPTCHA OCR Solver β Optimized for Savings.