Comparisons

Migrate from Anti-Captcha to CaptchaAI Step by Step

Anti-Captcha uses a custom JSON task-based API. CaptchaAI uses the simpler, widely-adopted 2Captcha-compatible format. This guide provides exact code replacements for every CAPTCHA type.


API Format Differences

Anti-Captcha:
  Submit: POST /createTask (JSON body)
  Poll:   POST /getTaskResult (JSON body)
  Format: Task objects with "type" field

CaptchaAI:
  Submit: POST /in.php (form data or JSON)
  Poll:   GET /res.php (query parameters)
  Format: Flat key-value with "method" field

Step 1: Get CaptchaAI Credentials

  1. Register at captchaai.com
  2. Add funds
  3. Copy your API key

Step 2: Migrate reCAPTCHA v2

Anti-Captcha (Before)

import requests
import time

ANTICAPTCHA_KEY = "your_anticaptcha_key"

# Submit
resp = requests.post("https://api.anti-captcha.com/createTask", json={
    "clientKey": ANTICAPTCHA_KEY,
    "task": {
        "type": "RecaptchaV2TaskProxyless",
        "websiteURL": "https://example.com",
        "websiteKey": "SITE_KEY",
    }
})
task_id = resp.json()["taskId"]

# Poll
while True:
    time.sleep(5)
    result = requests.post("https://api.anti-captcha.com/getTaskResult", json={
        "clientKey": ANTICAPTCHA_KEY,
        "taskId": task_id,
    })
    data = result.json()
    if data["status"] == "ready":
        token = data["solution"]["gRecaptchaResponse"]
        break

CaptchaAI (After)

import requests
import time

CAPTCHAAI_KEY = "your_captchaai_key"

# Submit
resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "userrecaptcha",
    "googlekey": "SITE_KEY",
    "pageurl": "https://example.com",
    "json": 1,
})
task_id = resp.json()["request"]

# Poll
while True:
    time.sleep(5)
    result = requests.get("https://ocr.captchaai.com/res.php", params={
        "key": CAPTCHAAI_KEY,
        "action": "get",
        "id": task_id,
        "json": 1,
    })
    data = result.json()
    if data["request"] != "CAPCHA_NOT_READY":
        token = data["request"]
        break

Step 3: Migrate reCAPTCHA v3

Anti-Captcha (Before)

resp = requests.post("https://api.anti-captcha.com/createTask", json={
    "clientKey": ANTICAPTCHA_KEY,
    "task": {
        "type": "RecaptchaV3TaskProxyless",
        "websiteURL": "https://example.com",
        "websiteKey": "SITE_KEY",
        "minScore": 0.7,
        "pageAction": "login",
    }
})

CaptchaAI (After)

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "userrecaptcha",
    "version": "v3",
    "googlekey": "SITE_KEY",
    "pageurl": "https://example.com",
    "action": "login",
    "min_score": "0.7",
    "json": 1,
})

Step 4: Migrate Cloudflare Turnstile

Anti-Captcha (Before)

resp = requests.post("https://api.anti-captcha.com/createTask", json={
    "clientKey": ANTICAPTCHA_KEY,
    "task": {
        "type": "TurnstileTaskProxyless",
        "websiteURL": "https://example.com",
        "websiteKey": "TURNSTILE_KEY",
    }
})

CaptchaAI (After)

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "turnstile",
    "sitekey": "TURNSTILE_KEY",
    "pageurl": "https://example.com",
    "json": 1,
})

Step 5: Migrate Image CAPTCHA

Anti-Captcha (Before)

import base64

with open("captcha.png", "rb") as f:
    body = base64.b64encode(f.read()).decode()

resp = requests.post("https://api.anti-captcha.com/createTask", json={
    "clientKey": ANTICAPTCHA_KEY,
    "task": {
        "type": "ImageToTextTask",
        "body": body,
    }
})

CaptchaAI (After)

import base64

with open("captcha.png", "rb") as f:
    body = base64.b64encode(f.read()).decode()

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "base64",
    "body": body,
    "json": 1,
})

Step 6: Migrate GeeTest

Anti-Captcha (Before)

resp = requests.post("https://api.anti-captcha.com/createTask", json={
    "clientKey": ANTICAPTCHA_KEY,
    "task": {
        "type": "GeeTestTaskProxyless",
        "websiteURL": "https://example.com",
        "gt": "GT_KEY",
        "challenge": "CHALLENGE_VALUE",
    }
})

CaptchaAI (After)

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "geetest",
    "gt": "GT_KEY",
    "challenge": "CHALLENGE_VALUE",
    "pageurl": "https://example.com",
    "json": 1,
})

Step 7: New Features After Migration

