You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5a5ff75
Browse filesBrowse the repository at this point in the historyBrowse files
# CapMonster Cloud Python SDK: Python Captcha Solver & Captcha Bypass for reCAPTCHA, Cloudflare Turnstile and GeeTest
2
2
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.
<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">
8
8
</a>
9
9
</p>
10
10
@@ -30,21 +30,22 @@ The CapMonster Cloud Python SDK (`capmonstercloudclient`, also known as the CapM
30
30
31
31
---
32
32
33
-
## ⚡ Highlights & Benchmarks
33
+
## ⚡ Highlights
34
34
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.
37
38
- 🌐 **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).
42
43
43
44
---
44
45
45
46
## 📊 CapMonster Cloud vs 2Captcha vs Capsolver
46
47
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.
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.
151
152
152
-
### Migration from 2Captcha (2captcha-python)
153
+
### Before: 2Captcha (2captcha-python)
153
154
154
155
```python
155
156
# Before: 2Captcha
@@ -158,11 +159,28 @@ from twocaptcha import TwoCaptcha
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`.
200
203
201
204
### Keep existing 2Captcha-based software
202
205
203
206
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).
## 🛡️ Supported CAPTCHA Types: Bypass reCAPTCHA, Cloudflare Turnstile, GeeTest and More
208
211
209
212
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.
210
213
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):
212
215
213
216
| Protection Type | Task Request Class | Proxyless Mode |
214
217
| :--- | :--- | :---: |
@@ -235,10 +238,10 @@ All task types conform to the official [CapMonster Cloud API Documentation](http
235
238
[ Extract sitekey & website URL ]
236
239
│
237
240
▼
238
-
[ CapMonsterClient API ] ──► POST createTask to [https://api.capmonster.cloud](https://api.capmonster.cloud)
241
+
[ CapMonsterClient API ] ──► POST createTask to https://api.capmonster.cloud
@@ -248,50 +251,87 @@ All task types conform to the official [CapMonster Cloud API Documentation](http
248
251
249
252
## ⚙️ Best Practices
250
253
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.
254
267
255
268
---
256
269
257
270
## ❓ FAQ
258
271
259
-
**Is CapMonster Cloud a 2Captcha alternative?**
272
+
**Is CapMonster Cloud a 2Captcha alternative for Python?**
260
273
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.
261
274
262
-
**Is CapMonster Cloud a Capsolver alternative?**
275
+
**Is CapMonster Cloud a Capsolver alternative for Python?**
263
276
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.
264
277
265
278
**How do I migrate from 2Captcha or Capsolver to CapMonster Cloud in Python?**
266
279
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).
267
280
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.
270
283
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).
273
292
274
293
**How do I get an API key?**
275
294
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.
276
295
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
+
277
308
---
278
309
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
280
317
281
318
- 📖 [Getting Started Guide](https://docs.capmonster.cloud/docs/getting-start/?utm_source=github&utm_medium=referral&utm_campaign=python_repo_readme)
0 commit comments