gladyshev/anticaptcha-client

Modern, convenient and full featured anti-captcha.com client library.

v2.0.0 2022-03-10 16:23 UTC

This package is auto-updated.

Last update: 2024-03-26 19:12:31 UTC


README

Powerful and easy anti-captcha.com API wrapper.

Build Status Scrutinizer Code Quality Code Coverage

Install

$ composer require gladyshev/anticaptcha-client

or

"require": {
  ...
  "gladyshev/anticaptcha-client": "^2.0"
  ...
}

Examples

More examples in examples folder.

$configuration = new \Anticaptcha\Configuration(
    getenv('__ANTICAPTCHA_KEY__')
); 

// PSR-18 HTTP-client
$httpClient = new \GuzzleHttp\Client(); 

$client = new \Anticaptcha\Client(
    $configuration, 
    $httpClient
);

$result = $client->resolveImage(__DIR__.'/data/captcha.png');

var_dump($result->solution);

/*
array(2) {
  ["text"]=>
  string(14) "замочка"
  ["url"]=>
  string(43) "http://69.39.235.18/510/164683106482493.gif"
}
*/

The library strictly follows the API documentation, so full features can be found by looking at the official documentation of the service.