Socket
Socket
Sign inDemoInstall

async-captcha

Package Overview
Dependencies
4
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    async-captcha

API wrapper for captcha solving services.


Version published
Weekly downloads
84
increased by127.03%
Maintainers
1
Install size
467 kB
Created
Weekly downloads
 

Readme

Source

async-captcha

Automate the process of captcha solving for various services.

Current list of supported services:
[✔]anti-captcha

Installation

npm i async-captcha

Usage

Include the module in your code:

const captcha = require("async-captcha");

// Parameters: (API_KEY:String, IntervalSeconds:Number, MaxRetry:Number)

const anticaptcha = new captcha("YOUR_API_KEY", 2, 10);

Async/await

anticaptcha.getResult
// Your image as base64 string
const base64Image = "iVBORw0KGgoAAAANSUhEUg......lFTkSuQmCC=";

let res = await anticaptcha.getResult(base64Image, options);

// res contains the solved captcha value
console.log(res);
// "pKwtH5"

Promises

Same as async/await, but using promises.

anticaptcha.getResult
anticaptcha
  .getResult(base64)
  .then(res => {
    console.log(res);
  })
  .catch(err => {
    if (err) console.log(err);
  });

Custom Properties

You can pass additional properties as 2nd parameter of .getResult() method in form of object. If you don't pass any parameters it'll use default values instead

Here are available parameters:

PropertyTypeDefault
phraseBooleanfalse
caseBooleanfalse
numericInteger0
mathBooleanfalse
minLengthInteger0
maxLengthInteger0
^ Detailed descriptions can be found here.
// Your image as base64 string
const base64Image = "iVBORw0KGgoAAAANSUhEUg......lFTkSuQmCC=";

const options = {
  case: true,
  minLength: 5,
  maxLength: 5
};

let res = await anticaptcha.getResult(base64Image, options);

// res contains the solved captcha value
console.log(res);
// "pKwtH5"

Keywords

FAQs

Last updated on 11 Oct 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc