utopictown / coinmarketcap-api-wrapper
针对 CoinMarketCap API 的 PHP 封装。
dev-master
2020-09-17 10:11 UTC
Requires
- php: >=4.0.2
Requires (Dev)
- phpunit/phpunit: ^9.4@dev
- vlucas/phpdotenv: ^5.1@dev
This package is auto-updated.
Last update: 2024-09-17 19:04:40 UTC
README
PHP 封装 CoinMarketCap API
目前仅支持加密货币 API https://coinmarketcap.com/api/documentation/v1/#tag/cryptocurrency
安装
composer require utopictown/coinmarketcap-api-wrapper
使用
use Utopictown\CMCWrapper\CMCWrapper;
$cmc = new CMCWrapper(YOUR_API_KEY);
获取所有活跃加密货币的最新市场数据列表。
$cmc->getCryptocurrencyListingsLatest(['convert' => 'IDR']);
更多参数请参阅 https://coinmarketcap.com/api/documentation/v1/
可用的钩子
- getCryptocurrencyMap
- getCryptocurrencyInfo
- getCryptocurrencyListingsHistorical
- getCryptocurrencyListingsLatest
- getCryptocurrencyMarketPairs
- getCryptocurrencyOHLCVHistorical
- getCryptocurrencyOHLCVLatest
- getCryptocurrencyPerformanceStats
- getCryptocurrencyQuotesHistorical
- getCryptocurrencyQuotesLatest