This library provides convenient way to use coinpaprika.com API in PHP.
Coinpaprika delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.
- PHP >= 7.1
- (optional) PHPUnit to run tests.
Via Composer:
$ composer require coinpaprika/coinpaprika-api-php-client
<?php
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';
$client = new \Coinpaprika\Client();
$coins = $client->getCoins();
From $client
object, you can access all the endpoints.
For deserialization process it is advised to initiate the $client
with $cacheDir
argument.
<?php
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';
$client = new \Coinpaprika\Client('my/cache/directory');
$coins = $client->getTickers();
To use paid version set the api key
<?php
// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';
$client = new \Coinpaprika\Client('my/cache/directory');
$client->setApiKey('PROVIDED_API_KEY');
$coins = $client->getCoins();
Check out the ./examples
directory.
CoinpaprikaAPI is available under the MIT license. See the LICENSE file for more info.