capmonster.cloud library/package for Python
Project description
๐ค Capmonster Python
A modern, strongly typed, async-friendly Python SDK for solving CAPTCHA challenges using Capmonster.Cloud.
Supports reCAPTCHA v2 & v3, Cloudflare Turnstile, GeeTest (v3 & v4) and much more.
โจ Features
- โ Fully typed Pydantic v2 models
- ๐ Both sync and async API support
- ๐ Proxy and User-Agent configuration
- ๐ฆ Supports the most common CAPTCHA types
- ๐ Intuitive API with powerful task building
๐ง Installation
pip install capmonster_python
[!IMPORTANT]
You're viewing the documentation for Capmonster Python v4, which includes breaking changes. If you prefer the old syntax used in versions prior to 4.x, you can continue using it by installing the legacy version:
pip install capmonster_python==3.2
๐ Quick Start
Async Example
import asyncio
from capmonster_python import CapmonsterClient, RecaptchaV3Task
async def main():
client = CapmonsterClient(api_key="YOUR_API_KEY")
task = RecaptchaV3Task(
websiteURL="https://example.com",
websiteKey="SITE_KEY_HERE",
minScore=0.5,
pageAction="verify"
)
task_id = await client.create_task_async(task)
result = await client.join_task_result_async(task_id)
print(result)
asyncio.run(main())
Sync Example
from capmonster_python import CapmonsterClient, RecaptchaV2Task
client = CapmonsterClient(api_key="<YOUR_API_KEY>")
task = RecaptchaV2Task(
websiteURL="https://example.com",
websiteKey="SITE_KEY_HERE"
)
task_id = client.create_task(task)
result = client.join_task_result(task_id)
print(result)
๐ง Supported CAPTCHA Types
Capmonster Python v4 supports a wide range of CAPTCHA formats โ from mainstream challenges like reCAPTCHA and Turnstile to enterprise-grade shields like Imperva and DataDome. Each task supports full Pydantic validation โ and both sync and async clients ๐ unless noted.
| ๐ Category | CAPTCHA Type | Class Name | Proxy Required | Notes |
|---|---|---|---|---|
| ๐งฉ reCAPTCHA | reCAPTCHA v2 | RecaptchaV2Task |
Optional | Visible / Invisible supported โ ๐ |
| reCAPTCHA v2 Enterprise | RecaptchaV2EnterpriseTask |
Optional | enterprisePayload & apiDomain โ
๐ |
|
| reCAPTCHA v3 | RecaptchaV3Task |
โ No | Score-based, proxyless โ ๐ | |
| ๐ก๏ธ Cloudflare | Turnstile (token) | TurnstileTask |
โ No | Lightweight, async-ready โ ๐ |
| Turnstile (cf_clearance) | TurnstileCloudFlareTask |
โ Yes | Full HTML + proxy required โ ๐ | |
| ๐ธ Image-based | Image-to-Text OCR | ImageToTextTask |
โ No | Base64 image + module control โ ๐ |
| Complex Image (Recaptcha-like) | ComplexImageRecaptchaTask |
โ No | Grid-based, metadata aware โ ๐ | |
| Complex Image Recognition (AI) | ComplexImageRecognitionTask |
โ No | Supports tasks like Shein, OOCL โ ๐ | |
| ๐ง Human Behavior | GeeTest v3 | GeeTestV3Task |
Optional | Challenge + gt key + freshness โ
๐ |
| GeeTest v4 | GeeTestV4Task |
Optional | initParameters supported โ
๐ |
|
| ๐ก๏ธ Enterprise Protection | DataDome | DataDomeTask |
โ Recommended | Cookie & page context needed โ ๐ |
| Imperva | ImpervaTask |
โ Recommended | Incapsula + Reese84 logic โ ๐ | |
| ๐ฆ Platform-Specific | Binance Login | BinanceTask |
โ Yes | validateId for login flow โ
๐ |
| Temu | TemuTask |
โ No | Cookie-injected behavioral solver โ ๐ | |
| TenDI | TenDITask |
โ Yes | Custom captchaAppId field โ ๐ | |
| ๐งช Miscellaneous | Prosopo | ProsopoTask |
Optional | Used in zk or crypto UIs โ ๐ |
| Basilisk | BasiliskTask |
โ No | Minimalist site-key puzzle โ ๐ |
๐งฉ Advanced Usage
- Callback URLs are supported during task creation.
- Includes auto-retry loop for polling results (up to 120s)
๐ฌ Community & Support
Need help or have a question?
- ๐ง Contact: business@alperen.io
- ๐ Found a bug? Open an issue
[!NOTE]
Community support is intended only for questions and issues related to this project. Custom usage scenarios, integrations, or application-specific logic are outside the scope of support.
๐ License
This project is licensed under the MIT License.
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
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 capmonster_python-4.0.0.tar.gz.
File metadata
- Download URL: capmonster_python-4.0.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a9699df86aa3adef6d8bd682015fc0bd9e4c98737ae73658218b76acac965d6
|
|
| MD5 |
3d0470303fc0c9135e3ff88d9c71d2b8
|
|
| BLAKE2b-256 |
ea40d9c97067d49b9d11f2fe21ffe056e05232d806a6e1c2e8f4df18bfab02bf
|
File details
Details for the file capmonster_python-4.0.0-py3-none-any.whl.
File metadata
- Download URL: capmonster_python-4.0.0-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20268183d325927801933caaeb3555279f076a0bea0ac3170e4910e42870b425
|
|
| MD5 |
61148d408936d8dc569b4f1e03f245d3
|
|
| BLAKE2b-256 |
3f844a8684d3c31311a7be4e98fc8c5c6a8ad116032598ff274f9f68ea58da39
|