Troubleshooting

Common OCR CAPTCHA Errors and Fixes

Image/text CAPTCHA solving can fail due to image quality, format issues, or incorrect hint parameters. Here is how to diagnose and fix the most common errors.


Submission errors

ERROR_WRONG_FILE_EXTENSION

Cause: The image is not in a supported format or the base64 is invalid.

Fix:

import base64

# Ensure proper encoding
with open("captcha.png", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

# Don't include the data URI prefix
# WRONG: "data:image/png;base64,iVBOR..."
# RIGHT: "iVBOR..."

ERROR_ZERO_CAPTCHA_FILESIZE

Cause: The image file is empty or the download failed.

Fix:

import os

# Check file size before submitting
if os.path.getsize("captcha.png") == 0:
    print("Image file is empty — re-download")
    # Re-capture the captcha

ERROR_TOO_BIG_CAPTCHA_FILESIZE

Cause: Image exceeds maximum size (typically 600KB).

Fix:

from PIL import Image
import io

img = Image.open("captcha.png")
# Reduce quality without losing text clarity
buffer = io.BytesIO()
img.save(buffer, format="PNG", optimize=True)

Wrong text returned

Characters consistently misread

Cause: The solver confuses similar characters (0/O, 1/l/I, 5/S).

Fix: Use hint parameters to constrain the character set:

# If captcha is digits only
response = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": API_KEY, "method": "base64", "body": b64,
    "numeric": 1,  # 1 = digits only
    "json": 1
})

# If captcha is letters only
response = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": API_KEY, "method": "base64", "body": b64,
    "numeric": 2,  # 2 = letters only
    "json": 1
})

Wrong case (uppercase vs lowercase)

Cause: The solver defaults to lowercase.

Fix: Set regsense=1 to enable case sensitivity:

response = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": API_KEY, "method": "base64", "body": b64,
    "regsense": 1,  # Case-sensitive
    "json": 1
})

Extra or missing characters

Cause: Noise is interpreted as characters, or characters are merged.

Fix: Set min/max length constraints:

# If you know the CAPTCHA is always 6 characters
response = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": API_KEY, "method": "base64", "body": b64,
    "min_len": 6,
    "max_len": 6,
    "json": 1
})

Math expression not computed

Cause: The solver reads the text "3+7" instead of computing the answer "10".

Fix: Set calc=1:

response = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": API_KEY, "method": "base64", "body": b64,
    "calc": 1,  # Compute the math expression
    "json": 1
})

Image quality issues

CAPTCHA too small

Problem: Very small images (under 50px height) lose character detail.

Fix: Capture at the largest available size. If the page renders the captcha small, check for a higher-resolution source URL:

# Check for higher-res version
img_src = captcha_el.get_attribute("src")
# Some sites use ?size=small — try removing or changing the parameter
high_res_src = img_src.replace("size=small", "size=large")

CAPTCHA is animated

Problem: Some CAPTCHAs use animated GIFs where the text is only visible in certain frames.

Fix: Extract the correct frame:

from PIL import Image

gif = Image.open("captcha.gif")
# Extract each frame and find the one with text
for i in range(gif.n_frames):
    gif.seek(i)
    gif.save(f"frame_{i}.png")

CAPTCHA has transparent background

Problem: PNG with transparent background may not render correctly for OCR.

Fix: Add a white background:

from PIL import Image

img = Image.open("captcha.png").convert("RGBA")
background = Image.new("RGBA", img.size, (255, 255, 255, 255))
background.paste(img, mask=img)
background.convert("RGB").save("captcha_white_bg.png")

Reporting incorrect solutions

If CaptchaAI returns the wrong text, report it:

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

This improves solver accuracy and may refund the solve cost.


Accuracy improvement checklist

Parameter When to use Effect
numeric=1 Digits only Eliminates letter/digit confusion
numeric=2 Letters only Eliminates letter/digit confusion
min_len / max_len Known length Prevents extra/missing characters
regsense=1 Case matters Preserves uppercase/lowercase
calc=1 Math expression Returns computed answer
phrase=1 Contains spaces Allows multi-word answers
language=1 Cyrillic text Uses correct character set
language=2 Latin text Uses correct character set

FAQ

Why is my CAPTCHA always wrong by one character?

