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

2captcha-api

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

2captcha-api

A wrapper for the 2Captcha API

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132
decreased by-30.89%
Maintainers
1
Weekly downloads
 
Created
Source

2Captcha API wrapper for Node.js

Post a captcha to the 2Captcha service, then polls until the captcha is decoded.

Installation

npm install 2captcha

Usage

Set up your api key:

var solver = require('2captcha');

solver.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');

Decode from a url, with a 10 seconds polling interval: (default = 2000ms)

solver.decodeUrl(url, {pollingInterval: 10000}, function(err, result, invalid) {
    console.log(result.text);
});

Decode reCaptcha, with a 10 seconds polling interval: (default = 2000ms)

solver.decodeReCaptcha(captcha, pageUrl, {pollingInterval: 10000}, function(err, result, invalid) {
    console.log(result.text);
});

Decode from a url retrying 5 times if invalid is called (default = 3)

solver.decodeUrl(url, {retries: 5}, function(err, result, invalid) {
    if(!checkIfCaptchaIsValid(result.text)){
    	return invalid();
    }
});

Keywords

FAQs

Package last updated on 07 Aug 2017

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