Official Python SDK for CapBypass CAPTCHA solving API
Project description
CapBypass Python SDK
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
📚 Core Documentation
🔧 Advanced Guides
- Proxy Configuration — HTTP, HTTPS, SOCKS5 proxy support with rotation strategies
- Error Handling — Retry strategies, circuit breakers, production alerting
- Performance Optimization — Concurrent solving, connection pooling, token caching
- Production Deployment — Kubernetes, AWS Lambda, monitoring, security
🔄 Migration
- Migrating from Capsolver — 100% API compatible, drop-in replacement
Examples
Basic Examples
See examples/ directory for complete runnable examples:
- recaptcha_v2.py - reCAPTCHA v2 solving
- recaptcha_v3.py - reCAPTCHA v3 solving
- aws_waf.py - AWS WAF CAPTCHA solving
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
- Documentation: https://capbypass.dev/docs
- Issues: https://github.com/CapBypass-Development/capbypass-sdk-python/issues
- Email: support@capbypass.dev
Project details
Release history Release notifications | RSS feed
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.4.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capbypass_sdk-1.0.4.tar.gz.
File metadata
- Download URL: capbypass_sdk-1.0.4.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c223da9cf1f3d45ba7b521d5dcf468aa551422b1bd221cbc9b0d4f332a674e67
|
|
| MD5 |
6fbc37cd95557861982d0d6e4ed4f3e8
|
|
| BLAKE2b-256 |
0b12f9aef71e0a20123e1fa5f5627b9c5455e40dae4b90972f1d2eaceb02f63d
|
File details
Details for the file capbypass_sdk-1.0.4-py3-none-any.whl.
File metadata
- Download URL: capbypass_sdk-1.0.4-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4de2ca9a21546fc0812879a82fe360e73dddaa55242591f9aebc9baaccf35bc8
|
|
| MD5 |
994716eaa702ef4d5c47505ffe3bb284
|
|
| BLAKE2b-256 |
7ab436d51e70b50f21877f268697e4a574fa25da79e1a07f9e7b8cd6f6ccf10b
|