Skip to main content

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: https://pro.bitcoinaverage.com/

Official documentation: https://apiv2.bitcoinaverage.com

More examples on Github: https://github.com/bitcoinaverage/api-integration-examples/

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:')
    print(ticker_global_per_symbol)

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.

Ticker

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'])

Exchanges

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.

Source Distribution

bitcoinaverage-0.3.1.tar.gz (15.7 kB view details)

Uploaded Source

File details

Details for the file bitcoinaverage-0.3.1.tar.gz.

File metadata

  • Download URL: bitcoinaverage-0.3.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

File hashes

Hashes for bitcoinaverage-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8dbedced5d84e9977981bf1dca305fa6d125682a31f784246aec8c262574e93f
MD5 070754cb6461a0a93cea30565d332a49
BLAKE2b-256 75d437f7e1931770389e78dd47c2d572c6b88772683c79f3ca0e18cce59dc25b

See more details on using hashes here.

Supported by

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