Skip to main content

python3-capsolver

Capsolver.png


PyPI version Python versions Downloads Static Badge

Maintainability Codacy Badge codecov

Sphinx build Build Installation Tests Lint

Python 3 library for Capsolver service API. Tested on UNIX based OS.

The library is intended for software developers and is used to work with the Capsolver service API.

Features

  • Modern Tooling: Uses uv for fast, reliable dependency management and environment isolation.
  • Sync & Async Support: Full support for both synchronous (requests) and asynchronous (aiohttp) operations.
  • Type Safety: Enums for captcha types and response statuses.
  • Resilience: Built-in retries using tenacity.
  • Performance: High-speed JSON serialization with msgspec.
  • Coverage: Supports ReCaptcha (V2/V3), Cloudflare, DataDome, GeeTest, MtCaptcha, AWS WAF, Yandex, and ImageToText.

How to install?

We recommend using the latest version of Python. python3-capsolver supports Python 3.8+.

Development (using uv)

This project uses uv for fast, reliable dependency management.

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install project dependencies
uv sync --all-groups

Production (pip)

pip install python3-capsolver

How to use?

Detailed documentation is available on the website.

Quick Start

Synchronous Example (ImageToText)

from python3_capsolver.image_to_text import ImageToText

# 1. Initialize with API Key
solver = ImageToText(api_key="YOUR_API_KEY")

# 2. Solve
result = solver.captcha_handler(
    task_payload={
        "body": "base64_encoded_image_string"
    }
)

# 3. Check result
if result["errorId"] == 0:
    print("Solution:", result["solution"])
else:
    print("Error:", result["errorCode"])

Asynchronous Example (ReCaptcha)

import asyncio
from python3_capsolver.recaptcha import ReCaptcha
from python3_capsolver.core.enum import CaptchaTypeEnm

async def main():
    # 1. Initialize
    solver = ReCaptcha(
        api_key="YOUR_API_KEY", 
        captcha_type=CaptchaTypeEnm.ReCaptchaV2TaskProxyLess
    )

    # 2. Solve
    result = await solver.aio_captcha_handler(
        task_payload={
            "websiteURL": "https://example.com",
            "websiteKey": "SITE_KEY"
        }
    )
    
    print(result)

if __name__ == "__main__":
    asyncio.run(main())

Supported Captcha Types

  • ReCaptcha: V2 (Task/Enterprise), V3 (Task/Enterprise)
  • HCaptcha: Task, Enterprise
  • Cloudflare: Turnstile
  • GeeTest: V3, V4
  • DataDome: Slider
  • MtCaptcha
  • AWS WAF
  • Yandex SmartCaptcha
  • ImageToText: General image CAPTCHAs

Documentation & Context (For LLMs)

  • Project Structure: See AGENTS.md in root and subdirectories for internal architecture.
  • Entry Points: src/python3_capsolver/*.py contains service-specific classes (e.g., ReCaptcha, HCaptcha).
  • Core Logic: src/python3_capsolver/core/base.py handles the API communication loop.
  • Enums: Use python3_capsolver.core.enum for type-safe parameters.

How to test?

The project uses uv for testing and development tasks.

# 1. Set API_KEY in your environment (get this value from your account)
export API_KEY="your_api_key_here"

# 2. Run tests (uses uv internally)
make tests

# Other useful make targets:
# make install     # Install dependencies with uv sync
# make lint        # Run linting checks
# make build       # Build the package
# make doc         # Generate documentation

All make commands automatically use uv to run commands in the isolated environment.

Changelog

See CHANGELOG.md for version history and detailed changes.

How to get API Key to work with the library

  1. On the page - https://dashboard.capsolver.com/overview/user-center
  2. Find it: img.png

Contacts

If you have any questions, please send a message to the Telegram chat room.

Or email python-captcha@pm.me

Metadata

Release files for python3-capsolver 1.2.2

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-capsolver 1.2.2
File Size Uploaded
python3_capsolver-1.2.2.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python3-capsolver 1.2.2
File Interpreter ABI Platform
python3_capsolver-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 55.1 kB

Release files / python3_capsolver-1.2.2.tar.gz

Download URL python3_capsolver-1.2.2.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c03541bee71fd75d6a902df1a1d2f5c40ac4a381f6146f174793fe5651aeb52a
BLAKE2b-256 checksum
How to use checksums
f9ef5173c16b2ed4943dfe78fb58b13527911a4fdaa9196a55976160c9de70f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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_capsolver-1.2.2-py3-none-any.whl

Download URL python3_capsolver-1.2.2-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d4a9599f7b02738f2d4f0e35a76ab78776108338fa0d3d93788c86571c9c956
BLAKE2b-256 checksum
How to use checksums
881353a10d94b61fcb53bdf7d171baa651d271deddbe0159701852cb3d19c058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.7.1

2 release files

0.6.1

2 release files

0.6

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

1 release file

0.5.4

1 release file

0.5.3

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