CapMonster Cloud Rust SDK: AI Captcha Solver & Anti-Bot Bypass
Official asynchronous Rust SDK for CapMonster Cloud. Plug ultra-fast AI captcha recognition into your tokio based scrapers and browser-automation workflows (fantoccini, thirtyfour, chromiumoxide, reqwest, ...) 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.
- 🦀 Type-Safe Requests: required parameters are constructor arguments, closed value sets are enums, inconsistent requests are rejected locally before anything is sent.
- 🛡️ Modern Anti-Bot Bypass: Full support for Cloudflare Turnstile, reCAPTCHA Enterprise, GeeTest, DataDome and Amazon WAF.
- 💰 Cost-Effective: Low-cost pricing structure based on pay-as-you-go balance.
📦 Installation
[]
= "0.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Minimum supported Rust version: 1.88. TLS is rustls (no OpenSSL needed).
🚀 Quick Start & Usage Examples
1. Asynchronous reCAPTCHA v2 Solving
use RecaptchaV2Request;
use ;
async
2. Cloudflare Turnstile with a proxy
use ;
use ;
async
3. Account balance and low-level calls
println!;
// solve_captcha() = create_task() + polling get_task_result()
let task_id = client.create_task.await?;
match client.get_task_result.await?
ClientOptions knobs: with_service_url, with_soft_id (default 152), with_client_timeout (one HTTP request, default 20 s), with_client_proxy (http/https proxy for the SDK's own requests), with_timeouts_override.
Errors are a single capmonstercloud_client::Error enum (Validation, Http, CreateTask, GetResult, Timeout, ...).
🛡️ Supported CAPTCHA Types
All task types conform to the official CapMonster Cloud API Documentation:
| Protection Type | Task Request Type | Proxy |
|---|---|---|
| Cloudflare Turnstile / Challenge / Waiting Room | TurnstileRequest (TurnstileStandard, TurnstileChallengeToken, TurnstileChallengeCookie, TurnstileWaitRoom) |
Optional / Required for cookie modes |
| reCAPTCHA v2 | RecaptchaV2Request |
Optional |
| reCAPTCHA v2 Enterprise | RecaptchaV2EnterpriseRequest |
Optional |
| reCAPTCHA v3 | RecaptchaV3ProxylessRequest |
— |
| reCAPTCHA v3 Enterprise | RecaptchaV3EnterpriseRequest |
— |
| GeeTest (v3, v4) | GeetestRequest (GeetestVersion::V3 / V4) |
Optional |
| Amazon WAF | AmazonWafRequest (AmazonVisibleCaptcha, AmazonChallengeAndCaptcha, AmazonChallengeOnly) |
Optional |
| FunCaptcha (Arkose Labs) | FuncaptchaRequest |
🌐 Required |
| DataDome | DataDomeCustomTaskRequest |
🌐 Required |
| Imperva / Incapsula | ImpervaCustomTaskRequest |
🌐 Required |
| TSPD | TspdCustomTaskRequest |
🌐 Required |
| HUNT | HuntCustomTaskRequest |
🌐 Required |
| Basilisk / TenDI / Alibaba / Friendly Captcha / Altcha | BasiliskCustomTaskRequest, TenDiCustomTaskRequest, AlibabaCustomTaskRequest, FriendlyCustomTaskRequest, AltchaCustomTaskRequest |
Optional |
| Binance CAPTCHA | BinanceTaskRequest |
Optional |
| MTCaptcha / Yidun / Prosopo | MtCaptchaRequest, YidunRequest, ProsopoTaskRequest |
Optional |
| Standard Text CAPTCHA | ImageToTextRequest (+ TextModule) |
— |
| Complex Image Tasks | RecaptchaComplexImageTaskRequest, RecognitionComplexImageTaskRequest |
— |
One source file per type lives in src/requests/.
🛠️ How It Works
[ Your service ]
│
▼
[ Extract sitekey & website URL ]
│
▼
[ CapMonsterClient ] ──► 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.
- Secrets in logs:
Debugoutput ofClientOptionsand proxies masks the API key and passwords.
🏷️ Versioning & releases
The crate follows SemVer; user-visible changes are listed in CHANGELOG.md.
While the major version is 0:
| Change | Bump |
|---|---|
| Bugfix, new optional field / metadata key, docs | patch (0.1.0 → 0.1.1) |
| New request type, or any breaking change (renamed/removed public item, a parameter becoming required) | minor (0.1.1 → 0.2.0) |
Release flow (automated by .github/workflows/release.yml): in a PR bump version in Cargo.toml
and add a ## [X.Y.Z] section to CHANGELOG.md; after the merge to main the workflow publishes to
crates.io, tags vX.Y.Z and creates a GitHub Release. The version is also sent in the
User-Agent of every request (Zennolab.CapMonsterCloud.Client.Rust/X.Y.Z).
🧩 Adding a captcha type
src/requests/<snake_name>.rs: a#[derive(Serialize)]struct withnew()+with_*setters,impl CaptchaRequest(TASK_TYPE,CLASSfor CustomTask,timeouts(), optionalvalidate()) and a test asserting the exact JSON. Copyrecaptcha_v2.rs(plain task) oraltcha.rs(CustomTask with typed metadata).- Register it in
src/requests/mod.rs(mod+pub use). Nothing else: the client is generic overCaptchaRequest. cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test(unit tests and the mocked-API tests need neither network nor API key).
📚 Official Documentation & Links
- 📖 Getting Started Guide
- 🎯 Supported Captchas Overview
- ⚙️ API Methods Reference
- 💬 Support & Community