Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rucaptcha-2captcha

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rucaptcha-2captcha

Operates with RuCaptcha.com and 2Captcha.com conveniently.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
616
increased by40.32%
Maintainers
1
Weekly downloads
 
Created
Source

All dependencies Reported vulnerabilities NPM-version Install size Total downloads

rucaptcha-2captcha@1.0.2

Helps you to operate with RuCaptcha or 2Captcha conveniently.

Full documentation you can find on https://rucaptcha.com/api-rucaptcha and https://2captcha.com/2captcha-api respectively.

Installation

rucaptcha-2captcha is available via npm:

$ npm i rucaptcha-2captcha@1.0.2

Usage

Initialization

const RuCaptcha2Captcha = require('rucaptcha-2captcha');

const captchaSolver = new RuCaptcha2Captcha(<YOUR_API_KEY>);
// or for operating with 2Captcha.com
const captchaSolver = new RuCaptcha2Captcha(<YOUR_API_KEY>, '2captcha');

<YOUR_API_KEY> you can find in your account settings (RuCaptcha | 2Captcha)

captchaSolver.send method

Use this method to send captcha for solve. Returns Promise<capthca_id>.
For example:

const id = await captchaSolver.send({
  method: 'base64',
  body: <base64_image_body>,
});

// id: '4503599627'

captchaSolver.sendFile method

Use this method to send captcha as image from your local file system. Returns Promise<capthca_id>.
For example:

const id = await captchaSolver.sendFile('./captcha.jpg', {
  min_len: 6,
  max_len: 6,
  regsense: 1,
  numeric: 4,
});

// id: '4503599627'

captchaSolver.get method

Method for getting captcha solutions. Returns Promise<captcha_token> or Promise<Array<captcha_token>> which resolves as soon as captcha(s) will be solved on service.

  const token = await catpchaSolver.get(id);
  // token: 'ABCD'

  // or
  const tokens = await catpchaSolver.get([id1, id2, ...]);
  // tokens: ['ABCD', 'abcd', ...]

  // or
  const tokens = await catpchaSolver.get('<id1>,<id2>,...');
  // tokens: ['ABCD', 'abcd', ...]

captchaSolver.reportGood and captchaSolver.reportBad methods

Use these methods for reporting captcha results. It's not necessary but better to send reports cause of refund of bad solutions and increasing solving accuracy by reporting good solutions.

  const result = await catpchaSolver.reportGood(id);
  // or
  const result = await catpchaSolver.reportBad(id);
  // result: { status: 1, request: 'OK_REPORT_RECORDED' }

captchaSolver.get2 method

Use captchaSolver.get2 method for getting captcha answer with its cost price. Returns Promise<Object>.

  const info = await catpchaSolver.get2(id);
  // info: { request: '6p6pck', price: '0.034' }

captchaSolver.getBalance method

Use for getting your account balance.

  const balance = await catpchaSolver.getBalance();
  // balance: 50.034

Note: don't use it too often because it decreases your query limit to RuCaptcha (2Captcha) server.


Note that json, key and soft_id are not writable parameters of any method.

More info you can find in documentation (RuCaptcha | 2Captcha).

Testing

No testing functionality provided.


Your improve suggestions and bug reports are welcome any time.

Keywords

FAQs

Package last updated on 02 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc