Free Antpool PHP-API-Client ready to use. (https://www.antpool.com/)
Get files from Github repository
$ git clone https://github.com/Elompenta/antpool-php-api.git $ cd antpool-php-api
Create you own config file and add antpool API access credentials
$ cp config.sample.php config.php $ vim config.php
$ cd antpool-php-api $ git pull
cp config.sample.php config.php
Enter your API Access Details
// antpool user settings public $username = ''; public $api_key = ''; public $api_secret = '';
Username must be your Username, NOT your Account Email
How to use
Execute the file "antpool.php".
antpool.php will load configuration and needed libaries and execute a file wich is named "custom.php" if it is available.
Feel free to create your own Codes in your "custom.php".
We does not overwrite the file "custom.php" in the future releases.
We deliver some example files, like default API lookups or email alerting if any worker does not has a hashrate and seems to be offline.
You can set the following configurations in your "custom.php"
$ant->config('print_error_if_api_down', boolean); // default true
Delivered example scripts:
- Will show the output of all API methods
- Alert via Email / SMS if a worker has zero hashrate ans seems to be down
- Alert via Email / SMS if your balance changed
Create custom checks
You are able to use all official antpool statements. Just call the API-Client with the statement that you want.
Official API Documentation: https://www.antpool.com/user/apiGuild.htm
Variable $currency can be: "BTC, LTC, ETH, ZEC" (default ist BTC)
- Pool Stats
- $ant->get('poolStats', $currency = 'BTC');
- Account balance
- $ant->get('account', $currency = 'BTC');
- Workers Hashrate
- $ant->get('workers', $currency = 'BTC');
- Paymanet History
- $ant->get('paymentHistory', $currency = 'BTC');
$ant->get() return a JSON decoded PHP array.
Feel free to setup a sheduled check via Crontab
vim /etc/crontab */10 * * * * root php /<dir>/antpool-php-api/antpool.php
- We will NEVER store your API-Secret or send it away within any communication
- All API request are encrypted by TLS
Ryan Oliver (https://github.com/xslugx)
- Laravel PHP Facade/Antpool for the Antpool API (https://github.com/aburakovskiy/laravel-antpool-api)