I just started rewriting it to match the documentation that can be found on
https://min-api.cryptocompare.com/documentation
There are some new endpoints available, some will get deprecated soon. I cleaned this up. Did not test yet. Added base for phpunit based unit tests.
the easiest way to get started is to use composer to retrieve the files.
The following commands will download the pre compiled composer.phar, which will download the project for us.
cd ~/Projectfolder
wget https://getcomposer.org/composer.phar
{
"require": {
"loeken/cryptocompare-api-php-wrapper": "dev-master"
}
}
"loeken/cryptocompare-api-php-wrapper": "dev-master",
php composer.phar update
composer retrieves the last version of the code from github and downloads it to the vendor/* folder inside your project. It will also generate a autoload.php which you can then load inside your php code, this will then load all classes included in this project. This is also usefull if you want to update our api wrapper to the last version, simply run the composer update command again.
if your .php script file is in the same folder as the vendor folder, use the following line, else adjust the path.
<?php
require_once('vendor/autoload.php');
<?php
require_once('vendor/autoload.php');
$cryptocomparePrice = new Cryptocompare\Price();
$example1 = $cryptocomparePrice->getSingleSymbolPriceEndpoint("true","BTC","USD","CCCAGG","false");
print_r($example1);
?>
thanks to a user submission we now have support for apiKeys you can simply set your apiKey after creating your object
<?php
require_once('vendor/autoload.php');
$cryptocomparePrice = new Cryptocompare\Price();
$cryptocomparePrice->setApiKey("yourapikeyhere");
$example1 = $cryptocomparePrice->getSingleSymbolPriceEndpoint("true","BTC","USD","CCCAGG","false");
print_r($example1);
?>