An easy api let developer get exchanges current bitcoin price.
npm install bitcoinexNow supporting several exchanges real time high, low, last prices as below, and expected to support other market informations in 0.3.x. Welcome to open issues or leave a comment.
- Coinbase
- Bitstamp
- Bitfinex
- OKCoin
- itBit
```
npm install bitcoinex`$3
js
var bitcoinex = require('bitcoinex');
// exchangeName now only support 'coinbase', 'bitstamp', 'bitfinex', 'okcoin', 'itbit'
// currency now only support 'usd', 'eur', 'cny', 'twd'
// bitcoinex.getPriceWith(exchangeName, currency, callback)
bitcoinex.getPriceWith('bitstamp', 'usd', function(err, priceObject) {
if (err) {
console.error(err);
}
else {
console.log(priceObject.last);
}
/* priceObject
{
exchangeName: 'bitstamp',
currency: 'usd',
high: 427.99,
low: 415.82,
last: 423
}
*/
});
`
Or, you can just try example.js and see what would happen.
```
node example.js
#### v0.3.x is coming soon...