Bitcoin and Ethereum price API integration examples in csharp, java, nodejs, golang, python, php and ruby
Python JavaScript C# Java Go PHP Ruby
Switch branches/tags
Nothing to show
Clone or download

BitcoinAverage API integration examples

Examples of how to integrate with our API in various langauges

BitcoinAverage Packages

We have published our own npm and pip packages that do the heavy lifting for you (authentication, handling requests, remembering the full urls).

NodeJS NPM Package

Our npm package exposes both websocket and restful clients for connecting to our live API channels and making HTTP requests.

npm install bitcoinaverage


const ba = require('bitcoinaverage');

var publicKey = "<your pub key>";
var secretKey = "<your secret key>"; 
var restClient = ba.restfulClient(publicKey, secretKey);
var websocketClient = ba.websocketClient(publicKey, secretKey);

Ticker data

restClient.tickerGlobalPerSymbol("BTCUSD", function(response){

Full response format in our docs

Exchange data

restClient.allExchangeDataForSymbol('BTCUSD', function(response) {

restClient.perExchangeData('gdax', function(response) {

Python PIP Package

pip install bitcoinaverage


from bitcoinaverage import RestfulClient
restful_client = RestfulClient("<secret key>", "<public key>")

Ticker data

ticker_global = restful_client.ticker_all_global(crypto="ETH", fiat="USD,EUR")

Exchange data

all_bitstamp_data = restful_client.per_exchange_data('bitstamp')
all_coinbase_data = restful_client.per_exchange_data('gdax')

all_exchange_data_gbp_brl = restful_client.all_exchange_data(crypto='BTC', fiat='GBP,BRL')