Anticaptcha::Request - API requests
use Anticaptcha::Request; my $Anticaptcha = Anticaptcha::Request->new( clientKey => '123abc123abc123abc112abc123abc123', responce => 'json' ); my $balance_json = $Anticaptcha->getBalance(); print $balance_json,"\n"; my $stat_json = $Anticaptcha->getQueueStats({queueId => 1}); print $stat_json,"\n";
or
use Anticaptcha::Request; my $Anticaptcha = Anticaptcha::Request->new( clientKey => '123abc123abc123abc112abc123abc123' ); my $balance = $Anticaptcha->getBalance(); if($balance->{errorId} == 0){ print $balance->{balance},"\n"; }else{ print "Error gettting balance: ",$balance->{errorDescription},"\n"; }
The following options correspond to attribute methods described below:
KEY DEFAULT REQUIRED ----------- ----------- ----------- clientKey undef YES responce 'hash'
clientKey
responce
'json' - methods returns string in JSON format, 'hash' - methods returns JSON decoded hash structure.
Method for creating a task. See API documentation: https://anticaptcha.atlassian.net/wiki/display/API/createTask+%3A+captcha+task+creating
Options:
KEY DEFAULT REQUIRED ----------- ----------- ----------- task undef YES softId undef languagePool undef
task
softId
languagePool
Example:
my $task = $Anticaptcha->createTask({ task => { type => 'NoCaptchaTask', websiteURL => 'https://SiteWithCaptcha.com/page.html', websiteKey => 'See API documentation', proxyType => 'http', proxyAddress => '192.168.1.1', proxyPort => 1212, userAgent => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)' }, languagePool => 'en' });
Method for retrieve account balance. See API documentation: https://anticaptcha.atlassian.net/wiki/display/API/getBalance+%3A+retrieve+account+balance
No options available for this method.
my $balance = $Anticaptcha->getBalance();
Method for obtain queue load statistics. See API documentation: https://anticaptcha.atlassian.net/wiki/display/API/getQueueStats+%3A+obtain+queue+load+statistics
KEY DEFAULT REQUIRED ----------- ----------- ----------- queueId 1 YES
queueId
my $stat = $Anticaptcha->getQueueStats({queueId => 2}); print $stat,"\n";
Method for request task result. See API documentation: https://anticaptcha.atlassian.net/wiki/display/API/getTaskResult+%3A+request+task+result
KEY DEFAULT REQUIRED ----------- ----------- ----------- taskId undef YES
taskId
my $result = $Anticaptcha->getTaskResult({taskId => $taskId}); print $result,"\n";
Copyright 2016, Alexander Mironov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Anticaptcha, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Anticaptcha
CPAN shell
perl -MCPAN -e shell install Anticaptcha
For more information on module installation, please visit the detailed CPAN module installation guide.