Troubleshooting

Fix ERROR_CAPTCHA_UNSOLVABLE

ERROR_CAPTCHA_UNSOLVABLE means CaptchaAI's workers couldn't solve the CAPTCHA challenge. This guide covers why it happens and how to fix it.

Common Causes

Cause Likelihood Fix
Expired or stale challenge High Request a fresh CAPTCHA and retry
Invalid sitekey Medium Verify the sitekey from page source
Wrong method parameter Medium Match method to CAPTCHA type
Corrupted or unreadable image Medium Check image encoding
Honeypot CAPTCHA Low Skip — it's designed to be unsolvable
Site-specific anti-bot Low Add cookies, user-agent, or proxy

Diagnosis Steps

Step 1: Check Your Parameters

Verify you're using the correct method and parameters:

# ✅ Correct reCAPTCHA v2
params = {
    "method": "userrecaptcha",
    "googlekey": "6Le-wvkS...",       # Must match site
    "pageurl": "https://example.com",  # Must be exact page URL
}

# ❌ Common mistakes
params = {
    "method": "recaptcha",        # Wrong method name
    "googlekey": "wrong_key",     # Stale or wrong sitekey
    "pageurl": "example.com",     # Missing protocol
}

Step 2: Verify the Sitekey

Extract the sitekey from the live page:

import requests
import re

resp = requests.get("https://example.com")
match = re.search(r'data-sitekey=["\']([A-Za-z0-9_-]+)["\']', resp.text)
if match:
    print(f"Sitekey: {match.group(1)}")
else:
    print("No reCAPTCHA found on page")

Sites can change sitekeys. Always extract dynamically rather than hardcoding.

Step 3: Check for Fresh Challenge

For reCAPTCHA, the challenge must be current. Submit immediately after loading the page:

# ✅ Good: fetch page, extract key, solve immediately
resp = requests.get("https://example.com/form")
site_key = extract_sitekey(resp.text)
token = solve_captcha(site_key, "https://example.com/form")

# ❌ Bad: using a sitekey from hours ago
old_site_key = "saved_from_yesterday"
token = solve_captcha(old_site_key, url)  # May be unsolvable

Step 4: Check Image Quality (for Image CAPTCHAs)

import base64

with open("captcha.png", "rb") as f:
    data = f.read()

# Verify it's a valid image
if len(data) < 100:
    print("Image too small — likely corrupted")
elif len(data) > 100000:
    print("Image too large — compress before sending")
else:
    print(f"Image OK: {len(data)} bytes")

# Verify base64 encoding
b64 = base64.b64encode(data).decode()
decoded = base64.b64decode(b64)
assert decoded == data, "Base64 encoding mismatch"

Retry Strategy

Implement automatic retry with a fresh challenge:

import requests
import time

API_KEY = "YOUR_API_KEY"


def solve_with_retry(params, max_retries=3):
    for attempt in range(max_retries):
        # Submit
        resp = requests.get("https://ocr.captchaai.com/in.php", params={
            **params, "key": API_KEY,
        })

        if not resp.text.startswith("OK|"):
            if resp.text == "ERROR_CAPTCHA_UNSOLVABLE":
                print(f"Unsolvable (attempt {attempt + 1}), retrying...")
                time.sleep(2)
                continue
            raise Exception(f"Submit error: {resp.text}")

        task_id = resp.text.split("|")[1]

        # Poll
        for _ in range(60):
            time.sleep(5)
            result = requests.get("https://ocr.captchaai.com/res.php", params={
                "key": API_KEY, "action": "get", "id": task_id,
            })

            if result.text == "CAPCHA_NOT_READY":
                continue
            if result.text.startswith("OK|"):
                return result.text.split("|", 1)[1]
            if result.text == "ERROR_CAPTCHA_UNSOLVABLE":
                print(f"Unsolvable during solve (attempt {attempt + 1})")
                break
            raise Exception(f"Poll error: {result.text}")

    raise Exception(f"Unsolvable after {max_retries} attempts")

When to Stop Retrying

  • After 3 retries: The CAPTCHA may be a honeypot or deliberately unsolvable
  • If sitekey doesn't match: Fix the sitekey instead of retrying
  • If the site has changed: Update your scraper to handle new page structure

Report Unsolvable CAPTCHAs

Help improve CaptchaAI's accuracy by reporting problematic CAPTCHAs:

def report_bad(task_id):
    requests.get("https://ocr.captchaai.com/res.php", params={
        "key": API_KEY,
        "action": "reportbad",
        "id": task_id,
    })

FAQ

Does ERROR_CAPTCHA_UNSOLVABLE cost me?

No. You are not charged for unsolvable CAPTCHAs. Only successful solves are billed.

Why does the same CAPTCHA type work sometimes and fail other times?

CAPTCHAs have varying difficulty. Some challenges are harder for workers. Retrying with a fresh challenge usually succeeds.

Is there a way to prevent this error?

Use correct parameters, fresh sitekeys, and include cookies/user-agent for context. This reduces unsolvable rates to <2%.

Discussions (0)

No comments yet.