Skip to main content

Wrapper around Cryptocurrency related APIs

Project description


Python 3.7+


Async support (without cache)

Handles configurable requests cache, retries and general request errors.


pip install xnr-cryptowrapper


Build around raw API commands, in order to allow users to more freely implement their own logic.
Each APIs endpoints are made directly available by the CryptoWrapper class.
More detailed informations contained in the docs below:

Description Wrapper for the CoinMarketCap API Wrapper for the CryptoCompare API Wrapper for the BitMEX REST API Wrapper for the Binance APIs Wrapper for the Binance DEX API Wrapper for the Bitfinex API Wrapper for the Deribit API


If unspecified, result will not be cached.
Retries avoided for errors (400, 401, 403, 404, 429, 500).
Rate limits informations generally present in responses to simplify the implementation of back off strategies.


>>> from cryptowrapper import CryptoWrapper
>>> api_key = "Declare you API key"
>>> cmc = CryptoWrapper(api="CMC", api_key=api_key, cache_expire=240)
>>> cmc_wrapper = cmc.wrapper
>>> cmc_wrapper.global_aggregate_metrics_latest_GET(convert="GBP")
  'status': {
      'timestamp': '2019-02-02T10:36:40.928Z',
      'error_code': 0,
      'error_message': None,
      'elapsed': 6,
      'credit_count': 1
  'data': {
      'active_cryptocurrencies': 2104,
      'active_market_pairs': 15817,
      'active_exchanges': 235,
      'eth_dominance': 9.87368,
      'btc_dominance': 53.2881,
      'quote': {
          'GBP': {
              'total_market_cap': 87645952771.31316,
              'total_volume_24h': 12135287028.006516,
              'last_updated': '2019-02-02T10:36:00.000Z'
      'last_updated': '2019-02-02T10:27:00.000Z'
  'cached': False


>>> from cryptowrapper import CryptoWrapper
>>> api_key = "Declare you API key"
>>> api_secret = "Declare you API secret"
>>> bitmex = CryptoWrapper(api="BitMEX", api_key=api_key, api_secret=api_secret)
>>> bitmex_wrapper = bitmex.wrapper
>>> bitmex_wrapper.chat_GET(count=2)
        'id': 1,
        'date': '2014-11-24T12:00:21.539Z',
        'user': 'BitMEX_Sam',
        'message': 'Welcome to BitMEX! We are live.',
        'html': 'Welcome to BitMEX! We are live.',
        'fromBot': False,
        'channelID': 1,
        'cached': False
        'id': 2,
        'date': '2014-11-24T12:20:29.073Z',
        'user': 'BitMEX_Arthur',
        'message': 'Hello World',
        'html': 'Hello World',
        'fromBot': False,
        'channelID': 1,
        'cached': False
        'ratelimit': {
            'limit': '150',
            'remaining': '149',
            'reset': '1549626408'


>>> from cryptowrapper import CryptoWrapper
>>> binance = CryptoWrapper(api="Binance")
>>> binance_wrapper = binance.wrapper
>>> binance_wrapper.ping_GET()
    'cached': False


>>> from cryptowrapper import CryptoWrapper
>>> binance_dex = CryptoWrapper(api="BinanceDEX")
>>> binance_dex_wrapper = binance_dex.wrapper
>>> binance_dex_wrapper.__getfunctions__()

For a quick combined example see:
For the async version see:


Constructive feedback & bug reports are welcome.
Contact informations:

Project details

Download files

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

Files for xnr-cryptowrapper, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size xnr_cryptowrapper-0.1.1-py3-none-any.whl (12.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page