ivan-podgornov / rucaptcha-client


Client for sites https://rucaptcha.com and https://2captcha.com. 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, rucaptcha.com will be used
  rucaptcha.baseUrl = 'https://2captcha.com';
  // If the API key was specified incorrectly, it will throw RucaptchaError with the code
  // ERROR_KEY_DOES_NOT_EXIST. It is useful to call this method immediately after
  // initialize 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); // -> cyku if employees have solved the captcha correctly
balance: number - the result of the last getBalance or null.
baseUrl: string = 'https://rucaptcha.com' - the base URL to which you want to make a request. If you want to change it to https://2captcha.com, after creating the captcha object, change the baseUrl property. See example above

constructor (apikey: string) - the key can be found here: https://rucaptcha.com/setting.
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.

Documentation https://github.com/ivan-podgornov/rucaptcha-client