Skip to main content

CapBypass Python SDK

PyPI version Python versions Downloads GitHub stars

Official Python SDK for the CapBypass CAPTCHA solving API.

Features

  • ✨ Simple solve() method with auto-polling (first poll after 1 s, then every 1-3 s)
  • 🎯 Advanced createTask() + getTaskResult() for granular control
  • 💰 getBalance() to check account balance
  • 🔄 Automatic retry logic for network failures
  • 🛡️ Comprehensive error handling
  • 📝 Type hints for better IDE support
  • 🧪 100% test coverage

Supported CAPTCHA Types

  • reCAPTCHA v2 (normal & invisible)
  • reCAPTCHA v3
  • reCAPTCHA v3 Enterprise
  • AWS WAF CAPTCHA

Installation

pip install capbypass-sdk

Quick Start

from capbypass import CapBypass

# Initialize client
client = CapBypass(api_key="your-api-key")
# Or use environment variable: export CAPBYPASS_API_KEY="your-key"

# Solve CAPTCHA (auto-polling)
solution = client.solve({
    "type": "ReCaptchaV2TaskProxyLess",
    "websiteURL": "https://example.com",
    "websiteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
})

print(solution["gRecaptchaResponse"])

Advanced Usage

Granular Control

# Create task
task_id = client.createTask({
    "type": "ReCaptchaV2TaskProxyLess",
    "websiteURL": "https://example.com",
    "websiteKey": "site-key"
})

# Poll for result. getTaskResult does not wait by itself: wait 1 second after
# createTask, then 1 to 3 seconds between calls (not faster), until the task is
# ready or failed, and give up after your own deadline.
import time
deadline = time.monotonic() + 120
time.sleep(1)
while True:
    result = client.getTaskResult(task_id)
    if result["status"] == "ready":
        print(result["solution"])
        break
    if result["status"] == "failed":
        raise RuntimeError(result.get("errorDescription", "Task failed"))
    if time.monotonic() > deadline:
        raise TimeoutError("Task not ready in time")
    time.sleep(2)

Check Balance

balance = client.getBalance()
print(f"Balance: ${balance:.4f}")

Error Handling

from capbypass import CapBypass
from capbypass.errors import (
    AuthenticationError,
    InsufficientBalanceError,
    TimeoutError,
)

try:
    solution = client.solve(task)
except AuthenticationError:
    print("Invalid API key")
except InsufficientBalanceError:
    print("Insufficient balance")
except TimeoutError:
    print("Task timed out")

Documentation

📚 Core Documentation

🔧 Advanced Guides

🔄 Migration

Examples

Basic Examples

See examples/ directory for complete runnable examples:

Advanced Examples

Full integration examples in the documentation:

  • E-commerce checkout automation
  • Social media automation
  • Web scraping with CAPTCHA handling
  • Microservice integration patterns

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .

# Run type checker
mypy src/

License

MIT

Support

Metadata

Release files for capbypass-sdk 1.0.12

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

Source distribution (sdist)

Source distribution for capbypass-sdk 1.0.12
File Size Uploaded Provenance Actions
capbypass_sdk-1.0.12.tar.gz 11.4 kB Without provenance Details for capbypass_sdk-1.0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for capbypass-sdk 1.0.12
File Interpreter ABI Platform Actions
capbypass_sdk-1.0.12-py3-none-any.whl Python 3 none any Details for capbypass_sdk-1.0.12-py3-none-any.whl

Total release size: 21.8 kB

Release files / capbypass_sdk-1.0.12.tar.gz

Download URL capbypass_sdk-1.0.12.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9486de557c48f96dbd9c54ccd2f439459b98a48fc5534d0e46fab0d0d376b9bd
BLAKE2b-256 checksum
How to use checksums
e12d09b5b1a1796a02779bed317ac92b6d9907a4b20fef07c33a776c2d3ce4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / capbypass_sdk-1.0.12-py3-none-any.whl

Download URL capbypass_sdk-1.0.12-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd3ba6ef965f68a1a61c972c593f8118a362cac56c40a18a6eea2fd3385fdbfd
BLAKE2b-256 checksum
How to use checksums
130a430c1049ae93a1790bcea90e2c92bd66e7a7014f9abd1ad2961109e46a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for capbypass-sdk 1.0.12

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