Rucaptcha Client


Client for sites and . Easy to use because it is completely promise based.

npm install rucaptcha-client

Usage example
import  Rucaptcha  from  'rucaptcha-client' ;

async  ( )  =>  {
  const  rucaptcha  =  new  Rucaptcha ( 'YOUR_APIKEY' ) ;

  // If you want to use 2captcha as endpoint
  // By default, will be used
  rucaptcha . baseUrl  =  '' ;

  // If the API key was specified incorrectly, RucaptchaError will be thrown with the code
  // ERROR_KEY_DOES_NOT_EXIST. It is useful to call this method immediately after
  // initialization to make sure the API key is correct.
  const balance = await rucaptcha.getBalance();

  const imageUrl =
  const answer = await rucaptcha.solve(imageUrl);
  console.log(answer.text); //

  • balance: number - the result of the last getBalance or null.
  • baseUrl: string = ''- the base URL to which the request should be made. If you want to change it to , after creating the captcha object, change the baseUrl property. See example above
  • constructor(apikey: string)- the key can be found here: .
  • async getBalance: Promise<number> - returns the balance of the current user.
  • async solve(url: string): Promise<{ text: string }> - solves a captcha with an image that can be downloaded at the specified url.