Skip to main content

CoinMarketCap Python API Wrapper

Project description

Python-CoinMarketCap API Wrapper

This is a non official (but working) Python package to wrap the CoinMarketCap API.

With this you can monitoring and watch the crypto market.

Installation

Via pip

  • pip install python-coinmarketcap

/!\ Don't confound with the coinmarketcap package.

Manual Installation

Clone this repo and :

Example

  import coinmarketcapapi

  cmc = CoinMarketCapAPI('{YOUR_API_KEY}')
  r = cmc.cryptocurrency_info(symbol='BTC')

  print repr(r.data)

Requirements and links

First, you have to create an API on the Developper Portal : https://coinmarketcap.com/api/

You can found the full official documentation here : https://coinmarketcap.com/api/documentation/v1/

API Guide

List of all methods

You have to pass to theses functions the parameters detailled in the official documentation.

Endoints :

  • cryptocurrency_info: Get cryptocurrency metadata
  • cryptocurrency_map: Get cryptocurrency CoinMarketCap ID map
  • cryptocurrency_listings_latest: List all cryptocurrencies (latest)
  • cryptocurrency_market_pairs_latest: Get cryptocurrency market pairs (latest)
  • cryptocurrency_ohlcv_historical: Get cryptocurrency OHLCV values (historical)
  • cryptocurrency_quotes_latest: Get cryptocurrency market quotes (latest)
  • cryptocurrency_quotes_historical: Get cryptocurrency market quotes (historical)
  • exchange_info: Get exchange metadata
  • exchange_map: Get exchange to CoinMarketCap ID map
  • exchange_listings_latest: List all exchanges (latest)
  • exchange_market_pairs_latest: Get exchange market pairs (latest)
  • exchange_quotes_latest: Get exchange market quotes (latest)
  • exchange_quotes_historical: Get exchange market quotes (historical)
  • global_metrics_quotes_latest: Get aggregate market metrics (latest)
  • global_metrics_quotes_historical: Get aggregate market metrics (historical)
  • tools_price_conversion: Price conversion tool

Response

Just get the results of the API in rep.data or check the status with rep.status.

Sanbox / Pro Environement

You can switch easly you have to set sandbox the default value is True.

  cmc = CoinMarketCapAPI('{YOUR_API_KEY}', sandbox=False)
  # You are in production environnement

Debuging

You can enable a debuging mode, just set debug to True to main class:

  cmc = CoinMarketCapAPI('{YOUR_API_KEY}', debug=True)

Will produce a new output :

 2019-04-06 16:03:04,716 root         DEBUG    GET SANDBOX 'v1/cryptocurrency/info'
PARAMETERS: {'symbol': 'BTC'}
2019-04-06 16:03:05,004 root         DEBUG    RESPONSE: 288ms OK: {u'BTC': {u'category': u'coin', u'name': u'Bitcoin', u'tags': [u'mineable'], u'symbol': u'BTC', u'id': 1, [...]}

You can also passing directly a logger instance :

  cmc = CoinMarketCapAPI('{YOUR_API_KEY}', debug=True, logger=my_logger)

ToDo

  • Add Cryptocurrency Abstraction
  • Add Exchange Abstraction
  • Add GlobalMetrics Abstraction
  • Add Tools Abstraction

ChangeLog

  • 6 apr 2019: Version 0.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

python_coinmarketcap-0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

python_coinmarketcap-0.1-py2-none-any.whl (5.0 kB view details)

Uploaded Python 2

File details

Details for the file python_coinmarketcap-0.1-py3-none-any.whl.

File metadata

  • Download URL: python_coinmarketcap-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.13

File hashes

Hashes for python_coinmarketcap-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74214200f4b8641bdc5617d6b474d3720189bfdf6c2be84dbb4e801b1651f8f6
MD5 6a139f92508b1bcc0a3c30df48623c36
BLAKE2b-256 e158fec20a6407d41773249ed926710180ee61fc0cb9963d95620110d65dec13

See more details on using hashes here.

File details

Details for the file python_coinmarketcap-0.1-py2-none-any.whl.

File metadata

  • Download URL: python_coinmarketcap-0.1-py2-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.13

File hashes

Hashes for python_coinmarketcap-0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 a9b41dbfa202dbdc40b21d98de447a975edfffb20b3b356b8dcd0fe4c26a9be4
MD5 16e568d6b04616a7a2a782527164b14b
BLAKE2b-256 afb4e2c121f9c04e04da95d878ab78e3f821615dd78cb6a33f24852631240b3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page