Show HN: Python Client for Blockchain Exchange API

Show HN: Python Client for Blockchain Exchange API


Desk of Contents

Generated with DocToc

Closing Change: 2020-05-17


All API is on the market via a websocket consumer:

import logging
from bcx.consumer import BlockchainWebsocketClient


consumer = BlockchainWebsocketClient()

Search our documentation for API reference and gallery of examples for further information.

Set up

In expose to seek out began you must seemingly seemingly accrued have Python>=3.6 construct in.

For celebrated make the most of

Here is as straightforward as working

For progress

  • Obtain supply code

    git clone [email protected]:ilya-bc/blockchain-change-api.git
    cd blockchain-change-api
  • Arrange bundle in editable mode. Since there are hundred methods to achieve that, a standardised advance for this enterprise is with Makefile. This could process digital environment with pipenv principally primarily based utterly on python==3.7 and set up all compulsory dependencies for progress

  • Whilst you happen to haven’t received pipenv or train to assist watch over a digital environment the utilization of various devices, you then definately’ll be in a trouble to make the most of

  • In expose to originate documentation

    (cd docs && create html)
    start docs/originate/html/index.html

    ❗Basic: Constructing documentation will attain example scripts, so be terribly cautious when writing sample scripts that create make the most of of buying and selling channel.

Necessities for purchasing and promoting

Proper shopping for and promoting and getting access to steadiness of your story requires authentication with an API key. In expose to seek out one:

  1. You must seemingly seemingly accrued have an story at | change

  2. Produce API key here and retailer information. Inform, you may be succesful to be in a trouble to have setup key with permissions be taught about and be taught about & substitute.

  3. You must seemingly seemingly accrued obtain an email correspondence asking you to set off API key.

  4. Setup the next environment variable


πŸ”₯Tip: Whilst you happen to make the most of pipenv you then definately’ll be in a trouble to regular construct it into .env file (uncared for by git) on the root of the cloned itemizing


Take heed to all public channels

asciicast listen to public channels

✏️Inform: There are time.sleep(2) between calling totally different techniques, in expose to be succesful to gape intermediate outcomes.

Produce market and restrict orders

asciicast create market and limit orders

✏️Inform: Every and every orders obtained rejected (anticipated behaviour) on story of of invalid amount and value being to colossal.


  • Exams
  • One thing irregular is happening with unsubscribing from channels in bulk for the next ones:
{"channel": "l2", "symbol": "BTC-USD"},
{"channel": "ticker", "symbol": "BTC-USD"},
{"channel": "trades", "symbol": "BTC-USD"}


Please enter your comment!
Please enter your name here