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

captcha-service

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

captcha-service

Lib support to solve 2D captcha with 2captcha, anticaptcha, deathcaptcha, azcaptcha and ...

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by900%
Maintainers
1
Weekly downloads
 
Created
Source

Captcha Service

Supported captcha services

  • 2Captcha
  • AntiCaptcha
  • deathbycaptcha
  • AZcaptcha

Installation

Via npm:

npm i -S captcha-service

Update via npm:

npm update captcha-service

Usage

const CaptchaService = require('captcha-service');

const solver = new CaptchaService({
  captcha_service: "twocaptcha",
  captcha_key: "captcha_key",
  imageCaptchaPath: "./img.png",
  renameImage: false
});

solver.Stream.on('log', data => console.log('log:', data));

solver.solveCaptcha().then(text => {

  console.log("Result:", text);

  // log: Solving captcha trytime=1
  // log: Solve captcha with captcha_index: 0
  // log: TwoCaptcha: {"_id":"67389604474","_apiResponse":"OK|vbwzye","_text":"vbwzye"}
  // log: Captcha result: vbwzye | img.png
  // Result: vbwzye

}).catch(err => console.log(err));

API

CaptchaService([options])

  • options <Object>
    • captcha_service <string> Has support: (require)
      • azcaptcha
      • twocaptcha
      • anticaptcha
      • deathbycaptcha
    • captchaType <string> Has support: Default: "image"
      • image
      • recaptchav2
    • websiteURL <string> For Recaptcha: Website URL
    • websiteKey <string> For Recaptcha: recaptcha website key
    • captcha_key <string|Array<string>> API KEY of captcha service. Example: ["KEY1", "KEY2"] or just a single key "KEY1" or ["KEY1"]
    • imageCaptchaPath <string|path> Captcha image file address
    • renameImage <boolean> Default: false Whether to rename captcha image file affter solved with the filename as the result of the captcha.
  • return

    .solveCaptcha()

    To solve captcha

    • return: <string> Text from image captcha

    .solveRecapchaV2()

    To solve captcha

    • return: <string> gRecaptchaResponse

    Author

    👤 Văn Tài


    Made with ❤️ by Văn Tài

Keywords

FAQs

Package last updated on 07 Jun 2023

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