Package: coinmarketcap-client
Python Coin Market Cap ClientA Python library to connect withCoin Market CapAPIs.Supported APIs:TickerTicker for Specific CryptocurrencyListingsGlobal DataInstallpip install coinmarketcap-clientTeststoxUsage>>> from coinmarketcap.clients import CoinMarketCapClient
>>> client = CoinMarketCapClient()List cryptocurrenciesReturn the active list of cryptocurrencies.>>> client.listing.get()
[{'id': 1, 'name': 'Bitcoin', 'symbol': 'BTC', 'website_slug': 'bitcoin'}, {'id': 2, 'name': 'Litecoin', 'symbol': 'LTC', 'website_slug': 'litecoin'}, ...Get tickersReturn the ticker data for all active cryptocurrencies.Parameters:limit[optional]: Return a maximum of [limit] results (default is 100; max is 100)start[optional]: Return results from rank [start] and abovesort[optional]: Return results sorted by [sort] . Possible values are "id", "rank", "volume_24h" and "percent_change_24h" (default is rank).currency[optional]: Return pricing info in terms of another currency (default is USD)Supported values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"Also supports these cryptocurrency values: "BTC", "ETH" "XRP", "LTC", and "BCH">>> client.tickers.get()
[{'id': 1, 'name': 'Bitcoin', 'symbol': 'BTC', 'website_slug': 'bitcoin', 'rank': 1, 'circulating_supply': 17073725.0, 'total_supply': 17073725.0, 'max_supply': 21000000.0, 'quotes': {'USD': {'price': 7600.48, 'volume_24h': 4943200000.0, 'market_cap': 129768505388.0, 'percent_change_1h': -0.32, 'percent_change_24h': -1.66, 'percent_change_7d': 4.4}}, 'last_updated': 1528100975}, {'id': 1027, 'name': 'Ethereum', 'symbol': 'ETH', 'website_slug': 'e...Get ticker by CryptocurrencyReturn the last ticker data for specific cryptocurrency.Parameters:coin_id: The cryptocurrency id in Coin Market Cap API.currency[optional]: Return pricing info in terms of another currency (default is USD)Supported values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"Also supports these cryptocurrency values: "BTC", "ETH" "XRP", "LTC", and "BCH">>> client.cryptocoin.get(coin_id=1)
{'id': 1, 'name': 'Bitcoin', 'symbol': 'BTC', 'website_slug': 'bitcoin', 'rank': 1, 'circulating_supply': 17083000.0, 'total_supply': 17083000.0, 'max_supply': 21000000.0, 'quotes': {'USD': {'price': 7635.7, 'volume_24h':4211460000.0, 'market_cap': 130440663100.0, 'percent_change_1h': -0.13, 'percent_change_24h': -0.6, 'percent_change_7d': 1.86}}, 'last_updated': 1528503874}Get global summary dataReturns the global summary data from Coin Market Cap.Parameters:currency[optional]: Return pricing info in terms of another currency (default is USD)Supported values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR"Also supports these cryptocurrency values: "BTC", "ETH" "XRP", "LTC", and "BCH">>> client.global_data.get()
{'active_cryptocurrencies': 1654, 'active_markets': 11318, 'bitcoin_percentage_of_market_cap': 38.08, 'quotes': {'USD': {'total_market_cap': 342680267176.0, 'total_volume_24h': 13469496559.0}}, 'last_updated': 1528506574}CustomizingParsing response data from Coin Market Cap APIYou can create your own parser to customizing Coin Market Cap response.class MyParser:

    @classmethod
    def parse(cls, data):
        """
            Implement your customized parse classmethod.
        """Then you can pass your custom parserMyParserby param into some client initialization.client = TickerClient(MyParser) # Client to get tickers from Coin Market CapThis way, you can customize the parsing method from any single client from this lib.from coinmarketcap.clients import *

tickers_c = TickerClient(MyParser)
criptocoin_c = CryptoCoinTickerClient(MyParser)
listing_c = ListCryptoCoinClient(MyParser)
global_c = GlobalSummaryClient(MyParser)But you also can customize the response from CoinMarketCapClient, like the example above:client = CoinMarketCap()
MyParser.parse(client_c.tickers.get())