Skip to content

Commit 5a5ff75

Browse files
Add files via upload
1 parent ef0c12b commit 5a5ff75

1 file changed

Lines changed: 93 additions & 53 deletions

File tree

‎README.md‎

Lines changed: 93 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# CapMonster Cloud Python SDK: AI Captcha Solver & Captcha Bypass
1+
# CapMonster Cloud Python SDK: Python Captcha Solver & Captcha Bypass for reCAPTCHA, Cloudflare Turnstile and GeeTest
22

3-
> **🔄 Migrating from 2Captcha or Capsolver?** CapMonster Cloud is a fast, cost-effective **2captcha alternative** and **capsolver alternative**: reCAPTCHA v3 from **$0.90 per 1,000 solves**, which is **up to 38% cheaper than 2Captcha** and **10% cheaper than Capsolver**, with an API response time of **≤ 2 s**. Already have software built for 2Captcha? CapMonster Cloud [supports the 2Captcha API format](https://docs.capmonster.cloud/docs/external-services/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme). Moving your Python code takes just a few lines: see the **Migration examples** below. Full comparison and disclaimer are in the comparison section below.
3+
> **🔄 Migrating from 2Captcha or Capsolver?** CapMonster Cloud is a fast, cost-effective **2captcha alternative** and **capsolver alternative** for Python: reCAPTCHA v3 from **$0.90 per 1,000 solves**, which is **up to 38% cheaper than 2Captcha** and **10% cheaper than Capsolver**, with an API response time of **≤ 2 s**. Already have software built for 2Captcha? CapMonster Cloud [supports the 2Captcha API format](https://docs.capmonster.cloud/docs/external-services/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme). Moving your Python code takes just a few lines: see the **Migration examples** below. Full comparison and disclaimer are in the comparison section below.
44
55
<p align="center">
66
<a href="https://capmonster.cloud/en/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme">
7-
<img src="https://img.shields.io/badge/CapMonster%20Cloud-Python%20Captcha%20Solver-00B2FF?style=for-the-badge&logo=python&logoColor=white" alt="CapMonster Cloud Python SDK" height="40">
7+
<img src="https://img.shields.io/badge/CapMonster%20Cloud-Python%20Captcha%20Solver-00B2FF?style=for-the-badge&logo=python&logoColor=white" alt="CapMonster Cloud Python SDK - captcha solver and captcha bypass API client" height="40">
88
</a>
99
</p>
1010

@@ -30,21 +30,22 @@ The CapMonster Cloud Python SDK (`capmonstercloudclient`, also known as the CapM
3030

3131
---
3232

33-
## ⚡ Highlights & Benchmarks
33+
## ⚡ Highlights
3434

35-
- ⚡ **Fast Solving:** Automated AI models solve captchas in 300 ms to 6 seconds depending on the system load.
36-
- 🤖 **Zero Human Workers:** 100% automated machine learning pipeline with no manual latencies.
35+
- ⚡ **Fast solving:** AI-based recognition, on average between 1 and 30 seconds depending on the captcha type.
36+
- 🤖 **Zero human workers:** 100% automated machine learning pipeline with no manual latencies.
37+
- 🛡️ **Modern anti-bot bypass:** Full support for Cloudflare Turnstile, reCAPTCHA Enterprise, GeeTest, DataDome, and Amazon WAF.
3738
- 🌐 **Browser Automation Ready:** Works out-of-the-box with **Playwright, Selenium, and Puppeteer**.
38-
- 🛡️ **Modern Anti-Bot Bypass:** Full support for Cloudflare Turnstile, reCAPTCHA Enterprise, GeeTest, and Amazon WAF.
39-
- 💰 **Cost-Effective:** Low-cost pricing structure based on pay-as-you-go balance.
40-
- 📉 **Cheaper Than Alternatives:** reCAPTCHA v3 from $0.90 per 1,000 solves, versus $1.45 at 2Captcha and $1.00 at Capsolver.
41-
- 🔄 **Easy Migration:** replace your 2Captcha or Capsolver solver call and keep the rest of your scraper or bot unchanged.
39+
- 💰 **Cost-effective:** Low-cost pricing structure based on pay-as-you-go balance.
40+
- 📉 **Cheaper than alternatives:** reCAPTCHA v3 from $0.90 per 1,000 solves, versus $1.45 at 2Captcha and $1.00 at Capsolver.
41+
- 🔄 **Easy migration:** replace your 2Captcha or Capsolver solver call and keep the rest of your scraper or bot unchanged.
42+
- 📖 **Official docs:** request types follow the [CapMonster Cloud API documentation](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
4243

4344
---
4445

4546
## 📊 CapMonster Cloud vs 2Captcha vs Capsolver
4647

47-
Looking for a 2captcha alternative or a capsolver alternative for web scraping and automation? Compare price, speed and success rate.
48+
Looking for a 2captcha alternative or a capsolver alternative for Python web scraping and automation? Compare price, speed and success rate.
4849

4950
### reCAPTCHA v3
5051

@@ -81,7 +82,7 @@ pip install capmonstercloudclient
8182

8283
---
8384

84-
## 🚀 Quick Start & Usage Examples
85+
## 🚀 Quick Start: Solve and Bypass Captchas in Python
8586

8687
### 1. Asynchronous reCAPTCHA v2 Solving
8788

@@ -97,10 +98,10 @@ client = CapMonsterClient(options=options)
9798
async def main():
9899
# Build the task payload
99100
request = RecaptchaV2Request(
100-
websiteUrl="[https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high](https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high)",
101+
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
101102
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd"
102103
)
103-
104+
104105
# Send task and receive token
105106
result = await client.solve_captcha(request)
106107
print("reCAPTCHA Token:", result.get("gRecaptchaResponse"))
@@ -123,7 +124,7 @@ client = CapMonsterClient(options=options)
123124
async def run_scraper():
124125
# Solve Turnstile challenge via CapMonster Cloud
125126
turnstile_req = TurnstileRequest(
126-
websiteURL="[https://target-website.com/login](https://target-website.com/login)",
127+
websiteURL="https://target-website.com/login",
127128
websiteKey="0x4AAAAAAABnPIDnK2k_e-2"
128129
)
129130
solution = await client.solve_captcha(turnstile_req)
@@ -133,8 +134,8 @@ async def run_scraper():
133134
async with async_playwright() as p:
134135
browser = await p.chromium.launch(headless=False)
135136
page = await browser.new_page()
136-
await page.goto("[https://target-website.com/login](https://target-website.com/login)")
137-
137+
await page.goto("https://target-website.com/login")
138+
138139
await page.evaluate(f'document.querySelector("[name=cf-turnstile-response]").value = "{token}";')
139140
await page.click("#submit-button")
140141
await browser.close()
@@ -147,9 +148,9 @@ if __name__ == "__main__":
147148

148149
## 🔄 Migrating from 2Captcha or Capsolver
149150

150-
Already use 2Captcha or Capsolver in your scraper or bot? Replace only the solver call and keep the rest of your parser unchanged. CapMonster Cloud follows the same flow: send the website URL and sitekey, receive the token.
151+
Already use 2Captcha or Capsolver in your Python scraper or bot? Replace only the solver call and keep the rest of your parser unchanged. CapMonster Cloud follows the same flow: send the website URL and sitekey, receive the token.
151152

152-
### Migration from 2Captcha (2captcha-python)
153+
### Before: 2Captcha (2captcha-python)
153154

154155
```python
155156
# Before: 2Captcha
@@ -158,11 +159,28 @@ from twocaptcha import TwoCaptcha
158159
solver = TwoCaptcha("YOUR_2CAPTCHA_API_KEY")
159160
result = solver.recaptcha(
160161
sitekey="YOUR_SITE_KEY",
161-
url="[https://target-website.com/page-with-recaptcha](https://target-website.com/page-with-recaptcha)",
162+
url="https://target-website.com/page-with-recaptcha",
162163
)
163164
token = result["code"]
164165
```
165166

167+
### Before: Capsolver (capsolver-python)
168+
169+
```python
170+
# Before: Capsolver
171+
import capsolver
172+
173+
capsolver.api_key = "YOUR_CAPSOLVER_API_KEY"
174+
solution = capsolver.solve({
175+
"type": "ReCaptchaV2TaskProxyLess",
176+
"websiteURL": "https://target-website.com/page-with-recaptcha",
177+
"websiteKey": "YOUR_SITE_KEY",
178+
})
179+
token = solution["gRecaptchaResponse"]
180+
```
181+
182+
### After: CapMonster Cloud
183+
166184
```python
167185
# After: CapMonster Cloud
168186
import asyncio
@@ -173,42 +191,27 @@ client = CapMonsterClient(options=ClientOptions(api_key="YOUR_CAPMONSTER_API_KEY
173191

174192
async def solve():
175193
result = await client.solve_captcha(RecaptchaV2Request(
176-
websiteUrl="[https://target-website.com/page-with-recaptcha](https://target-website.com/page-with-recaptcha)",
194+
websiteUrl="https://target-website.com/page-with-recaptcha",
177195
websiteKey="YOUR_SITE_KEY",
178196
))
179197
return result.get("gRecaptchaResponse")
180198

181199
token = asyncio.run(solve())
182200
```
183201

184-
### Migration from Capsolver (capsolver-python)
185-
186-
```python
187-
# Before: Capsolver
188-
import capsolver
189-
190-
capsolver.api_key = "YOUR_CAPSOLVER_API_KEY"
191-
solution = capsolver.solve({
192-
"type": "ReCaptchaV2TaskProxyLess",
193-
"websiteURL": "[https://target-website.com/page-with-recaptcha](https://target-website.com/page-with-recaptcha)",
194-
"websiteKey": "YOUR_SITE_KEY",
195-
})
196-
token = solution["gRecaptchaResponse"]
197-
```
198-
199-
The "After" code is the same CapMonster Cloud snippet as above: only the client, the API key and the request class change, the rest of your scraper stays the same. If you use an async framework, call `await client.solve_captcha(...)` directly instead of `asyncio.run`.
202+
Only the client, the API key and the request class change: the token is used exactly as before, so the rest of your scraper stays the same. If you use an async framework, call `await client.solve_captcha(...)` directly instead of `asyncio.run`.
200203

201204
### Keep existing 2Captcha-based software
202205

203206
Software that already speaks the 2Captcha API can work with CapMonster Cloud without code changes. See the [guide for connecting other services' APIs](https://docs.capmonster.cloud/docs/external-services/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
204207

205208
---
206209

207-
## 🛡️ Supported CAPTCHA Types: reCAPTCHA, Cloudflare Turnstile, DataDome, GeeTest & More
210+
## 🛡️ Supported CAPTCHA Types: Bypass reCAPTCHA, Cloudflare Turnstile, GeeTest and More
208211

209212
Use this Python captcha solver for captcha bypass in web scraping and automation: reCAPTCHA bypass (v2, v3, Enterprise), Cloudflare Turnstile solver, DataDome solver, GeeTest solver, Amazon WAF bypass and image-to-text recognition.
210213

211-
All task types conform to the official [CapMonster Cloud API Documentation](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme):
214+
All task types follow the official [CapMonster Cloud API documentation](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme):
212215

213216
| Protection Type | Task Request Class | Proxyless Mode |
214217
| :--- | :--- | :---: |
@@ -235,10 +238,10 @@ All task types conform to the official [CapMonster Cloud API Documentation](http
235238
[ Extract sitekey & website URL ]
236239
│
237240
▼
238-
[ CapMonsterClient API ] ──► POST createTask to [https://api.capmonster.cloud](https://api.capmonster.cloud)
241+
[ CapMonsterClient API ] ──► POST createTask to https://api.capmonster.cloud
239242
│
240243
▼
241-
[ Neural Network Processing ] ──► Poll getTaskResult (300ms - 6s)
244+
[ Neural Network Processing ] ──► Poll getTaskResult until the task is ready
242245
│
243246
▼
244247
[ Receive Token & Autosubmit ] ──► Complete bypass
@@ -248,50 +251,87 @@ All task types conform to the official [CapMonster Cloud API Documentation](http
248251

249252
## ⚙️ Best Practices
250253

251-
- **Token Expiration:** Most tokens (reCAPTCHA, Turnstile) remain valid for 120 seconds. Inject and submit the solution immediately after receiving the response.
252-
- **Proxy Usage:** For custom tasks and strict protections, use the same proxy in your scraping session and the CapMonster task payload.
253-
- **Balance Monitoring:** Ensure your account balance remains positive in the [Dashboard](https://dash.capmonster.cloud/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
254+
- **Use tokens promptly:** CAPTCHA tokens expire quickly (a reCAPTCHA v2 token is valid for 60 seconds after solving), so submit or inject the solution immediately after receiving the response.
255+
- **Keep session context consistent:** When a task uses a proxy, use the same proxy in your scraping or browser session and in the CapMonster task.
256+
- **Use the right task type:** Choose the request type that matches the target protection and follow the required parameters in the [documentation](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
257+
- **Monitor your balance:** Keep your account balance positive in the [Dashboard](https://dash.capmonster.cloud/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme) and handle API errors in your code.
258+
259+
---
260+
261+
## 💡 Use Cases
262+
263+
- **Web scraping and data collection** from websites you are authorized to access, without manual captcha solving.
264+
- **Browser automation:** get the solution token in Python and inject it into the page with your automation tool.
265+
- **Automated testing (QA)** of your own website and its captcha-protected forms.
266+
- **Backend services** that need a captcha solving API inside a Python application.
254267

255268
---
256269

257270
## ❓ FAQ
258271

259-
**Is CapMonster Cloud a 2Captcha alternative?**
272+
**Is CapMonster Cloud a 2Captcha alternative for Python?**
260273
Yes. It is a captcha solving service with an official Python SDK. For reCAPTCHA v3 it starts at $0.90 per 1,000 solves versus $1.45 at 2Captcha, which is up to 38% cheaper. For Cloudflare Turnstile it starts at $1.30 versus $1.45, which is 10% cheaper.
261274

262-
**Is CapMonster Cloud a Capsolver alternative?**
275+
**Is CapMonster Cloud a Capsolver alternative for Python?**
263276
Yes. For reCAPTCHA v3 it is 10% cheaper than Capsolver ($0.90 versus $1.00 per 1,000 solves) and shows an API response time of ≤ 2 s versus < 3 s. See the comparison table above and its disclaimer.
264277

265278
**How do I migrate from 2Captcha or Capsolver to CapMonster Cloud in Python?**
266279
Install `capmonstercloudclient`, create a `CapMonsterClient` with your API key and replace your solver call with `client.solve_captcha(...)`. See the migration examples above. Software that already supports the 2Captcha API can also be connected through the [CapMonster Cloud guide](https://docs.capmonster.cloud/docs/external-services/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
267280

268-
**Which captchas can the Python SDK bypass?**
269-
reCAPTCHA v2, v3 and Enterprise, Cloudflare Turnstile, GeeTest, Amazon WAF, DataDome, Imperva / Incapsula, Binance CAPTCHA, standard text (image-to-text) captchas and reCAPTCHA image tasks. See the supported types table.
281+
**Is there an official Python captcha solver from CapMonster Cloud?**
282+
Yes. This repository is the official Python client library for the CapMonster Cloud captcha solving service.
270283

271-
**Which Python versions are supported?**
272-
The package on PyPI requires Python 3.6 or newer.
284+
**How do I bypass reCAPTCHA v2 in Python?**
285+
Create a `CapMonsterClient` with your API key, pass a `RecaptchaV2Request` with the page URL and sitekey to `client.solve_captcha()` and read `result.get("gRecaptchaResponse")`. See the [reCAPTCHA v2 documentation](https://docs.capmonster.cloud/docs/captchas/no-captcha-task/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
286+
287+
**How do I bypass Cloudflare Turnstile in Python?**
288+
Use `TurnstileRequest` with the page URL and sitekey, as in example 2 above, and read `solution.get("token")`. According to the [Turnstile documentation](https://docs.capmonster.cloud/docs/captchas/turnstile-task/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme), all Turnstile subtypes are supported automatically: manual, non-interactive and invisible.
289+
290+
**Which captcha types does the Python SDK solve?**
291+
reCAPTCHA v2, v3 and Enterprise, Cloudflare Turnstile, GeeTest, Amazon WAF, DataDome, Imperva / Incapsula, Binance CAPTCHA, standard text (image-to-text) captchas and reCAPTCHA image tasks. See the supported types table above and the [Supported Captchas Overview](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
273292

274293
**How do I get an API key?**
275294
Register on CapMonster Cloud, top up your balance and copy your API key. The [Getting Started Guide](https://docs.capmonster.cloud/docs/getting-start/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme) describes each step.
276295

296+
**Which Python versions are supported?**
297+
The package on PyPI requires Python 3.6 or newer.
298+
299+
**How fast are captchas solved?**
300+
On average between 1 and 30 seconds, depending on the captcha type. More details are in the [CapMonster Cloud FAQ](https://docs.capmonster.cloud/docs/faq/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
301+
302+
**How long is a reCAPTCHA v2 solution valid?**
303+
According to the [reCAPTCHA v2 documentation](https://docs.capmonster.cloud/docs/captchas/no-captcha-task/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme), the returned token is valid for 60 seconds after the captcha is solved, so use it right away.
304+
305+
**Where is the full API reference?**
306+
See the [API Methods Reference](https://docs.capmonster.cloud/docs/methods/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
307+
277308
---
278309

279-
## 📚 Official Documentation & Links
310+
## ⚖️ Responsible Use
311+
312+
CapMonster Cloud is intended for legitimate business purposes only, such as testing your own website or a website you are authorized to test, and recognizing images you provide. Read more about [ethical and transparent captcha automation](https://capmonster.cloud/en/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme).
313+
314+
---
315+
316+
## 📚 Documentation & Support
280317

281318
- 📖 [Getting Started Guide](https://docs.capmonster.cloud/docs/getting-start/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
282319
- 🎯 [Supported Captchas Overview](https://docs.capmonster.cloud/docs/captchas/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
283320
- ⚙️ [API Methods Reference](https://docs.capmonster.cloud/docs/methods/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
321+
- ❓ [CapMonster Cloud FAQ](https://docs.capmonster.cloud/docs/faq/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
322+
- 🌐 [Browser Extension Guides](https://docs.capmonster.cloud/docs/extension/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
284323
- 💬 [Support & Community](https://capmonster.cloud/en/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme#support)
285324

286-
## Other official SDKs
325+
## Other official SDKs & integrations
287326

288-
- [.NET](https://github.com/CapMonsterCloud/capmonster-dotnet-captcha-solver)
289327
- [Node.js](https://github.com/CapMonsterCloud/capmonster-nodejs-captcha-solver)
328+
- [.NET](https://github.com/CapMonsterCloud/capmonster-dotnet-captcha-solver)
290329
- [Go](https://github.com/CapMonsterCloud/capmonster-go-captcha-solver)
291330
- [PHP](https://github.com/CapMonsterCloud/capmonster-php-captcha-solver)
292331
- [Rust](https://github.com/CapMonsterCloud/capmonster-rust-captcha-solver)
293332
- [n8n](https://github.com/CapMonsterCloud/capmonster-n8n-captcha-solver)
294333
- [MCP server](https://github.com/CapMonsterCloud/capmonster-mcp-captcha-solver)
334+
- [MCP server for Patchright](https://github.com/CapMonsterCloud/capmonster-mcp-patchright-captcha-solver)
295335
- [API Docs](https://github.com/CapMonsterCloud/capmonster-captcha-solver-docs)
296336

297337
---

0 commit comments

Comments
 (0)