PHP code example of mahtab2003 / faucetpay
1. Go to this page and download the library: Download mahtab2003/faucetpay 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/ */
mahtab2003 / faucetpay example snippets
use \Mahtab2003\FaucetPay\Api;
// Create a new Api class instance.
$api = new Api('API Key', 'BTC');
// Get the balance of the faucet.
$response = $api->getBalance();
// Check whether the request was successful.
if ($response->isSuccessful()) {
$data = $response->getData();
echo 'Your faucet balance is: ' . $data['balance'];
} else {
echo 'Error: ' . $response->getMessage();
}