Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Library to integrate with the BitcoinAverage API

Project description

BitcoinAverage PIP Library

The following examples demonstrate how Http and Websocket requests are made. Just enter your public key and you can run the examples.

Get your api key by logging in here:

Official documentation:

More examples on Github:

Http example

from bitcoinaverage import RestfulClient

if __name__ == '__main__':
    public_key = 'your_public_key'

    restful_client = RestfulClient(public_key)

    ticker_global_per_symbol = restful_client.ticker_global_per_symbol('BTCUSD')
    print('Global Ticker for BTCUSD:')

Websocket V1 example

from bitcoinaverage import TickerWebsocketClient

if __name__ == '__main__':
    public_key = 'your_public_key'

    print('Connecting to the ticker websocket...')
    ws = TickerWebsocketClient(public_key)
    ws.ticker_data('local', 'BTCUSD')

Websocket V2 examples

Version 2 the websocket clients accept a list of cryptocurrencies and a list of exchange respectively. They also use new optimized algorithm for quicker updates.


from bitcoinaverage import TickerWebsocketClientV2

if __name__ == '__main__':
    public_key = 'your_public_key'

    print('Connecting to the ticker websocket...')
    ws = TickerWebsocketClientV2(public_key)
    ws.ticker_data('local', ['BTCUSD', 'ETHUSD'])


from bitcoinaverage import ExchangeWebsocketClientV2

if __name__ == '__main__':
    public_key = 'your_public_key'

    print('Connecting to the exchange websocket...')
    ws = ExchangeWebsocketClientV2(public_key)
    ws.exchange_data(['bitstamp', 'coinbasepro'])

Copyright Blockchain Data LTD

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 bitcoinaverage, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size bitcoinaverage-0.3.1.tar.gz (15.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page