Skip to content

Commit 88c8b8a

Browse files
committed
docs: remove old markdown and add structured API documentation
Removed outdated CODE-OF-CONDUCT.md and README.md files. Introduced a detailed, structured API reference and examples using MkDocs format. Includes documentation for tasks, exceptions, error codes, and usage examples in both synchronous and asynchronous modes.
1 parent 77317de commit 88c8b8a

35 files changed

Lines changed: 1391 additions & 236 deletions

CODE-OF-CONDUCT.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 100 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,128 @@
1-
Capmonster.cloud for Python
2-
=
3-
![PyPI - Wheel](https://img.shields.io/pypi/wheel/capmonster-python?style=plastic) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/capmonster_python?style=flat) ![GitHub last commit](https://img.shields.io/github/last-commit/alperensert/capmonster_python?style=flat) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/alperensert/capmonster_python?style=flat) ![PyPI - Downloads](https://img.shields.io/pypi/dm/capmonster_python?style=flat) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/alperensert/capmonster_python?style=flat) ![GitHub Repo stars](https://img.shields.io/github/stars/alperensert/capmonster_python?style=social)
1+
# 🤖 Capmonster Python
42

5-
[Capmonster.cloud](https://capmonster.cloud) package for Python3
3+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/capmonster-python?style=for-the-badge)
4+
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/alperensert/capmonster_python?style=for-the-badge)
5+
![GitHub last commit](https://img.shields.io/github/last-commit/alperensert/capmonster_python?style=for-the-badge)
6+
![GitHub Release](https://img.shields.io/github/v/release/alperensert/capmonster_python?style=for-the-badge)
7+
![GitHub Repo stars](https://img.shields.io/github/stars/alperensert/capmonster_python?style=for-the-badge&color=rgb(255%2C%20255%2C%20143)&cacheSeconds=3600)
68

7-
If you have any problem with usage, [read the documentation](https://alperensert.github.io/capmonster_python)
8-
or [create an issue](https://github.com/alperensert/capmonster_python/issues/new)
9+
A modern, strongly typed, async-friendly Python SDK for solving CAPTCHA challenges
10+
using [Capmonster.Cloud](https://capmonster.cloud/).
911

10-
*At least 2x cheaper, up to 30x faster than manual recognition services.*
12+
Supports reCAPTCHA v2 & v3, Cloudflare Turnstile, GeeTest (v3 & v4) and [much more](#-supported-captcha-types).
1113

12-
### Installation
14+
---
1315

14-
```
16+
## ✨ Features
17+
18+
- ✅ Fully typed Pydantic v2 models
19+
- 🔁 Both sync and async API support
20+
- 🔐 Proxy and User-Agent configuration
21+
- 📦 Supports the most common CAPTCHA types
22+
- 📚 Intuitive API with powerful task building
23+
24+
---
25+
26+
## 🔧 Installation
27+
28+
```bash
1529
pip install capmonster_python
1630
```
1731

18-
### Supported captcha types
19-
20-
- Image to text
21-
- Recaptcha v2
22-
- Recaptcha v2 Enterprise
23-
- Recaptcha v3
24-
- Fun Captcha
25-
- HCaptcha
26-
- GeeTest
27-
- Turnstile Task
28-
- Data Dome
32+
> [!IMPORTANT]
33+
> You're viewing the documentation for **Capmonster Python v4**, which includes breaking changes. If you prefer the
34+
> old syntax used in versions prior to 4.x, you can continue using it by installing the legacy version:
35+
> ```pip install capmonster_python==3.2```
2936
30-
Usage examples
31-
-
37+
## 🚀 Quick Start
3238

33-
#### ImageToText
39+
### Async Example
3440

3541
```python
36-
from src.capmonster_python import ImageToTextTask
42+
import asyncio
43+
from capmonster_python import CapmonsterClient, RecaptchaV3Task
3744

38-
capmonster = ImageToTextTask("API_KEY")
39-
task_id = capmonster.create_task(image_path="img.png")
40-
result = capmonster.join_task_result(task_id)
41-
print(result.get("text"))
42-
```
4345

44-
#### Recaptcha v2
46+
async def main():
47+
client = CapmonsterClient(api_key="YOUR_API_KEY")
4548

46-
```python
47-
from src.capmonster_python import RecaptchaV2Task
49+
task = RecaptchaV3Task(
50+
websiteURL="https://example.com",
51+
websiteKey="SITE_KEY_HERE",
52+
minScore=0.5,
53+
pageAction="verify"
54+
)
4855

49-
capmonster = RecaptchaV2Task("API_KEY")
50-
task_id = capmonster.create_task("website_url", "website_key")
51-
result = capmonster.join_task_result(task_id)
52-
print(result.get("gRecaptchaResponse"))
53-
```
56+
task_id = await client.create_task_async(task)
57+
result = await client.join_task_result_async(task_id)
58+
print(result)
5459

55-
#### Recaptcha v2 enterprise
5660

57-
```python
58-
from src.capmonster_python import RecaptchaV2EnterpriseTask
61+
asyncio.run(main())
5962

60-
capmonster = RecaptchaV2EnterpriseTask("API_KEY")
61-
task_id = capmonster.create_task("website_url", "website_key", {"s": "payload value"}, "api_domain")
62-
result = capmonster.join_task_result(task_id)
63-
print(result.get("gRecaptchaResponse"))
6463
```
6564

66-
#### GeeTest
65+
### Sync Example
6766

6867
```python
69-
from src.capmonster_python import GeeTestTask
70-
71-
capmonster = GeeTestTask("API_KEY")
72-
task_id = capmonster.create_task("website_url", "gt", "challenge")
73-
result = capmonster.join_task_result(task_id)
74-
print(result.get("challenge"))
75-
print(result.get("seccode"))
76-
print(result.get("validate"))
77-
```
68+
from capmonster_python import CapmonsterClient, RecaptchaV2Task
7869

79-
#### Report incorrect captchas
70+
client = CapmonsterClient(api_key="<YOUR_API_KEY>")
8071

81-
```python
82-
from src.capmonster_python import RecaptchaV2Task
72+
task = RecaptchaV2Task(
73+
websiteURL="https://example.com",
74+
websiteKey="SITE_KEY_HERE"
75+
)
8376

84-
capmonster = RecaptchaV2Task("API_KEY")
85-
task_id = capmonster.create_task("website_url", "website_key")
86-
result = capmonster.join_task_result(task_id)
87-
report_result = capmonster.report_incorrect_captcha("token", task_id)
88-
print(report_result)
77+
task_id = client.create_task(task)
78+
result = client.join_task_result(task_id)
79+
print(result)
8980
```
9081

91-
For other examples and api documentation please visit [wiki](https://alperensert.github.io/capmonster_python)
82+
---
83+
84+
## 🧠 Supported CAPTCHA Types
85+
86+
Capmonster Python v4 supports a wide range of CAPTCHA formats — from mainstream challenges like reCAPTCHA and Turnstile
87+
to enterprise-grade shields like Imperva and DataDome. Each task supports full Pydantic validation ✅ and both sync and
88+
async clients 🔄 unless noted.
89+
90+
| 🔖 Category | CAPTCHA Type | Class Name | Proxy Required | Notes |
91+
|---------------------------|--------------------------------|-------------------------------|----------------|----------------------------------------|
92+
| 🧩 reCAPTCHA | reCAPTCHA v2 | `RecaptchaV2Task` | Optional | Visible / Invisible supported ✅ 🔄 |
93+
| | reCAPTCHA v2 Enterprise | `RecaptchaV2EnterpriseTask` | Optional | `enterprisePayload` & `apiDomain` ✅ 🔄 |
94+
| | reCAPTCHA v3 | `RecaptchaV3Task` | ❌ No | Score-based, proxyless ✅ 🔄 |
95+
| 🛡️ Cloudflare | Turnstile (token) | `TurnstileTask` | ❌ No | Lightweight, async-ready ✅ 🔄 |
96+
| | Turnstile (cf_clearance) | `TurnstileCloudFlareTask` | ✅ Yes | Full HTML + proxy required ✅ 🔄 |
97+
| 📸 Image-based | Image-to-Text OCR | `ImageToTextTask` | ❌ No | Base64 image + module control ✅ 🔄 |
98+
| | Complex Image (Recaptcha-like) | `ComplexImageRecaptchaTask` | ❌ No | Grid-based, metadata aware ✅ 🔄 |
99+
| | Complex Image Recognition (AI) | `ComplexImageRecognitionTask` | ❌ No | Supports tasks like Shein, OOCL ✅ 🔄 |
100+
| 🧠 Human Behavior | GeeTest v3 | `GeeTestV3Task` | Optional | Challenge + `gt` key + freshness ✅ 🔄 |
101+
| | GeeTest v4 | `GeeTestV4Task` | Optional | `initParameters` supported ✅ 🔄 |
102+
| 🛡️ Enterprise Protection | DataDome | `DataDomeTask` | ✅ Recommended | Cookie & page context needed ✅ 🔄 |
103+
| | Imperva | `ImpervaTask` | ✅ Recommended | Incapsula + Reese84 logic ✅ 🔄 |
104+
| 🏦 Platform-Specific | Binance Login | `BinanceTask` | ✅ Yes | `validateId` for login flow ✅ 🔄 |
105+
| | Temu | `TemuTask` | ❌ No | Cookie-injected behavioral solver ✅ 🔄 |
106+
| | TenDI | `TenDITask` | ✅ Yes | Custom captchaAppId field ✅ 🔄 |
107+
| 🧪 Miscellaneous | Prosopo | `ProsopoTask` | Optional | Used in zk or crypto UIs ✅ 🔄 |
108+
| | Basilisk | `BasiliskTask` | ❌ No | Minimalist site-key puzzle ✅ 🔄 |
109+
110+
## 🧩 Advanced Usage
111+
112+
- Callback URLs are supported during task creation.
113+
- Includes auto-retry loop for polling results (up to 120s)
114+
115+
## 💬 Community & Support
116+
117+
Need help or have a question?
118+
119+
- 📧 Contact: business@alperen.io
120+
- 🐛 Found a bug? [Open an issue](https://github.com/alperensert/capmonster_python/issues)
121+
122+
> [!NOTE]
123+
> Community support is intended only for questions and issues related to this project. Custom usage scenarios,
124+
> integrations, or application-specific logic are outside the scope of support.
125+
126+
## 📄 License
127+
128+
This project is licensed under the [MIT License](/LICENSE).

0 commit comments

Comments
 (0)