reilag / php-anticaptcha
AntiCaptcha - Is PHP Library for working with Anticapthca services
Installs: 25 115
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 7
Open Issues: 1
Requires
- php: >=7.2.5
- guzzlehttp/guzzle: ^7.0.1
- psr/log: ~1
README
Anticaptcha PHP SDK
This library will help you to recognize any captcha via specific services.
Easy to install. Easy to use.
packages.org
·
anti-captcha.com
PHP client for Anticaptcha services:
- anti-captcha.com (recommend)
- antigate.com
- captchabot.com
- rucaptcha.com
Install
You can add Anticaptcha as a dependency using the composer.phar CLI:
# Install Composer (if need) curl -sS https://getcomposer.org/installer | php # Add dependency composer require reilag/php-anticaptcha:^1.2.3
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
You can find some examples at /example path.
Recognize captcha
use AntiCaptcha\AntiCaptcha; // Get file content $image = file_get_contents(realpath(dirname(__FILE__)) . '/images/image.jpg'); // Your API key $apiKey = '*********** API_KEY **************'; $antiCaptchaClient = new AntiCaptcha( AntiCaptcha::SERVICE_ANTICAPTCHA, [ 'api_key' => $apiKey, 'debug' => true ] ); echo $antiCaptchaClient->recognize($image, null, ['phrase' => 0, 'numeric' => 0]);
Get balance
use AntiCaptcha\AntiCaptcha; $apiKey = '*********** API_KEY **************'; $service = new \AntiCaptcha\Service\AntiCaptcha($apiKey); $antiCaptchaClient = new \AntiCaptcha\AntiCaptcha($service); echo "Your Balance is: " . $antiCaptchaClient->balance() . "\n";