PHP code example of juniorb2ss / deathbycaptcha-php-sdk

1. Go to this page and download the library: Download juniorb2ss/deathbycaptcha-php-sdk 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/ */

    

juniorb2ss / deathbycaptcha-php-sdk example snippets


use juniorb2ss\DeathByCaptcha\DeathByCaptcha;

// You need first register and buy credits in http://www.deathbycaptcha.com
$dbc = new DeathByCaptcha('yourUsername', 'yourPassword');

// To retrieve service status
$serviceStatus = $dbc->status();

// To get user informations
$user = $dbc->account();

echo 'My Credits: ' . $user->getBalance(); //1232.2881

// you can pass: path image, base64, image link
$captcha = $dbc->resolve('captcha.jpg');

// supports recaptcha v2
// $captcha = $dbc->resolveV2($googleKey, $webUrl);

// This is captcha ID in service, you need call resolve method with this ID seconds later.
$captchaId = $dbc->captchaId();

// make a simple loop or just sleep
// sleep(7);
$captchaText = $dbc->resolve((int) $captchaId) // return captcha text for human
 bash
$ composer