Skip to content

Repository files navigation

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 versionPyPI downloadsPython VersionsGitHub StarsLicense: 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

importasynciofromcapmonstercloudclientimportCapMonsterClient, ClientOptionsfromcapmonstercloudclient.requestsimportRecaptchaV2ProxylessRequest# Initialize client with your API key from dashboardoptions=ClientOptions(api_key="YOUR_CAPMONSTER_API_KEY")
client=CapMonsterClient(options=options)
asyncdefmain():
# Build the task payloadrequest=RecaptchaV2ProxylessRequest(
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd"
)
# Send task and receive tokenresult=awaitclient.solve_captcha(request)
print("reCAPTCHA Token:", result.get("gRecaptchaResponse"))
if__name__=="__main__":
asyncio.run(main())

2. Browser Automation (Playwright + Cloudflare Turnstile)

importasynciofromplaywright.async_apiimportasync_playwrightfromcapmonstercloudclientimportCapMonsterClient, ClientOptionsfromcapmonstercloudclient.requestsimportTurnstileProxylessRequestoptions=ClientOptions(api_key="YOUR_CAPMONSTER_API_KEY")
client=CapMonsterClient(options=options)
asyncdefrun_scraper():
# Solve Turnstile challenge via CapMonster Cloudturnstile_req=TurnstileProxylessRequest(
websiteUrl="https://target-website.com/login",
websiteKey="0x4AAAAAAABnPIDnK2k_e-2"
)
solution=awaitclient.solve_captcha(turnstile_req)
token=solution.get("token")
# Inject token into Playwright browser sessionasyncwithasync_playwright() asp:
browser=awaitp.chromium.launch(headless=False)
page=awaitbrowser.new_page()
awaitpage.goto("https://target-website.com/login")
awaitpage.evaluate(f'document.querySelector("[name=cf-turnstile-response]").value = "{token}";')
awaitpage.click("#submit-button")
awaitbrowser.close()
if__name__=="__main__":
asyncio.run(run_scraper())

🛡️ Supported CAPTCHA Types

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

Protection TypeTask Request ClassProxyless Mode
Cloudflare TurnstileTurnstileProxylessRequest / TurnstileRequest✅ Supported
reCAPTCHA v2RecaptchaV2ProxylessRequest / RecaptchaV2Request✅ Supported
reCAPTCHA v3RecaptchaV3ProxylessRequest✅ Supported
reCAPTCHA EnterpriseRecaptchaV2EnterpriseProxylessRequest / RecaptchaV2EnterpriseRequest✅ Supported
GeeTest (v3, v4)GeeTestProxylessRequest / GeeTestRequest✅ Supported
Amazon WAFAmazonWafRequest✅ Supported
DataDomeDataDomeCustomTaskRequest🌐 Proxy Required
Imperva / IncapsulaImpervaCustomTaskRequest / ImpervaCustomTaskProxylessRequest✅ Supported
Binance CAPTCHABinanceTaskRequest / BinanceTaskProxylessRequest✅ Supported
Standard Text CAPTCHAImageToTextRequest✅ Supported
Complex Image TasksRecaptchaComplexImageTaskRequest✅ 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.

📚 Official Documentation & Links


📄 License

MIT © ZennoLab / CapMonster Cloud

About

Official Python SDK for CapMonster Cloud. Automate and bypass reCAPTCHA v2/v3, Cloudflare Turnstile, DataDome in your web scraping scripts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages