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.3

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.3
File Size Uploaded Provenance Actions
python3_capsolver-1.2.3.tar.gz 27.0 kB Without provenance Details for python3_capsolver-1.2.3.tar.gz

Built distribution (wheel)

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

Total release size: 55.0 kB

Release files / python3_capsolver-1.2.3.tar.gz

Download URL python3_capsolver-1.2.3.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5294ca4aa426fadb28b4512d4763a0d7cd446dc08c0218c70dff4ab68e243921
BLAKE2b-256 checksum
How to use checksums
71ac1378535326ae5c05020940e252fb95e890ce96f8ad69bf1435095017aa8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.3-py3-none-any.whl

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

Security for python3-capsolver 1.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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