Runnable examples for the official captcha-solver-api Python SDK.
git clone https://github.com/captcha-solver-api/python-examples.git
cd python-examples
python -m venv .venvActivate the environment and install dependencies:
python -m pip install -r requirements.txtSet the API key:
# Linux/macOS
export CAPTCHA_API_KEY=your_api_key
# PowerShell
$env:CAPTCHA_API_KEY = "your_api_key"You can also create a .env file:
CAPTCHA_API_KEY=your_api_key
python examples/recaptcha_v2.py
python examples/turnstile.py
python examples/image_to_text.py
python examples/coordinates.py
python examples/balance.pyReplace placeholder URLs, site keys, application IDs, dynamic values, and proxy credentials before running token captcha examples. GeeTest v3 requires a fresh challenge value from the target page for every request.
Image examples use sample files from assets/ and can run with only a valid API key.
| File | Task |
|---|---|
recaptcha_v2.py |
reCAPTCHA v2, proxyless and proxy |
recaptcha_v2_enterprise.py |
reCAPTCHA v2 Enterprise, proxyless and proxy |
recaptcha_v3.py |
reCAPTCHA v3 proxyless |
turnstile.py |
Cloudflare Turnstile, proxyless and proxy |
yandex_smartcaptcha.py |
Yandex SmartCaptcha token, proxyless and proxy |
yandex_smartcaptcha_image.py |
Yandex SmartCaptcha image mode |
image_to_text.py |
Image to Text |
coordinates.py |
Click coordinates |
geetest_v3.py |
GeeTest v3, proxyless and proxy |
geetest_v4.py |
GeeTest v4, proxyless and proxy |
tencent.py |
Tencent, proxyless and proxy |
balance.py |
Account balance |
Each example creates a task class from captcha_solver_api.tasks and calls CaptchaClient.solve(). Polling, API errors, network errors, and timeouts are handled by the SDK.
- Python 3.9+
- Captcha Solver account and API key
- Real target parameters for token captchas
- Working proxy for proxy examples
API documentation: https://captcha-solver.com/en/docs/captcha-types
MIT. See LICENSE.md.
