Anticaptcha PHP SDK

CAPTCHAFORUM

Administrator
1655717089962.png

Anticaptcha PHP SDK
This library will help you to recognize any captcha via specific services.
Easy to install. Easy to use.

PHP client for Anticaptcha services:
Install
You can add Anticaptcha as a dependency using the composer.phar CLI:
Code:
# 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;
Code:
// 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
Code:
use AntiCaptcha\AntiCaptcha;

$apiKey = '*********** API_KEY **************';

$service = new \AntiCaptcha\Service\AntiCaptcha($apiKey);
$antiCaptchaClient = new \AntiCaptcha\AntiCaptcha($service);

echo "Your Balance is: " . $antiCaptchaClient->balance() . "\n";

Documentation https://github.com/m-tymchyk/php-anticaptcha