Skip to main content

BitcoinAverage PIP Library

Here we provide you 2 examples - the first example shows how to call function which makes a HTTP request to our Restful API and the other example connects to one of our websockets. You just need to enter your public_key and secret_key and you are ready to run this example.

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

Http example

#!python

from bitcoinaverage import RestfulClient

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

    restful_client = RestfulClient(secret_key, 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

#!python

from bitcoinaverage import TickerWebsocketClient

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

    print('Connecting to the ticker websocket...')
    ws = TickerWebsocketClient(public_key, secret_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

#!python

from bitcoinaverage import TickerWebsocketClientV2

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

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

Exchanges

#!python

from bitcoinaverage import ExchangeWebsocketClientV2

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

    print('Connecting to the exchange websocket...')
    ws = ExchangeWebsocketClientV2(public_key, secret_key)
    ws.ticker_data(['bitstamp', 'gdax'])

Copyright Blockchain Data LTD

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.2.1.tar.gz (15.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: bitcoinaverage-0.2.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.0

File hashes

Hashes for bitcoinaverage-0.2.1.tar.gz
Algorithm Hash digest
SHA256 425662cb2c1a5bce66af7352dd80c397e2fbd5f15af3ce88e77af039d89a290c
MD5 5117a19c791579890fd5cef67db50a11
BLAKE2b-256 fef97756fee72b7640d6930dc49a8ee9449da241fb79924572410b290d87623d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

1 file

0.3.0

1 file

This release

0.2.1 This release

1 file

0.2

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page