All Projects → bitcoinaverage → api-integration-examples

bitcoinaverage / api-integration-examples

Licence: other
Bitcoin and Ethereum price API integration examples in csharp, java, nodejs, golang, python, php and ruby

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
C#
18002 projects
java
68154 projects - #9 most used programming language
go
31211 projects - #10 most used programming language
PHP
23972 projects - #3 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to api-integration-examples

Restbed
Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.
Stars: ✭ 1,551 (+2574.14%)
Mutual labels:  websocket-api
NasdaqCloudDataService-SDK-Java
Nasdaq Data Link provides a modern and efficient method of delivery for real-time exchange data and other financial information. This repository provides a Java SDK for developing applications using Nasdaq Data Link's real-time data.
Stars: ✭ 70 (+20.69%)
Mutual labels:  exchange-data
channeled-dashboard
Repository for the talk `Building real time applications with Django and Channels`
Stars: ✭ 20 (-65.52%)
Mutual labels:  websocket-api
mmb
Trading bot implemented in Rust, with market making and strategy automation for any exchange or blockchain.
Stars: ✭ 359 (+518.97%)
Mutual labels:  orderbook
open-api
BiKi Open API
Stars: ✭ 17 (-70.69%)
Mutual labels:  websocket-api
binance-websocket-examples
Example code in Nodejs that demonstrate how to subscribe to Binance Websocket server.
Stars: ✭ 124 (+113.79%)
Mutual labels:  orderbook
crypto-websocket-extensions
🧰 Unified and optimized data structures across cryptocurrency exchanges
Stars: ✭ 31 (-46.55%)
Mutual labels:  orderbook
tellerbot
Telegram Bot for over-the-counter trading
Stars: ✭ 17 (-70.69%)
Mutual labels:  orderbook
orderbook-rs
Basic order matching engine written in Rust
Stars: ✭ 276 (+375.86%)
Mutual labels:  orderbook
VoiceDictation
迅飞 语音听写 WebAPI - 把语音(≤60秒)转换成对应的文字信息,让机器能够“听懂”人类语言,相当于给机器安装上“耳朵”,使其具备“能听”的功能。
Stars: ✭ 36 (-37.93%)
Mutual labels:  websocket-api
WebsocketPromisify
Makes websocket's API just like REST with Promise-like API, with native Promises.
Stars: ✭ 18 (-68.97%)
Mutual labels:  websocket-api
rb3
A bunch of downloaders and parsers for data delivered from B3
Stars: ✭ 52 (-10.34%)
Mutual labels:  exchange-data
orderbook modeling
Example of order book modeling.
Stars: ✭ 38 (-34.48%)
Mutual labels:  orderbook
tardis-python
Python client for tardis.dev - historical tick-level cryptocurrency market data replay API.
Stars: ✭ 88 (+51.72%)
Mutual labels:  orderbook
TraderBot
No description or website provided.
Stars: ✭ 39 (-32.76%)
Mutual labels:  exchange-data
bitmex-orderbook
The fastest order book implementation for the BitMEX WebSocket API.
Stars: ✭ 73 (+25.86%)
Mutual labels:  orderbook
algotrading-example
algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex, binance futures, market making)
Stars: ✭ 169 (+191.38%)
Mutual labels:  orderbook
Socketify
Raw TCP and UDP Sockets API on Desktop Browsers
Stars: ✭ 67 (+15.52%)
Mutual labels:  websocket-api
fluidex-backend
Building the first permissionless layer2 orderbook DEX on Ethereum, powered by PLONK zk-rollup
Stars: ✭ 24 (-58.62%)
Mutual labels:  orderbook
bitfinex-v2-wss-api-java
This project provides a Java client library for the Bitfinex WebSocket API (v2). Public and private channels (candles, ticks, executed trades, (raw) orderbooks, orders, and wallets) are implemented.
Stars: ✭ 90 (+55.17%)
Mutual labels:  websocket-api

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).

NPM Package

This library enables quick and easy access to our Bitcoin, Ethereum, Litecoin, Ripple and other cryptocurrency exchange rates.

Install

npm install bitcoinaverage

Setup

Get your public and private keys from our website and you are ready to run these examples.

const ba = require('bitcoinaverage');

var publicKey = 'yourPublicKey';
var secretKey = 'yourSecretKey';

var restClient = ba.restfulClient(publicKey, secretKey);
var wsClient = ba.websocketClient(publicKey, secretKey);

Ticker Data

The response received by https://apiv2.bitcoinaverage.com/indices/global/ticker/BTCUSD.

The symbol_set can be one of: local, global, crypto and tokens.

The symbol can be any pair from our Full symbol list

var symbol_set = 'global';
var symbol = 'BTCUSD';

restClient.getTickerDataPerSymbol('global', 'BTCUSD', function(response) {
    console.log(response);
}, function(error){
    console.log(error);
}) ;

Exchange Data

All price data from single exchange

restClient.perExchangeData('bitstamp',
    function(response){
        console.log(response);
    },
    function(err){
        console.log(err);
    });

Data from all exchanges for one symbol

restClient.allExchangeDataForSymbol('BTCGBP',
    function(response){
        console.log(response);
    },
    function(err){
        console.log(err);
    });

Websocket

Connect to one of our websocket endpoints and get real-time updates for the Bitcoin Global Price Index.

Ticker websocket

wsClient.connectToTickerWebsocket('global', 'BTCUSD', function(response) {
    console.log(response);
}, function(error){
    console.log(error)
}, function(){
    console.log("websocket closed");
});

Orderbook websocket

The orderbook channel starts by sending a "snapshot" message with the current state of the orderbook. Then it is followed by "update" messages that represent the changes in the orderbook.

If the amount for an order is 0, the order has been completed, so it needs to be removed from the orderbook.

If the amount is greater than 0 then we just update value.

var symbols = ['BTCUSD', 'ETHUSD'];
var exchange = 'bitfinex';
var ORDERBOOKS = {
    BTCUSD: {},
    ETHUSD: {}
};
var symbol = '';
wsClient.connectToOrderbookWebsocket(exchange, symbols, function(response){
    symbol = respnose.data.symbol;
    if(response.data.type === "snapshot"){
        ORDERBOOKS[symbol].asks = response.data.asks;
        ORDERBOOKS[symbol].bids = response.data.bids;
     }else{
       console.log(response.data.updates);
       for (var i = 0; i < response.data.updates.length; i++){
          var item = response.data.updates[i];
         if(item.amount === 0){
            delete(ORDERBOOKS[symbol][item.side][item.price]);
         }else{
           ORDERBOOKS[symbol][item.side][item.price] = item;
         }
       }
     }
}, function(err){
console.log(err);
});

Python PIP Package

pip install bitcoinaverage

Setup

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")
print(ticker_global)

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')
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].