Back to blogs
Troubleshooting

Common Grid Image CAPTCHA Errors and Fixes

Grid image CAPTCHA solving can fail due to image quality, format mismatches, or incorrect solution application. Here are the most common errors and how to resolve them.


Image submission errors

ERROR_WRONG_FILE_EXTENSION

Cause: The uploaded file is not a valid image format.

Fix:

  • Use PNG or JPEG format only
  • Verify the base64 string is properly encoded
  • Remove the data:image/...;base64, prefix before sending
# WRONG — includes data URI prefix
body = "data:image/png;base64,iVBORw0KGgo..."

# CORRECT — raw base64 only
body = "iVBORw0KGgo..."

ERROR_TOO_BIG_CAPTCHA_FILESIZE

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

Fix:

from PIL import Image
import io
import base64

# Resize if too large
img = Image.open("captcha.png")
if img.width > 600:
    ratio = 600 / img.width
    img = img.resize((600, int(img.height * ratio)), Image.LANCZOS)

buffer = io.BytesIO()
img.save(buffer, format="PNG")
b64 = base64.b64encode(buffer.getvalue()).decode()

ERROR_ZERO_CAPTCHA_FILESIZE

Cause: Empty file or failed image extraction.

Fix:

  • Verify the image element has loaded before extracting
  • Check that the src attribute is not empty
  • Wait for lazy-loaded images
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# Wait for image to load
WebDriverWait(driver, 10).until(
    lambda d: d.find_element(By.CSS_SELECTOR, ".captcha img").get_attribute("complete") == "true"
)

Solving errors

ERROR_CAPTCHA_UNSOLVABLE

Cause: The image is too blurry, distorted, or the objects are unrecognizable.

Fix:

  • Capture the image at full resolution — do not downscale
  • Ensure no overlays or watermarks obscure the grid
  • Retry with a fresh captcha (some challenges are inherently ambiguous)

Wrong cells identified

Cause: Low image quality or partial capture.

Fix:

  • Screenshot the entire captcha element, including borders
  • Do not crop too tightly — include a few pixels of margin
  • Verify by saving the captured image and reviewing it manually
# Take a proper element screenshot
captcha_el = driver.find_element(By.CSS_SELECTOR, "#captcha-container")
captcha_el.screenshot("debug_captcha.png")

# Open and check manually
from PIL import Image
Image.open("debug_captcha.png").show()

Solution application errors

Off-by-one index errors

Cause: Mismatch between 1-based API response and 0-based array indexing.

# API returns "1,3,5" (1-based)
solution = "1,3,5"
indices = [int(i) for i in solution.split(",")]

# DON'T: use directly as array index
# cells[1], cells[3], cells[5]  ← WRONG (off by one)

# DO: convert to 0-based
for idx in indices:
    cells[idx - 1].click()  # 1→0, 3→2, 5→4

Cells do not respond to clicks

Cause: Click target is wrong — overlay, iframe, or shadow DOM.

Fix:

# Check if captcha is in an iframe
iframes = driver.find_elements(By.TAG_NAME, "iframe")
for iframe in iframes:
    if "captcha" in iframe.get_attribute("src").lower():
        driver.switch_to.frame(iframe)
        break

# Now find and click cells
cells = driver.find_elements(By.CSS_SELECTOR, ".grid-cell")

Dynamic grid — tiles change after clicking

Cause: reCAPTCHA-style dynamic grids replace tiles.

Fix: Use the token method instead of the image method for reCAPTCHA:

# Token method handles dynamic grids automatically
response = requests.get("https://ocr.captchaai.com/in.php", params={
    "key": API_KEY,
    "method": "userrecaptcha",
    "googlekey": "SITE_KEY",
    "pageurl": "https://example.com",
    "json": 1
})

Timeout errors

Captcha expires before solution returns

Cause: Grid CAPTCHAs typically expire in 2–3 minutes.

Fix:

  • Submit the image immediately after capture
  • If the solve takes more than 60 seconds, refresh and retry

CAPCHA_NOT_READY loops indefinitely

Cause: The task may have failed silently.

Fix: Set a maximum retry count and handle failures:

for attempt in range(30):
    time.sleep(5)
    result = requests.get("https://ocr.captchaai.com/res.php", params={
        "key": API_KEY, "action": "get", "id": task_id, "json": 1
    }).json()

    if result.get("status") == 1:
        return result["request"]
    if result.get("request") not in ["CAPCHA_NOT_READY"]:
        break  # Actual error, stop polling

raise Exception("Grid captcha solve failed — refresh and retry")

Debugging checklist

Check Action
Image format? PNG or JPEG, properly encoded
Image size? Under 600KB
Full grid captured? Include entire grid with margins
Image quality? Clear, not blurred or scaled down
Solution format? Parse comma-separated indices correctly
Index base? Convert 1-based to 0-based for arrays
Iframe context? Switch to captcha iframe if present
Captcha expired? Submit immediately after capture

FAQ

What image format gives the best results?

PNG produces the best results because it is lossless. JPEG works but heavy compression can blur cell boundaries and reduce accuracy.

Should I include the instruction text with grid images?

For method=post with recaptcha=1, the instruction is not required — the solver identifies objects visually. For method=bls, always include the instruction text.

Can I solve multiple grid CAPTCHAs in parallel?

Yes. Each solve is independent. Submit multiple tasks and poll each one separately.

What if the grid has non-standard dimensions?

CaptchaAI analyzes the image as-is. Non-standard grids (e.g., 5×3, 2×4) are handled based on visual analysis rather than fixed grid assumptions.


Discussions (0)

No comments yet.

Related Posts

Comparisons Grid Image vs Normal Image CAPTCHA: API Parameter Differences
Compare Grid Image and Normal Image CAPTCHA types — different API parameters, response formats, and when to use each method with Captcha AI.

Compare Grid Image and Normal Image CAPTCHA types — different API parameters, response formats, and when to us...

Automation Image OCR Grid Image
Apr 09, 2026
Explainers How Grid Image CAPTCHAs Work
Understand how grid image CAPTCHAs work — the tile-based image challenges used by re CAPTCHA and other providers.

Understand how grid image CAPTCHAs work — the tile-based image challenges used by re CAPTCHA and other provide...

Automation Image OCR Grid Image
Apr 09, 2026
Troubleshooting Grid Image Coordinate Errors: Diagnosis and Fix
Fix grid image CAPTCHA coordinate errors when using Captcha AI.

Fix grid image CAPTCHA coordinate errors when using Captcha AI. Covers wrong grid size, cell numbering mismatc...

Python Automation Image OCR
Apr 09, 2026
API Tutorials Solve Grid Image CAPTCHA with Python and CaptchaAI
Step-by-step Python tutorial for solving grid image CAPTCHAs ( re CAPTCHA image challenges) using the Captcha AI API.

Step-by-step Python tutorial for solving grid image CAPTCHAs ( re CAPTCHA image challenges) using the Captcha...

Python Automation Image OCR
Apr 09, 2026
API Tutorials Solve Grid Image CAPTCHA with Node.js and CaptchaAI
Step-by-step Node.js tutorial for solving grid image CAPTCHAs using the Captcha AI API with Puppeteer.

Step-by-step Node.js tutorial for solving grid image CAPTCHAs using the Captcha AI API with Puppeteer. Include...

Automation Image OCR Grid Image
Apr 09, 2026
API Tutorials How to Solve Grid Image CAPTCHA Automatically
Step-by-step guide to solving grid image CAPTCHAs with Captcha AI API.

Step-by-step guide to solving grid image CAPTCHAs with Captcha AI API. Includes image capture, API submission,...

Automation Image OCR Grid Image
Apr 09, 2026
Explainers How Grid Image CAPTCHA Challenges Work
Understand how grid image CAPTCHAs work.

Understand how grid image CAPTCHAs work. Learn about grid formats, detection methods, and how to solve them wi...

Automation Image OCR Grid Image
Apr 09, 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 Cloudflare Turnstile reCAPTCHA v2
Apr 09, 2026
Tutorials Grid Image CAPTCHA: Coordinate Mapping and Cell Selection
Map grid image CAPTCHA cells to coordinates, extract the full grid, and solve re CAPTCHA-style image challenges with Captcha AI.

Map grid image CAPTCHA cells to coordinates, extract the full grid, and solve re CAPTCHA-style image challenge...

Python Web Scraping Image OCR
Apr 09, 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...

Python Automation Cloudflare Turnstile
Apr 09, 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 09, 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 09, 2026