Use min_len and max_len to constrain the answer length. Also verify the image quality — blurry images cause misreads.

Should I use file upload or base64?

Both work equally well. Base64 is convenient for programmatic use; file upload works better with multipart form tools.

How do I solve CAPTCHAs in other languages?

Set the language parameter: 1 for Cyrillic, 2 for Latin. For other scripts, omit the parameter and let the solver detect automatically.

Can I solve audio CAPTCHAs with this method?

No. Audio CAPTCHAs require a different solving approach. Check CaptchaAI documentation for audio CAPTCHA support.


Discussions (0)

No comments yet.

Related Posts

Explainers How Image CAPTCHA Solving Works (OCR)
how image CAPTCHA solving works using OCR.

Learn how image CAPTCHA solving works using OCR. Understand text recognition, distortion techniques, and why A...

Automation Image OCR
Feb 18, 2026
Tutorials Image CAPTCHA Confidence Scores: Using CaptchaAI Quality Metrics
how to use Captcha AI's confidence indicators for image CAPTCHA solutions — assess answer quality, implement confidence-based retry logic, and optimize solve ra...

Learn how to use Captcha AI's confidence indicators for image CAPTCHA solutions — assess answer quality, imple...

Automation Python Image OCR
Mar 30, 2026
API Tutorials Solve Image CAPTCHA with Python OCR and CaptchaAI
Solve distorted text image CAPTCHAs using Captcha AI's OCR API from Python.

Solve distorted text image CAPTCHAs using Captcha AI's OCR API from Python. Covers file upload, base 64 submis...

Automation Python Image OCR
Use Cases Government Portal Automation with CAPTCHA Solving
Automate government portal interactions (visa applications, permit filings, records requests) with Captcha AI handling CAPTCHA challenges.

Automate government portal interactions (visa applications, permit filings, records requests) with Captcha AI...

Automation Python reCAPTCHA v2
Jan 30, 2026
API Tutorials Batch Image CAPTCHA Solving: Processing 1000+ Images
Process thousands of image CAPTCHAs efficiently with Captcha AI using async queues, worker pools, and rate-aware batching in Python and Node.js.

Process thousands of image CAPTCHAs efficiently with Captcha AI using async queues, worker pools, and rate-awa...

Automation Python Image OCR
Mar 21, 2026
Tutorials CAPTCHA Solving Fallback Chains
Implement fallback chains for CAPTCHA solving with Captcha AI.

Implement fallback chains for CAPTCHA solving with Captcha AI. Cascade through solver methods, proxy pools, an...

Automation Python reCAPTCHA v2
Apr 06, 2026
API Tutorials CaptchaAI API Latency Optimization: Faster Solves
Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, and proxy selection.

Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, an...

Automation Python reCAPTCHA v2
Feb 27, 2026
API Tutorials Building a Python Wrapper Library for CaptchaAI API
Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers, and support for CAPTCHA types.

Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers,...

Automation Python reCAPTCHA v2
Jan 31, 2026
API Tutorials Solving CAPTCHAs with Swift and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with URLSession, async/await, and Alamofire.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Apr 05, 2026
Troubleshooting GeeTest v3 Error Codes: Complete Troubleshooting Reference
Complete reference for Gee Test v 3 error codes — from registration failures to validation errors — with causes, fixes, and Captcha AI-specific troubleshooting.

Complete reference for Gee Test v 3 error codes — from registration failures to validation errors — with cause...

Automation Testing GeeTest v3
Apr 08, 2026
Troubleshooting Turnstile Token Invalid After Solving: Diagnosis and Fixes
Fix Cloudflare Turnstile tokens that come back invalid after solving with Captcha AI.

Fix Cloudflare Turnstile tokens that come back invalid after solving with Captcha AI. Covers token expiry, sit...

Python Cloudflare Turnstile Web Scraping
Apr 08, 2026
Troubleshooting Common GeeTest v3 Errors and Fixes
Diagnose the most common Gee Test v 3 errors — stale challenge, bad parameters, validation failures — and fix them with practical troubleshooting steps.

Diagnose the most common Gee Test v 3 errors — stale challenge, bad parameters, validation failures — and fix...

Automation Testing GeeTest v3
Jan 24, 2026