Anti-Captcha 是验证码解决市场的早期进入者。它提供自定义 JSON API 和广泛的验证码类型覆盖范围。但随着站点采用更新的保护方法(Cloudflare 的全堆栈、BLS CAPTCHA 和分数关键的 reCAPTCHA v3 工作流程),开发人员遇到了限制。
这就是团队转向 CaptchaAI 的原因。
核心痛点
1. Cloudflare 验证流程 覆盖范围
Anti-Captcha 支持 Turnstile 令牌,但不处理完整的 Cloudflare 验证流程 页面或 JS 挑战:
| Cloudflare 类型 | 反验证码 | CaptchaAI |
|---|---|---|
| 旋转栅门(管理) | ✅ | ✅ 100% |
| 旋转栅门(隐形) | 部分的 | ✅ |
| Cloudflare 验证流程 | ❌ | ✅ |
| JS 挑战 | ❌ | ✅ |
许多抓取目标现在使用 Cloudflare 验证流程 页面(不仅仅是 Turnstile 小部件)。反验证码用户被屏蔽; CaptchaAI 用户没有。
2. API 方法差异
Anti-Captcha 使用基于自定义 JSON 任务的 API。 CaptchaAI 使用广泛采用的 2Captcha 兼容格式:
# Anti-Captcha — custom JSON format
import requests
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 with different endpoint and format
result = requests.post("https://api.anti-captcha.com/getTaskResult", json={
"clientKey": "ANTICAPTCHA_KEY",
"taskId": task_id,
})
# CaptchaAI — standard 2Captcha-compatible format
import requests
resp = requests.post("https://ocr.captchaai.com/in.php", data={
"key": "YOUR_API_KEY",
"method": "userrecaptcha",
"googlekey": "SITE_KEY",
"pageurl": "https://example.com",
"json": 1,
})
task_id = resp.json()["request"]
# Standard polling
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": "YOUR_API_KEY",
"action": "get",
"id": task_id,
"json": 1,
})
2Captcha 格式受到数百种工具、库和框架的支持。对于已经使用 2Captcha 兼容包装器的团队来说,迁移到 CaptchaAI 需要进行最少的代码更改。
3. BLS CAPTCHA 支持
政府门户自动化、签证预约系统和劳动力数据抓取需要 BLS CAPTCHA 解决:
# CaptchaAI — BLS at 100% accuracy
resp = requests.post("https://ocr.captchaai.com/in.php", data={
"key": "YOUR_API_KEY",
"method": "bls",
"pageurl": "https://bls-portal.example.com",
"sitekey": "BLS_SITE_KEY",
"json": 1,
})
Anti-Captcha 没有 BLS 方法。需要政府门户访问权限的团队必须进行切换。
4. reCAPTCHA v3 评分质量
| 提供商 | v3 平均得分 | 分数控制 |
|---|---|---|
| 反验证码 | 0.3-0.5 | 有限的 |
低 v3 分数会触发机器人检测。反验证码的人工辅助方法会产生不同的分数。 CaptchaAI 的 AI 引擎始终能产生高分。
5.GeeTest准确度
| 极测试版本 | 反验证码 | CaptchaAI |
|---|---|---|
| GeeTest v3 | 85-90% | 100% |
| GeeTest v4 | 80-85% | 高准确率(参考值) |
特性比较
| 特征 | 反验证码 | CaptchaAI |
|---|---|---|
| reCAPTCHA v2 | ✅ | ✅ |
| reCAPTCHA v3 | ✅(低分) | ✅ 分数控制 |
| reCAPTCHA 企业版 | ✅ | ✅ |
| 隐形验证码 | ✅ | ✅ |
| 旋转门 | ✅ | ✅ 100% |
| Cloudflare 验证流程 | ❌ | ✅ |
| GeeTest v3 | ✅ | ✅ 100% |
| 劳工统计局 | ❌ | ✅ 100% |
| 图片/OCR | ✅ | ✅ 27,500+ 种 |
| API格式 | 自定义 JSON | 2兼容验证码 |
| 代理支持 | ✅ | ✅ |
| 打回来 | ✅ | ✅ |
速度比较
| 验证码类型 | 反验证码 | CaptchaAI |
|---|---|---|
| reCAPTCHA v2 | 15-45秒 | 10-20秒 |
| reCAPTCHA v3 | 10-30秒 | 5-15秒 |
| 图片验证码 | 5-15秒 | 2-5秒 |
| 旋转门 | 10-30秒 | 3-10秒 |
| GeeTest v3 | 15-40秒 | 5-15秒 |
迁移路径
API 格式不同,因此迁移需要更新您的 request/response 处理。这是一个在转换期间支持两者的包装器:
import requests
import time
class CaptchaSolver:
"""Unified solver — supports Anti-Captcha and CaptchaAI."""
def __init__(self, provider="captchaai", api_key="YOUR_API_KEY"):
self.provider = provider
self.api_key = api_key
def solve_recaptcha_v2(self, sitekey, pageurl):
if self.provider == "captchaai":
return self._solve_captchaai("userrecaptcha", sitekey, pageurl)
else:
return self._solve_anticaptcha(sitekey, pageurl)
def _solve_captchaai(self, method, sitekey, pageurl):
resp = requests.post("https://ocr.captchaai.com/in.php", data={
"key": self.api_key,
"method": method,
"googlekey": sitekey,
"pageurl": pageurl,
"json": 1,
})
task_id = resp.json()["request"]
for _ in range(60):
time.sleep(5)
result = requests.get("https://ocr.captchaai.com/res.php", params={
"key": self.api_key, "action": "get",
"id": task_id, "json": 1,
})
data = result.json()
if data["request"] != "CAPCHA_NOT_READY":
return data["request"]
raise TimeoutError("Solve timeout")
def _solve_anticaptcha(self, sitekey, pageurl):
resp = requests.post("https://api.anti-captcha.com/createTask", json={
"clientKey": self.api_key,
"task": {
"type": "RecaptchaV2TaskProxyless",
"websiteURL": pageurl,
"websiteKey": sitekey,
},
})
task_id = resp.json()["taskId"]
for _ in range(60):
time.sleep(5)
result = requests.post(
"https://api.anti-captcha.com/getTaskResult",
json={"clientKey": self.api_key, "taskId": task_id},
)
data = result.json()
if data["status"] == "ready":
return data["solution"]["gRecaptchaResponse"]
raise TimeoutError("Solve timeout")
将 provider="captchaai" 用于新项目。通过更改构造函数参数来迁移现有项目。
故障排除
| 问题 | 原因 | 处理方式 |
|---|---|---|
| API格式不同 | 反验证码使用 JSON 任务 | 根据上面的示例更新请求格式 |
缺少 method 字段 |
Anti-Captcha 在任务中使用 type |
切换到 method=userrecaptcha 为 CaptchaAI |
| 投票格式错误 | 结果终点不同 | 使用 GET 到 /res.php 和 action=get |
| 未找到任务类型 | 反验证码任务名称不同 | 使用 CaptchaAI 方法名称:userrecaptcha、turnstile、bls |
常问问题
由于 API 格式不同,迁移是否困难?
API 格式不同但简单。核心逻辑(提交 → 轮询 → 获取结果)是相同的。大多数迁移需要 15-30 分钟的代码更改。
我可以将反验证码包装器库与 CaptchaAI 一起使用吗?
不是直接的——API 格式不同。但是,CaptchaAI 与任何更广泛可用的 2Captcha 包装器库兼容。
CaptchaAI是否支持反验证码的代理转发?
是的。 CaptchaAI 支持标准请求格式的代理参数(proxy、proxytype)。
相关指南
升级您的验证码解决方案 —免费试用 CaptchaAI具有更好的 Cloudflare 和 BLS 支持。