captcha_oxide 1.0.0

Library for interacting with the 2Captcha API to solve captcha puzzles
Documentation

captcha_oxide

Build Crates.io Documentation

This is a rust library for solving captcha puzzles with the 2Captcha API

Usage

use captcha_oxide::{
  CaptchaSolver,
  RequestContent,
  Error,
  arguments::{CaptchaArguments, RecaptchaV3},
};

#[tokio::main]
async fn main() -> Result<(), Error> {
  let solver = CaptchaSolver::new("YOUR TWOCAPTCHA API KEY");

  let args = RecaptchaV3::builder()
    .page_url("https://someurl.com")
    .site_key("SITE_KEY")
    .build();

  let solution = solver.solve(args).await?.solution;

  // If there isn't a variant named after your captcha type,
  // it's because it only returns a token, so you should use
  // the String variant
  let RequestContent::String(solution) = solution else {
    unreachable!()
  };

  assert_ne!(solution, "");

  Ok(())
}