Skip to main content

CapMonster Cloud Python SDK: AI Captcha Solver & Anti-Bot Bypass

CapMonster Cloud Python SDK

Fast, AI-driven CAPTCHA solving client for Python. Seamlessly bypass Cloudflare Turnstile, reCAPTCHA v2/v3/Enterprise, DataDome, GeeTest, and Amazon WAF in web scraping and browser automation.

PyPI version PyPI downloads Python Versions GitHub Stars License: MIT


Official asynchronous Python SDK for CapMonster Cloud. Easily plug ultra-fast AI captcha recognition into Playwright, Selenium, Puppeteer, Scrapy, BeautifulSoup, and Requests automation workflows without human-in-the-loop delays.

👉 Get your Free API Key & Free Trial Balance on CapMonster Cloud


⚡ Highlights & Benchmarks

  • ⚡ Sub-Second Speed: Automated AI models solve captchas in 300 ms to 6 seconds depending on the system load.
  • 🤖 Zero Human Workers: 100% automated machine learning pipeline with no manual latencies.
  • 🌐 Browser Automation Ready: Works out-of-the-box with Playwright, Selenium, and Puppeteer.
  • 🛡️ Modern Anti-Bot Bypass: Full support for Cloudflare Turnstile, reCAPTCHA Enterprise, GeeTest, and Amazon WAF.
  • 💰 Cost-Effective: Low-cost pricing structure based on pay-as-you-go balance.

📦 Installation

pip install capmonstercloudclient

🚀 Quick Start & Usage Examples

1. Asynchronous reCAPTCHA v2 Solving

import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import RecaptchaV2Request

# Initialize client with your API key from dashboard
options = ClientOptions(api_key="YOUR_CAPMONSTER_API_KEY")
client = CapMonsterClient(options=options)

async def main():
    # Build the task payload
    request = RecaptchaV2Request(
        websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
        websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd"
    )
    
    # Send task and receive token
    result = await client.solve_captcha(request)
    print("reCAPTCHA Token:", result.get("gRecaptchaResponse"))

if __name__ == "__main__":
    asyncio.run(main())

2. Browser Automation (Playwright + Cloudflare Turnstile)

import asyncio
from playwright.async_api import async_playwright
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import TurnstileRequest

options = ClientOptions(api_key="YOUR_CAPMONSTER_API_KEY")
client = CapMonsterClient(options=options)

async def run_scraper():
    # Solve Turnstile challenge via CapMonster Cloud
    turnstile_req = TurnstileRequest(
        websiteURL="https://target-website.com/login",
        websiteKey="0x4AAAAAAABnPIDnK2k_e-2"
    )
    solution = await client.solve_captcha(turnstile_req)
    token = solution.get("token")

    # Inject token into Playwright browser session
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()
        await page.goto("https://target-website.com/login")
        
        await page.evaluate(f'document.querySelector("[name=cf-turnstile-response]").value = "{token}";')
        await page.click("#submit-button")
        await browser.close()

if __name__ == "__main__":
    asyncio.run(run_scraper())

🛡️ Supported CAPTCHA Types

All task types conform to the official CapMonster Cloud API Documentation:

Protection Type Task Request Class Proxyless Mode
Cloudflare Turnstile TurnstileRequest ✅ Supported
reCAPTCHA v2 RecaptchaV2Request ✅ Supported
reCAPTCHA v3 RecaptchaV3ProxylessRequest ✅ Supported
reCAPTCHA Enterprise RecaptchaV2EnterpriseProxylessRequest / RecaptchaV2EnterpriseRequest ✅ Supported
GeeTest (v3, v4) GeeTestProxylessRequest / GeeTestRequest ✅ Supported
Amazon WAF AmazonWafRequest ✅ Supported
DataDome DataDomeCustomTaskRequest 🌐 Proxy Required
Imperva / Incapsula ImpervaCustomTaskRequest / ImpervaCustomTaskProxylessRequest ✅ Supported
Binance CAPTCHA BinanceTaskRequest / BinanceTaskProxylessRequest ✅ Supported
Standard Text CAPTCHA ImageToTextRequest ✅ Supported
Complex Image Tasks RecaptchaComplexImageTaskRequest ✅ Supported

🛠️ How It Works

[ Script / Scraper ]
         │
         ▼
[ Extract sitekey & website URL ]
         │
         ▼
[ CapMonsterClient API ] ──► POST createTask to https://api.capmonster.cloud
         │
         ▼
[ Neural Network Processing ] ──► Poll getTaskResult (300ms - 6s)
         │
         ▼
[ Receive Token & Autosubmit ] ──► Complete bypass

⚙️ Best Practices

  • Token Expiration: Most tokens (reCAPTCHA, Turnstile) remain valid for 120 seconds. Inject and submit the solution immediately after receiving the response.
  • Proxy Usage: For custom tasks and strict protections, use the same proxy in your scraping session and the CapMonster task payload.
  • Balance Monitoring: Ensure your account balance remains positive in the Dashboard.

Other official SDKs


📄 License

MIT © ZennoLab / CapMonster Cloud

Release files for capmonstercloudclient 4.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capmonstercloudclient 4.3.0
File Size Uploaded
capmonstercloudclient-4.3.0.tar.gz 31.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capmonstercloudclient 4.3.0
File Interpreter ABI Platform
capmonstercloudclient-4.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.5 kB

Release files / capmonstercloudclient-4.3.0.tar.gz

Download URL capmonstercloudclient-4.3.0.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7f59766287a8e12f8a3850dd59ec83f7f28e58e51757246c3a7de0a928c3d081
BLAKE2b-256 checksum
How to use checksums
7a72fa78c02719c9aeb5b5a3bf03fd4fb77cd63439826d28c4bf9cdbebe4db61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / capmonstercloudclient-4.3.0-py3-none-any.whl

Download URL capmonstercloudclient-4.3.0-py3-none-any.whl
Size 51.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea5bfaf1c9e8a44f9628c4afa17c041c80944a12d654144caa4a52c68ef542f6
BLAKE2b-256 checksum
How to use checksums
0c867db2e69a2ed2fdd934c888bd0f5d5f86ec81295850d660a46685c11863f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

4.3.0 This release

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.1

2 release files

1.0.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page