coinpaprika / coinpaprika-api-php-client
coinpaprika.com API v1 client
Installs: 8 671
Dependents: 0
Suggesters: 0
Security: 0
Stars: 25
Watchers: 12
Forks: 8
Open Issues: 11
Requires
- php: >=7.2.5
- doctrine/cache: ^2.2
- guzzlehttp/guzzle: ^7.4.3
- jms/serializer: ^1.13.0
- symfony/yaml: ^5.6.0
Requires (Dev)
- phpunit/phpunit: ^8.2.3
This package is auto-updated.
Last update: 2024-12-31 00:25:17 UTC
README
Usage
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.
Requirements
- PHP >= 7.1
- (optional) PHPUnit to run tests.
Install
Via Composer:
$ composer require coinpaprika/coinpaprika-api-php-client
Getting started
<?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.
Cache usage
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();
Paid API
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();
Examples
Check out the ./examples
directory.
License
CoinpaprikaAPI is available under the MIT license. See the LICENSE file for more info.