Skip to main content

python3-anticaptcha

PyPI version Python versions Downloads Static Badge Test Lint codecov

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

Install uv and create the project environment with all development extras:

uv sync --all-extras

The Makefile provides the standard project commands:

# Run tests
make tests

# Run Ruff checks
make lint

# Build package
make build

# Build documentation
make doc

Ruff is the formatter and linter. To apply its safe fixes and formatting, run:

make refactor

Contacts


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

Metadata

Release files for python3-anticaptcha 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python3-anticaptcha 2.3.0
File Size Uploaded
python3_anticaptcha-2.3.0.tar.gz 28.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python3-anticaptcha 2.3.0
File Interpreter ABI Platform
python3_anticaptcha-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.4 kB

Release files / python3_anticaptcha-2.3.0.tar.gz

Download URL python3_anticaptcha-2.3.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d9f9c9e164f101d9b4d6736103fbb64534fbf7823321e3fc314a9695f0ec5c24
BLAKE2b-256 checksum
How to use checksums
2651d4218627962d7978ddd658fec1d44830a860a8173f83b148e65b5ab389c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / python3_anticaptcha-2.3.0-py3-none-any.whl

Download URL python3_anticaptcha-2.3.0-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8b7400141a09bf2c8d6c076a0732ec139c12e3e57b53c4878704d07245e6121
BLAKE2b-256 checksum
How to use checksums
053cebe6bbeb026b91172d89e768d95896d8e02008ff3e67d83589fe311311f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1

2 release files

1.7.1

2 release files

1.7

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5

2 release files

1.4.1

2 release files

1.4

2 release files

1.3.1

2 release files

1.3

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

1 release file

1.1

2 release files

1.0

2 release files

0.9.5

2 release files

0.9.3

2 release files

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

0.8.1

1 release file

0.8

1 release file

0.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page