Using NPM utility to install module directly:
npm install recognize
Arguments:
- File buffer
- Optional parameters
- Callback function
recognize.solving(data, {numeric:1, min_len:5}, function(err, id, code)
{
if(err) throw err;
console.log(id, code);
});
OR
recognize.solving(data, function(err, id, code)
{
if(err) throw err;
console.log(id, code);
});
var recognize = new Recognize('antigate', {
key:'api-key'
});
recognize.balanse(function(price)
{
console.log('My balance:', price);
});
fs.readFile('./captcha.png', function(err, data){
recognize.solving(data, function(err, id, code)
{
if(err) throw err;
if(isValide(code))
console.log('Captcha:', code);
else
{
console.log('Captcha not valid');
recognize.report(id, function(err, answer)
{
console.log(answer);
});
}
});
});
Parameter | Type | Possible values | Description |
phrase | integer | 0, 1 |
0 = default value
1 = captcha has 2-3 words
|
regsense | integer | 0, 1 |
0 = default value
1 = captcha is case sensitive
|
numeric | integer | 0, 1, 2 |
0 = default value
1 = captcha consists of digits only
2 = captcha does not contain any digits
|
calc | integer | 0, 1 |
0 = default value
1 = arithmetical operation must be performed
|
min_len | integer | 0..20 |
0 = default value
1..20 = minimum length of captcha text required to input
|
max_len | integer | 0..20 |
0 = default value
1..20 = maximum length of captcha text required to input
|
is_russian | integer | 0, 1 |
0 = default value
1 = captcha goes to Russian Queue
|