edbizarro / cmcphp
PHP 封装 CoinMarketCap API。
v2.0.1
2019-04-22 23:35 UTC
Requires
- php: ^7.1.13
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-18 09:17:59 UTC
README
CoinMarketCap API
此包与 V1 免费API兼容,要使用Pro版本需要进行一些工作(欢迎PR)
以下是一些使用此包的示例
$market = new Edbizarro\Cmc\Market; //get ticker (default limit is set to 10) $market->ticker(); //get ticker with different limit $market->ticker(100); //get ticker for a specific coin $market->ticker('nano'); //get ticker with all options (limit 100, start 0 and convert to BRL) $market->ticker(100, 0, 'BRL');
响应示例
{
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "BTC",
"rank": "1",
"price_usd": "9087.87",
"price_btc": "1.0",
"24h_volume_usd": "7117920000.0",
"market_cap_usd": "153074828154",
"available_supply": "16843862.0",
"total_supply": "16843862.0",
"max_supply": "21000000.0",
"percent_change_1h": "-0.86",
"percent_change_24h": "4.39",
"percent_change_7d": "-21.76",
"last_updated": "1517707168",
"price_brl": "29247.492021",
"24h_volume_brl": "22907601936.0",
"market_cap_brl": "492640719448"
},
{
"id": "ethereum",
"name": "Ethereum",
"symbol": "ETH",
"rank": "2",
"price_usd": "952.455",
"price_btc": "0.104047",
"24h_volume_usd": "3178180000.0",
"market_cap_usd": "92765037932.0",
"available_supply": "97395717.0",
"total_supply": "97395717.0",
"max_supply": null,
"percent_change_1h": "-1.23",
"percent_change_24h": "5.17",
"percent_change_7d": "-15.64",
"last_updated": "1517707154",
"price_brl": "3065.2859265",
"24h_volume_brl": "10228336694.0",
"market_cap_brl": "298545721577"
}
安装
您可以通过composer安装此包
composer require edbizarro/cmcphp