| Crates.io | twocaptcha |
| lib.rs | twocaptcha |
| version | 0.0.3 |
| created_at | 2025-07-19 07:56:58.414091+00 |
| updated_at | 2025-07-19 07:56:58.414091+00 |
| description | 2Captcha API client written in Rust. |
| homepage | |
| repository | https://github.com/h-sumiya/2captcha-rust |
| max_upload_size | |
| id | 1759998 |
| size | 94,495 |
2Captcha API client written in Rust.
Important: this is an unofficial project. It is a community port of the
official 2captcha-python library
located in the python/ directory of this repository.
Add twocaptcha to the dependencies section of your Cargo.toml:
[dependencies]
twocaptcha = "0.0.1"
use twocaptcha::{TwoCaptcha, TwoCaptchaConfig, RecaptchaVersion};
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let solver = TwoCaptcha::new("YOUR_API_KEY".to_string(), TwoCaptchaConfig::default());
let mut params = HashMap::new();
params.insert("min_score".to_string(), "0.3".to_string());
let result = solver.recaptcha(
"6LfB5_IbAAAAAMCtsjEHEHKqcB9iQocwwxTiihJu",
"https://2captcha.com/demo/recaptcha-v3",
Some(RecaptchaVersion::V3),
Some(false),
Some(params),
).await?;
println!("Solved captcha: {}", result.code.unwrap_or_default());
Ok(())
}
More examples can be found in the examples directory.
This project is licensed under the MIT License. See the LICENSE file for details.