Package Exports
- coin-ticker
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coin-ticker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
coin-ticker
Easily get the latest exchange data of Bitcoin, Etherium, Litecoin, and other assets from a variety of exchanges including Bitfinex, Bitstamp, Kraken, and others.
Install
$ npm install --save coin-ticker
Usage
Require:
const coinTicker = require('coin-ticker');
Syntax:
coinTicker(exchange, currency-pair)
Parameters:
exchange: A string declaring one of the available exchanges:
* 'bitfinex'
* 'bitstamp'
* 'btce'
* 'kraken'
* 'okcoin'
* 'exmo'
currency-pair: An optional string declaring the currencies or assets to retrieve. Default is 'btcusd'.
Available asset pairs by exchange:
Bitfinex:
* 'btcusd'
* 'ltcusd'
* 'ltcbtc'
* 'ethusd'
* 'ethbtc'
* 'etcbtc'
* 'etcusd'
* 'rrtusd'
* 'rrtbtc'
* 'zecusd'
* 'zecbtc'
Bitstamp:
* 'btcusd'
* 'btceur'
* 'eurusd'
* 'xrpusd'
* 'xrpeur'
BTC-e:
* 'btcusd'
* 'btcrur'
* 'btceur'
* 'ltcbtc'
* 'ltcusd'
* 'ltcrur'
* 'ltceur'
* 'nmcbtc'
* 'nmcusd'
* 'nvcbtc'
* 'nvcusd'
* 'usdrur'
* 'eurusd'
* 'eurrur'
* 'ppcbtc'
* 'ppcusd'
* 'dshbtc'
* 'dshusd'
* 'ethbtc'
* 'ethusd'
* 'etheur'
* 'ethltc'
* 'ethrur'
Kraken:
* 'etcbtc'
* 'etceur'
* 'etcusd'
* 'ethbtc'
* 'ethcad'
* 'etheur'
* 'ethgbp'
* 'ethjpy'
* 'ethusd'
* 'ltcbtc'
* 'ltceur'
* 'ltcusd'
* 'btccad'
* 'btceur'
* 'btcgbp'
* 'btcjpy'
* 'btcusd'
Okcoin:
* 'btcusd'
* 'ltcusd'
Exmo:
* 'btcusd'
* 'btceur'
* 'btcrub'
* 'btcuah'
* 'dashbtc'
* 'dashusd'
* 'ethbtc'
* 'ethusd'
* 'ethrub'
* 'dogebtc'
* 'ltcbtc'
* 'ltcrub'
Response Data:
An object containing the following values:
{
last: // the last traded price
ask: // current ask
bid: // current bid
low: // 24 hour low
high: // 24 hour high
vol: // 24 hour volume
timestamp: // precise time (not available on Kraken)
exchange: // the current exchange, i.e. 'bitfinex'
pair: // the asset pair, i.e. 'btcusd'
}
Excamples:
Get the current ticker data of ETH/USD from BTC-e:
coinTicker('btce', 'ethusd');
Get the current ticker data of BTC/USD from Bitfinex:
coinTicker('bitfinex'); // when no asset pair is specified, coinTicker will default to 'btcusd'
Example response data:
{
last: '1034.8',
ask: '1034.8',
bid: '1034.7',
low: '1001.6',
high: '1040.0',
vol: '15112.8733725',
timestamp: '1486238356.227418953',
exchange: 'bitfinex',
pair: 'btcusd'
}