coin-ticker
Easily get the latest exchange data of Bitcoin, Etherium, Litecoin, and other assets from a variety of exchanges including Bitfinex, Coinbase, Bitstamp, Kraken, Poloniex and others.
Install
$ npm install coin-ticker
Usage
Require:
const coinTicker = require('coin-ticker');
Syntax:
coinTicker([exchange, assetPair])
Get available exchanges:
The coinTicker function with no arguments will return an array of all available exchanges
coinTicker()
Get available asset pairs by exchange:
Declare the exchange and use string 'pairs' to request available asset pairs. coinTicker will return a promise.
coinTicker('poloniex', 'pairs')
.then((pairs) => {
console.log(pairs);
})
Get Ticker Data:
Simply declare the exchange and asset pair to get the latest market info. coinTicker will return a promise.
coinTicker('bitfinex', 'BTC_USD')
Response Data:
An object containing the following values:
{
last:
ask:
bid:
low:
high:
vol:
timestamp:
exchange:
pair:
rawData:
}
Example:
coinTicker('bitfinex', 'BTC_USD')
.then((tick) => {
console.log(tick)
})
If you find this package useful, please contribute by donating or opening a pull request.
BTC:
1Gr9UcXdM5Kmnseht2u29o1SsqMnBkTsYP
ETH:
0xc519a1904c5a9D99C13374d22388091B807c54cF