Unofficial Python wrapper around the CoinMarketCap API
- Read the official Documentation
PyPI
Use the following command to install:
pip install CoinMktCap
Source Code
-
git clone https://github.com/sarthakkimtani/CoinMktCap.git cd CoinMktCap python setup.py install
from CoinMktCap import CoinMarketCap
market = CoinMarketCap("API_KEY")
eth = market.cryptocurrency_info(symbol="ETH")
something(eth.data)
Pass the required parameters for each endpoint. Refer the docs
Method | Definition | Endpoint |
---|---|---|
cryptocurrency_map | Map of all currencies | /cryptocurrency/map |
cryptocurrency_info | Info of specified currency | /cryptocurrency/info/ |
cryptocurrency_latest_listings | Active cryptocurrencies with latest market data | /cryptocurrency/listings/latest |
cryptocurrency_historical_listings | Cryptocurrencies for a historical UTC date | /cryptocurrency/listings/historical |
cryptocurrency_latest_quotes | Latest market quote for 1 or more cryptocurrencies | /cryptocurrency/quotes/latest |
cryptocurrency_historical_quotes | Historic market quotes for any cryptocurrency | /cryptocurrency/quotes/historical |
cryptocurrency_market_pairs | Active market pairs for given cryptocurrency | /cryptocurrrency/market-pairs/latest |
cryptocurrency_latest_ohlcv | Latest OHLCV (Open, High, Low, Close, Volume) | /cryptocurrency/ohlcv/latest |
cryptocurrency_historical_ohlcv | Historical OHLCV (Open, High, Low, Close, Volume) | /cryptocurrency/ohlcv/historical |
exchange_map | List of all active cryptocurrency exchanges | /exchange/map |
exchange_info | Static metadata for one or more exchanges | /exchange/info |
exchange_latest_listings | List of all cryptocurrency exchanges | /exchange/listings/latest |
exchange_historical_listings | Historic market quotes for any exchange | /exchange/listings/historical |
exchange_latest_quotes | Latest aggregate market data for 1 or more exchanges | /exchange/quotes/latest |
exchange_historical_quotes | Historic quotes for any exchange | /exchange/quotes/historical |
exchange_market_pairs | Market pairs for a given exchange | /exchange/market-pairs/latest |
global_metrics_latest | Latest global cryptocurrency market metrics | /global-metrics/quotes/latest |
global_metrics_historical | Historical global cryptocurrency market metrics | global-metrics/quotes/historical |
price_conversion_tool | Convert an amount of one cryptocurrency or fiat currency | tools/price-conversion |
blockchain_latest | Latest blockchain statistics | blockchain/statistics/latest |
fiat_map | Mapping of all supported fiat currencies | fiat/map |
key_info | API key details | key/info |
data
(dict): will give you the result.status
(dict): the status object always included for both successful calls and failures.timesamp
(str): current time on the server when the call was executed.error_code
(str | None): In case of an error has been raised, this property will give you the status error code.error_message
(str | None): In case of an error has been raised, this property will give details about error.