A small wrapper for the 2captcha API
Clone or download
Latest commit 6e44daf Jul 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
index.js Implementes method decodeRecaptchaV2 Apr 24, 2018
npm-debug.log Added some doc Apr 3, 2015
package.json bugfix May 16, 2015
readme.md

readme.md

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 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();
    }
});