olegdemkiv/coinmarketcap-api-php-client

Client library for CoinMarketCap API

v1.0.0 2023-07-04 10:33 UTC

This package is auto-updated.

Last update: 2024-04-04 12:23:21 UTC


README

Build Latest Stable Version License

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

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.