import re
def detect_captcha_type(page_source, page_url=""):
"""Detect CAPTCHA type from page HTML and return recommended method."""
checks = [
(r'data-sitekey.*cf-turnstile|class=["\']cf-turnstile', "turnstile"),
(r'challenge-platform.*managed|cf-chl-widget', "cloudflare_challenge"),
(r'data-sitekey.*h-captcha|class=["\']h-captcha', "hcaptcha"),
(r'initGeetest4|captcha_id', "geetest_v4"),
(r'initGeetest|gt=\w{32}', "geetest_v3"),
(r'data-sitekey.*recaptcha|grecaptcha|recaptcha/api', "recaptcha"),
(r'bls.*captcha|captcha.*bls', "bls"),
(r'captcha.*img|img.*captcha|captchaImage', "image_ocr"),
]
for pattern, captcha_type in checks:
if re.search(pattern, page_source, re.IGNORECASE):
return captcha_type
return "unknown"
# Usage
captcha_type = detect_captcha_type(page_html)
print(f"Detected: {captcha_type}")
FAQ
Does CaptchaAI support all reCAPTCHA versions?
Yes — v2 checkbox, v2 invisible, v3 score-based, and Enterprise are all supported with the same userrecaptcha method.
What's the fastest CAPTCHA type to solve?
Image/OCR CAPTCHAs typically solve in 5-15 seconds. Turnstile and GeeTest are the fastest among token-based types.
Can I solve multiple CAPTCHA types in one project?
Yes. Use the type detection helper above to identify the CAPTCHA, then submit with the appropriate method parameter. CaptchaAI handles routing internally.
Deploy and manage Captcha AI workers with Ansible — playbooks for provisioning, configuration, rolling updates, and health checks across your server fleet.
Complete decision tree for every Captcha AI API error. Learn which errors are retryable, which need parameter...
AutomationPythonAll CAPTCHA Types
Mar 17, 2026
Tutorials
How to use Fiddler Everywhere and Fiddler Classic to capture, inspect, and debug Captcha AI API requests and responses — filters, breakpoints, and replay for tr...
Handle CAPTCHAs in mobile app automation using Appium and Captcha AI — extract Web View sitekeys, solve, and i...
AutomationPythonAll CAPTCHA Types
Feb 13, 2026
Tutorials
Process CAPTCHA solutions the moment they arrive instead of waiting for tasks to complete — use async generators, event emitters, and callback patterns for stre...
Process CAPTCHA solutions the moment they arrive instead of waiting for all tasks to complete — use async gene...
AutomationPythonAll CAPTCHA Types
Apr 07, 2026
Reference
A reference for building and using a Captcha AI command-line tool — solve CAPTCHAs, check balance, test parameters, and integrate with shell scripts and CI/CD p...
Discussions (0)
Join the conversation
Sign in to share your opinion.
Sign InNo comments yet.