Skip to main content

Python 3.9+ RuCaptcha library with AIO module.

Project description

python3-anticaptcha

PyPI version Python versions Downloads Static Badge Test Lint

Python 3 client library for AntiCaptcha service - solve reCAPTCHA, hCaptcha, image captchas, and more programmatically.

Why use this library?

AntiCaptcha is a paid captcha solving service. This library provides a clean Python interface to:

  • Submit captchas to AntiCaptcha's worker network
  • Poll for results automatically
  • Handle proxy rotation for high-volume requests
  • Support both synchronous and asynchronous workflows

Supported Captcha Types

Type Class Use Case
reCAPTCHA v2 ReCaptchaV2 Google reCAPTCHA V2 checkbox/invisible
reCAPTCHA v3 ReCaptchaV3 Google reCAPTCHA V3 score-based
Image Captcha ImageToText Classic text-from-image captchas
Image Coordinates ImageToCoordinates Click-on-image captchas
FunCaptcha FunCaptcha Arkose Labs (formerly FunCaptcha)
GeeTest GeeTest Chinese GeeTest captcha
Turnstile Turnstile Cloudflare Turnstile
FriendlyCaptcha FriendlyCaptcha FriendlyCaptcha puzzles
Prosopo Prosopo Prosopo captcha
Amazon WAF AmazonWAF AWS WAF Captcha

Quick Start

1. Install

pip install python3-anticaptcha

2. Get Your API Key

  1. Log into AntiCaptcha
  2. Copy your API key from the "Setup" section

3. Solve a reCAPTCHA

from python3_anticaptcha import ReCaptchaV2
from python3_anticaptcha.core.enum import CaptchaTypeEnm

# Basic usage (no proxy)
result = ReCaptchaV2(
    api_key="YOUR_API_KEY",
    captcha_type=CaptchaTypeEnm.RecaptchaV2TaskProxyless,
    websiteURL="https://example.com/page-with-captcha",
    websiteKey="6LeIxAKTAAAAAJ309xRj9YBN2aaaaaaaaa",  # sitekey from the page
).captcha_handler()

print(result["solution"]["gRecaptchaResponse"])

4. Solve with Proxy

from python3_anticaptcha import ReCaptchaV2
from python3_anticaptcha.core.enum import CaptchaTypeEnm, ProxyTypeEnm

result = ReCaptchaV2(
    api_key="YOUR_API_KEY",
    captcha_type=CaptchaTypeEnm.RecaptchaV2Task,
    websiteURL="https://example.com/page-with-captcha",
    websiteKey="6LeIxAKTAAAAAJ309xRj9YBN2aaaaaaaaa",
    proxyType=ProxyTypeEnm.HTTP,
    proxyAddress="123.45.67.89",
    proxyPort=8080,
    proxyLogin="proxy_user",
    proxyPassword="proxy_pass",
    userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
).captcha_handler()

5. Async Usage

import asyncio
from python3_anticaptcha import ReCaptchaV2
from python3_anticaptcha.core.enum import CaptchaTypeEnm

async def solve():
    result = await ReCaptchaV2(
        api_key="YOUR_API_KEY",
        captcha_type=CaptchaTypeEnm.RecaptchaV2TaskProxyless,
        websiteURL="https://example.com/page-with-captcha",
        websiteKey="6LeIxAKTAAAAAJ309xRj9YBN2aaaaaaaaa",
    ).aio_captcha_handler()
    return result

result = asyncio.run(solve())

Environment Variable

Set API_KEY to avoid passing it in code:

export API_KEY="your_api_key_here"
# Now you can omit api_key parameter
from python3_anticaptcha import ImageToText

result = ImageToText(captcha_file="captcha.png").captcha_handler()

Configuration Options

All captcha classes support these common parameters:

Parameter Type Description
api_key str Your AntiCaptcha API key (or set API_KEY env var)
sleep_time int Seconds between result polls (default: 10)

Documentation

Development

# Run tests
make tests

# Run linters
make lint

# Build package
make build

Contacts


Love Rust? Check out Rust-AntiCaptcha - same API for Rust projects.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python3_anticaptcha-2.2.2.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python3_anticaptcha-2.2.2-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file python3_anticaptcha-2.2.2.tar.gz.

File metadata

  • Download URL: python3_anticaptcha-2.2.2.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.12

File hashes

Hashes for python3_anticaptcha-2.2.2.tar.gz
Algorithm Hash digest
SHA256 a6095c7c6d7a60ed7e53cb8ea16458e646ee9fc59e12c89862971d382af0748e
MD5 364f2ed2bef7e33db68e60209e713035
BLAKE2b-256 d17d08d879caa0f2300e4d493aab6f6401030711d3b10bf76f2bb9a09029abbf

See more details on using hashes here.

File details

Details for the file python3_anticaptcha-2.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python3_anticaptcha-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a5e1a3918a4208fd9a5b04db61d7d486b5cf97f537a35335d10d270ec6c9a2d
MD5 db7b11d46ed1aee91cb40a11ea464397
BLAKE2b-256 4bb1c3943141406319653db894a4b14726c470c04d9f752397627aedcdc54a79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page