olegdemkiv / coinmarketcap-api-php-client
Client library for CoinMarketCap API
v1.0.0
2023-07-04 10:33 UTC
Requires
- php: >=8.0
- php-http/discovery: ^1.18
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.17
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9
README
This client library is built for interacting with the CoinMarketCap API. It is based on the PSR-17 and PSR-18 standards and supports HTTP client autodiscovery.
Requirements
- PHP 8.0 or higher
- HTTP Client (should be PSR-18 compatible)
Installation
composer require olegdemkiv/coinmarketcap-api-php-client
Example
$key = 'xxxxx-xxxxx-xxxxx-xxxxx-xxxxx'; $client = new OlegDemkiv\CoinMarketCapClient\Client($key); $result = $client->cryptocurrency()->quotesLatest(['id' => '1,2,1027']); // BTC, LTC, ETH var_dump($result);
Endpoints
Support | Endpoint Category | Description |
---|---|---|
✅ | /blockchain/* |
Endpoints that return block explorer related data for blockchains. |
✅ | /community/* |
Endpoints that return community data. |
✅ | /content/* |
Endpoints that return cryptocurrency-related news, headlines, articles, posts, and comments. |
✅ | /cryptocurrency/* |
Endpoints that return data around cryptocurrencies such as ordered cryptocurrency lists or price and volume data. |
✅ | /exchange/* |
Endpoints that return data around cryptocurrency exchanges such as ordered exchange lists and market pair data. |
✅ | /fiat/* |
Endpoints that return data around fiats currencies including mapping to CMC IDs. |
✅ | /global-metrics/* |
Endpoints that return aggregate market data such as global market cap and BTC dominance. |
✅ | /key/* |
API key administration endpoints to review and manage your usage. |
✅ | /tools/* |
Useful utilities such as cryptocurrency and fiat price conversions. |