Mercado Bitcoin API client
npm install mercadobitcoin-client-v3
There are 2 API endpoints. One for general info (public) and a trade API (require credentials)
var MercadoBitcoin = MercadoBitcoin;// The options for currency are: BTC, LTC, BCH, XRP and ETHvar mb = ;// Call ticker method to get last price of XRPmb;// Fetch the order book for BTC transactions (default)mb;
Get your credentials at Mercado Bitcoin website
You will need the following info: Chave, Código (here). The PIN that was used in the previous versions is not needed anymore.
var MercadoBitcoinTrade = MercadoBitcoinTrade;// Credentialsvar config = key : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'secret : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';var mbt = config;// This object contains extra parameters that you might use for some methods:var details =// level: 'INFO' ,coin_pair: 'BRLXRP'// status_list: '[2,3]',// Here you find some of the common methods that you can use as an example. For the complete list, please refer to the Trade API documentation:mbt;//mbt.execute('list_system_messages', details, console.log);//mbt.execute('list_orders', details, console.log);//mbt.execute('list_orderbook', details, console.log);
Donations are welcome!