Troubleshooting

CAPTCHA_NOT_READY: Timeout and Polling Strategy Guide

CAPCHA_NOT_READY is not an error — it means CaptchaAI is still solving. The key is polling at the right interval and setting appropriate timeouts per CAPTCHA type.


Understanding CAPCHA_NOT_READY

When you poll res.php and receive CAPCHA_NOT_READY, the task is still being processed. This is normal behavior, not a failure.

{"status": 0, "request": "CAPCHA_NOT_READY"}

What to do: Wait and poll again. Don't resubmit.


CAPTCHA Type Typical Solve Time Recommended Timeout Poll Interval
Image/OCR 2-8 seconds 30 seconds 3 seconds
reCAPTCHA v2 10-30 seconds 90 seconds 5 seconds
reCAPTCHA v3 8-20 seconds 60 seconds 5 seconds
Invisible reCAPTCHA 10-30 seconds 90 seconds 5 seconds
reCAPTCHA Enterprise 15-45 seconds 120 seconds 5 seconds
Cloudflare Turnstile 5-15 seconds 60 seconds 5 seconds
GeeTest v3 10-30 seconds 90 seconds 5 seconds
BLS 5-20 seconds 60 seconds 5 seconds

Optimal Polling Implementation

import time
import requests


# Type-specific settings
POLL_CONFIG = {
    "base64": {"timeout": 30, "interval": 3, "first_check": 5},
    "post": {"timeout": 30, "interval": 3, "first_check": 5},
    "userrecaptcha": {"timeout": 90, "interval": 5, "first_check": 15},
    "turnstile": {"timeout": 60, "interval": 5, "first_check": 10},
    "geetest": {"timeout": 90, "interval": 5, "first_check": 15},
    "bls": {"timeout": 60, "interval": 5, "first_check": 10},
}


def poll_result(api_key, task_id, method="userrecaptcha"):
    """Poll for result with type-appropriate timing."""
    config = POLL_CONFIG.get(method, {"timeout": 90, "interval": 5, "first_check": 15})

    # Wait before first poll (CAPTCHA can't be solved instantly)
    time.sleep(config["first_check"])

    start = time.time()
    poll_count = 0

    while time.time() - start < config["timeout"]:
        resp = requests.get("https://ocr.captchaai.com/res.php", params={
            "key": api_key,
            "action": "get",
            "id": task_id,
            "json": 1,
        }, timeout=15)
        data = resp.json()
        poll_count += 1

        if data["request"] == "CAPCHA_NOT_READY":
            time.sleep(config["interval"])
            continue

        if data.get("status") == 1:
            elapsed = time.time() - start
            print(f"Solved in {elapsed:.1f}s ({poll_count} polls)")
            return data["request"]

        # Actual error
        raise RuntimeError(f"Solve error: {data['request']}")

    raise TimeoutError(
        f"Timeout after {config['timeout']}s ({poll_count} polls)"
    )

Common Mistakes

Mistake 1: Polling Too Frequently

# BAD — polling every 1 second wastes resources
while True:
    time.sleep(1)  # Too fast
    result = check(task_id)

# GOOD — 5 second interval
while True:
    time.sleep(5)  # Appropriate
    result = check(task_id)

Mistake 2: Polling Immediately After Submit

# BAD — first poll at 0 seconds
task_id = submit(...)
result = poll(task_id)  # Immediately polls, wastes a call

# GOOD — wait before first poll
task_id = submit(...)
time.sleep(15)  # Wait for solver to start
result = poll(task_id)

Mistake 3: Timeout Too Short

# BAD — gives up after 20 seconds (many CAPTCHAs take longer)
for _ in range(4):  # 4 × 5s = 20s
    time.sleep(5)
    # ...

# GOOD — adequate timeout
for _ in range(18):  # 18 × 5s = 90s
    time.sleep(5)
    # ...

Mistake 4: Resubmitting on NOT_READY

# BAD — submitting a new task when the old one is still working
if result == "CAPCHA_NOT_READY":
    new_task = submit(...)  # Don't do this

# GOOD — keep polling the same task
if result == "CAPCHA_NOT_READY":
    time.sleep(5)
    continue

Adaptive Polling

Start slow, speed up as expected solve time approaches:

def adaptive_poll(api_key, task_id, expected_time=30, timeout=120):
    """Poll with adaptive intervals."""
    start = time.time()

    # Phase 1: Wait before first poll
    time.sleep(min(expected_time * 0.5, 15))

    interval = 5  # Start at 5s intervals

    while time.time() - start < timeout:
        resp = requests.get("https://ocr.captchaai.com/res.php", params={
            "key": api_key, "action": "get",
            "id": task_id, "json": 1,
        }, timeout=15)
        data = resp.json()

        if data["request"] != "CAPCHA_NOT_READY":
            if data.get("status") == 1:
                return data["request"]
            raise RuntimeError(data["request"])

        elapsed = time.time() - start

        # After expected time, poll more frequently
        if elapsed > expected_time:
            interval = 3
        # After 2x expected, even more frequently
        if elapsed > expected_time * 2:
            interval = 2

        time.sleep(interval)

    raise TimeoutError("Poll timeout")

Troubleshooting

Issue Cause Fix
Always times out Timeout too short Match timeout to CAPTCHA type (see table)
Excessive API calls Polling too frequently Use 5s intervals minimum
First poll succeeds Image CAPTCHA is fast Reduce first_check for image types
Solve takes > 90 seconds Complex CAPTCHA / high load Increase timeout; check during off-peak

FAQ

How long should I wait before the first poll?

Wait 10-15 seconds for reCAPTCHA/Turnstile, 5 seconds for image CAPTCHAs. Polling before the solver even starts is wasted.

Is there a maximum number of polls allowed?

No hard limit on poll requests, but excessive polling (every 1 second) may trigger rate limiting. Use 5-second intervals.

What if CAPCHA_NOT_READY continues beyond the timeout?

The task likely failed to match a solver. Set a reasonable timeout and submit a new task if the original times out.



Poll smarter — start with CaptchaAI.

Discussions (0)

No comments yet.