Expand description
§TwoCaptcha Rust Library
A Rust library for easy integration with the 2captcha captcha solving service. This library allows you to solve various types of captchas including reCAPTCHA, FunCaptcha, GeeTest, hCaptcha, and many others.
§Example
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());
// Solve a reCAPTCHA
let result = solver.recaptcha(
"site_key",
"https://example.com",
Some(RecaptchaVersion::V2),
Some(false), // enterprise
None, // additional params
).await?;
println!("Captcha solved: {}", result.code.unwrap_or_default());
Ok(())
}Re-exports§
pub use api::ApiClient;pub use error::Result;pub use error::TwoCaptchaError;pub use solver::TwoCaptcha;pub use solver::TwoCaptchaConfig;pub use types::AudioLanguage;pub use types::Balance;pub use types::CaptchaResult;pub use types::ExtendedResponse;pub use types::Proxy;pub use types::RecaptchaVersion;pub use error::SolverExceptions;