After switching, you gain access to CAPTCHA types Anti-Captcha doesn't support:

Cloudflare Challenge

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "cloudflare_challenge",
    "pageurl": "https://cloudflare-protected.example.com",
    "sitekey": "CHALLENGE_KEY",
    "json": 1,
})

BLS CAPTCHA

resp = requests.post("https://ocr.captchaai.com/in.php", data={
    "key": CAPTCHAAI_KEY,
    "method": "bls",
    "pageurl": "https://bls-portal.example.com",
    "sitekey": "BLS_SITE_KEY",
    "json": 1,
})

Complete Migration Wrapper

Replace Anti-Captcha calls with this unified wrapper:

import requests
import time


class CaptchaAISolver:
    """Drop-in replacement for Anti-Captcha API calls."""

    def __init__(self, api_key):
        self.api_key = api_key
        self.base = "https://ocr.captchaai.com"

    def solve(self, method, **params):
        """Submit and poll for any CAPTCHA type."""
        data = {"key": self.api_key, "method": method, "json": 1}
        data.update(params)

        resp = requests.post(f"{self.base}/in.php", data=data, timeout=30)
        resp.raise_for_status()
        result = resp.json()

        if result.get("status") != 1:
            raise RuntimeError(f"Submit failed: {result.get('request')}")

        return self._poll(result["request"])

    def _poll(self, task_id, timeout=120):
        start = time.time()
        while time.time() - start < timeout:
            time.sleep(5)
            resp = requests.get(f"{self.base}/res.php", params={
                "key": self.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(f"Solve error: {data['request']}")
        raise TimeoutError("Poll timeout")

    def recaptcha_v2(self, sitekey, url):
        return self.solve("userrecaptcha", googlekey=sitekey, pageurl=url)

    def recaptcha_v3(self, sitekey, url, action="verify", min_score=0.7):
        return self.solve(
            "userrecaptcha", version="v3", googlekey=sitekey,
            pageurl=url, action=action, min_score=str(min_score),
        )

    def turnstile(self, sitekey, url):
        return self.solve("turnstile", sitekey=sitekey, pageurl=url)

    def geetest(self, gt, challenge, url):
        return self.solve("geetest", gt=gt, challenge=challenge, pageurl=url)

    def image(self, base64_body):
        return self.solve("base64", body=base64_body)

    def bls(self, sitekey, url):
        return self.solve("bls", sitekey=sitekey, pageurl=url)

    def balance(self):
        resp = requests.get(f"{self.base}/res.php", params={
            "key": self.api_key, "action": "getbalance", "json": 1,
        })
        return float(resp.json()["request"])


# Usage — replaces all Anti-Captcha calls
solver = CaptchaAISolver("your_captchaai_key")

# reCAPTCHA v2
token = solver.recaptcha_v2("SITE_KEY", "https://example.com")

# Turnstile
token = solver.turnstile("SITE_KEY", "https://example.com")

# Balance
print(f"Balance: ${solver.balance():.2f}")

Parameter Mapping Reference

Anti-Captcha CaptchaAI Notes
clientKey key API key
task.type method CAPTCHA type identifier
task.websiteURL pageurl Target page URL
task.websiteKey googlekey or sitekey Site key
task.minScore min_score v3 minimum score
task.pageAction action v3 action string
task.body body Base64 image data
task.gt gt GeeTest key
task.challenge challenge GeeTest challenge
taskId id Task ID for polling

Troubleshooting

Issue Cause Fix
ERROR_WRONG_USER_KEY Using Anti-Captcha key Register at CaptchaAI for new key
JSON body rejected Sending JSON task objects Use form data with flat key-value pairs
Missing method field Using type from Anti-Captcha Replace with CaptchaAI method names
Wrong poll endpoint POST to /getTaskResult GET to /res.php with query params

FAQ

Is the migration harder than switching from 2Captcha?

Slightly, because the API formats differ. But the core logic is the same (submit → poll → get result). Use the wrapper class above for a clean migration.

Can I keep Anti-Captcha as a fallback?

Yes. Run both in parallel and route based on CAPTCHA type or priority. CaptchaAI handles Cloudflare Challenge and BLS that Anti-Captcha doesn't support.

Do I need to change my proxy configuration?

The proxy parameter format differs. In CaptchaAI, use proxy=user:pass@host:port and proxytype=HTTP as flat parameters instead of Anti-Captcha's nested proxy object.



Switch to better Cloudflare and BLS support — start with CaptchaAI.

Discussions (0)

No comments yet.

Related Posts

Comparisons Migrate from CapSolver to CaptchaAI Step by Step
Step-by-step guide to migrate from Cap Solver to Captcha AI.

Step-by-step guide to migrate from Cap Solver to Captcha AI. API differences, code examples, and why Captcha A...

Python Automation All CAPTCHA Types
Feb 23, 2026
Comparisons Migrate from 2Captcha to CaptchaAI Step by Step
Complete step-by-step migration guide from 2 Captcha to Captcha AI.

Complete step-by-step migration guide from 2 Captcha to Captcha AI. Same API format — change the URL and API k...

Python Automation All CAPTCHA Types
Feb 23, 2026
Explainers CaptchaAI JSON API vs Form API: Which Format to Use
Compare Captcha AI's JSON and form-encoded API formats.

Compare Captcha AI's JSON and form-encoded API formats. Learn when to use each, with code examples in Python a...

Python Automation All CAPTCHA Types
Feb 20, 2026
Reference Migrate from AZCaptcha to CaptchaAI: Complete Guide
Step-by-step migration from AZCaptcha to Captcha AI — endpoint mapping, parameter differences, code changes, and parallel testing for a safe transition.

Step-by-step migration from AZCaptcha to Captcha AI — endpoint mapping, parameter differences, code changes, a...

Python Automation All CAPTCHA Types
Feb 09, 2026
Comparisons Parallel vs Sequential CAPTCHA Solving: Performance Trade-offs
Compare parallel and sequential CAPTCHA solving approaches — throughput, resource usage, cost, and complexity trade-offs with Captcha AI examples.

Compare parallel and sequential CAPTCHA solving approaches — throughput, resource usage, cost, and complexity...

Python Automation All CAPTCHA Types
Feb 01, 2026
Reference Migrate from NextCaptcha to CaptchaAI: Complete Guide
Migrate from Next Captcha to Captcha AI — endpoint mapping, parameter translation, code examples in Python and Java Script, and a parallel testing strategy.

Migrate from Next Captcha to Captcha AI — endpoint mapping, parameter translation, code examples in Python and...

Python Automation All CAPTCHA Types
Jan 30, 2026
Comparisons Token-Based vs Cookie-Based CAPTCHA Solving
Understand the difference between token-based and cookie-based CAPTCHA solving — when to use each approach, how they work, and implementation examples.

Understand the difference between token-based and cookie-based CAPTCHA solving — when to use each approach, ho...

Python Automation All CAPTCHA Types
Jan 25, 2026
Reference Migrate from EndCaptcha to CaptchaAI: API Mapping Guide
Map End Captcha API calls to Captcha AI equivalents — endpoint changes, parameter differences, code examples, and a step-by-step migration plan.

Map End Captcha API calls to Captcha AI equivalents — endpoint changes, parameter differences, code examples,...

Python Automation All CAPTCHA Types
Jan 20, 2026
DevOps & Scaling Blue-Green Deployment for CAPTCHA Solving Infrastructure
Implement blue-green deployments for CAPTCHA solving infrastructure — zero-downtime upgrades, traffic switching, and rollback strategies with Captcha AI.

Implement blue-green deployments for CAPTCHA solving infrastructure — zero-downtime upgrades, traffic switchin...

Python Automation All CAPTCHA Types
Apr 07, 2026
DevOps & Scaling Ansible Playbooks for CaptchaAI Worker Deployment
Deploy and manage Captcha AI workers with Ansible — playbooks for provisioning, configuration, rolling updates, and health checks across your server fleet.

Deploy and manage Captcha AI workers with Ansible — playbooks for provisioning, configuration, rolling updates...

Python Automation All CAPTCHA Types
Apr 07, 2026
Comparisons reCAPTCHA v2 vs v3 Explained
Compare re CAPTCHA v 2 and v 3 side by side.

Compare re CAPTCHA v 2 and v 3 side by side. Learn how each version works, their detection methods, and how to...

Automation reCAPTCHA v3 Migration
Mar 19, 2026
Comparisons Turnstile vs hCaptcha vs reCAPTCHA: Three-Way Comparison
Compare Cloudflare Turnstile, h Captcha, and re CAPTCHA side by side — UX, difficulty, implementation, and how Captcha AI handles each.

Compare Cloudflare Turnstile, h Captcha, and re CAPTCHA side by side — UX, difficulty, implementation, and how...

All CAPTCHA Types Migration
Jan 29, 2026
Comparisons ISP Proxies vs Datacenter Proxies for CAPTCHA Solving
Compare ISP and datacenter proxies for CAPTCHA solving — detection rates, speed, cost, and which works best with Captcha AI.

Compare ISP and datacenter proxies for CAPTCHA solving — detection rates, speed, cost, and which works best wi...

Cloudflare Turnstile reCAPTCHA v2 reCAPTCHA v3
Apr 05, 2026