PHP code example of capmonstercloud / capmonster-client
1. Go to this page and download the library: Download capmonstercloud/capmonster-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
capmonstercloud / capmonster-client example snippets
use CapMonsterCloud\Exception\CapMonsterException;
use CapMonsterCloud\Exception\GetResultException;
use CapMonsterCloud\Exception\TimeoutException;
try {
$solution = $client->solve($request);
} catch (GetResultException $e) {
// the API returned an error, e.g. $e->errorCode === 'ERROR_CAPTCHA_UNSOLVABLE'
} catch (TimeoutException $e) {
// no solution within the maximum waiting time of this captcha type
} catch (CapMonsterException $e) {
// anything else: invalid request, network error, wrong key, zero balance...
}