Fast, AI-driven CAPTCHA solving client for Rust. Seamlessly bypass Cloudflare Turnstile, reCAPTCHA v2/v3/Enterprise, DataDome, GeeTest, and Amazon WAF in web scraping and browser automation.
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
- β‘ 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.
[dependencies]
capmonstercloud-client = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Minimum supported Rust version: 1.88. TLS is rustls (no OpenSSL needed).
use capmonstercloud_client::requests::RecaptchaV2Request;
use capmonstercloud_client::{CapMonsterClient, ClientOptions};
#[tokio::main]
async fn main() -> capmonstercloud_client::Result<()> {
// Initialize client with your API key from the dashboard
let client = CapMonsterClient::new(ClientOptions::new("YOUR_CAPMONSTER_API_KEY"))?;
// Build the task payload
let request = RecaptchaV2Request::new(
"https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
"6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
);
// Send task and receive token (the `solution` object as serde_json::Value)
let solution = client.solve_captcha(&request).await?;
println!("reCAPTCHA Token: {}", solution["gRecaptchaResponse"]);
Ok(())
}use capmonstercloud_client::requests::{TurnstileRequest, TurnstileStandard};
use capmonstercloud_client::{CapMonsterClient, ClientOptions, ProxyInfo, ProxyType};
#[tokio::main]
async fn main() -> capmonstercloud_client::Result<()> {
let client = CapMonsterClient::new(ClientOptions::new("YOUR_CAPMONSTER_API_KEY"))?;
let proxy = ProxyInfo::new(ProxyType::Http, "203.0.113.10", 8080).with_auth("login", "password");
let request = TurnstileRequest::new(
"https://target-website.com/login",
"0x4AAAAAAABnPIDnK2k_e-2",
TurnstileStandard::new().with_proxy(proxy),
);
let solution = client.solve_captcha(&request).await?;
// inject solution["token"] into the cf-turnstile-response field of your browser session and submit
println!("Turnstile token: {}", solution["token"]);
Ok(())
}println!("balance: {}", client.get_balance().await?);
// solve_captcha() = create_task() + polling get_task_result()
let task_id = client.create_task(&request).await?;
match client.get_task_result(task_id).await? {
TaskStatus::Processing => println!("not ready yet"),
TaskStatus::Ready(solution) => println!("{solution}"),
}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, ...).
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/.
[ 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
- 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.
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).
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).
- π Getting Started Guide
- π― Supported Captchas Overview
- βοΈ API Methods Reference
- π¬ Support & Community
MIT Β© ZennoLab / CapMonster Cloud