#Mercado Bitcoin API client Mercado Bitcoin is a cryptocurrency exchange in Brazil.
npm install mercadobitcoin
There are 2 API endpoints. One for general info (public) and a trade API (require credentials)
API - documentation
var MercadoBitcoin = require('mercadobitcoin').MercadoBitcoin;
// The options for currency are: 'BTC' or 'LTC'
var mb = new MercadoBitcoin({ currency: 'BTC' });
// Call ticker method to get last price
mb.ticker(function (res) { console.log(res.ticker.last) });
// Call orderBook method
mb.orderBook(console.log);
TRADE API - documentation
Get your credentials at Mercado Bitcoin website
You will need the following info: Chave, Código (here) and PIN (here)
var MercadoBitcoinTrade = require('mercadobitcoin').MercadoBitcoinTrade;
// Credentials
var chave = '<CHAVE>',
codigo = '<CODIGO>',
pin = '<PIN>';
var mbt = new MercadoBitcoinTrade({ key: chave, secret: codigo, pin: pin });
// Call getInfo method and print amount of BTC funds in your account
mbt.getInfo(function(res) { console.log(res.funds.btc) }, console.log);
// Call orderList method
mbt.orderList({ pair: 'btc_brl' }, console.log, console.log);
1MarcE3uXebneDH81k26QPm5imMEo2PCSP