Skip to main content

Official Python SDK for CapBypass CAPTCHA solving API

Project description

CapBypass Python SDK

PyPI version Python versions Downloads GitHub stars

Official Python SDK for CapBypass CAPTCHA solving API.

Features

  • ✨ Simple solve() method with auto-polling
  • 🎯 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
import time
while True:
    result = client.getTaskResult(task_id)
    if result["status"] == "ready":
        print(result["solution"])
        break
    time.sleep(5)

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

Full documentation: https://capbypass.dev/docs/sdks/python

Examples

See examples/ directory for complete examples:

Development

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

# Run tests
pytest

# Run linter
ruff check .

# Run type checker
mypy src/

License

MIT

Support

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

capbypass_sdk-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

capbypass_sdk-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file capbypass_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: capbypass_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for capbypass_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bfb9c37ddd2ce2fc3adcf948159f04921ad5eb4f5b36ef5a6324292eb0522e63
MD5 c1ef01f3d2df48519d1ec029b228bc07
BLAKE2b-256 fcf0ebcb712b26897b2a562c6e2f136085af9d1e9ffe51243be0cd4b729eab28

See more details on using hashes here.

File details

Details for the file capbypass_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: capbypass_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for capbypass_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f83ad4b727f270c9f0af9d9b8c4cd76c100e8c907daa71a7f00dfd3c100d703a
MD5 9c7a40d571cf60dcdc6a12b84e4f2c55
BLAKE2b-256 a1904b4cfd499fe053f61789c937f714e6d2e19d65b957294c8aa82b334678b8

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