Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 2.48 KB

README.md

File metadata and controls

77 lines (56 loc) · 2.48 KB

mercadobitcoin

Join the chat at https://gitter.im/python-mercadobitcoin/Lobby Build Status Code Climate Test Coverage PyPI

A Python wrapper for Mercado Bitcoin API.

Installation

Directly from PyPI:

pip install mercadobitcoin

You can also install directly from the GitHub repository to have the newest features by running:

git clone https://github.com/alfakini/python-mercadobitcoin.git
cd python-mercadobitcoin
python setup.py install

Basic Usage

Below you can see the available Mercado Bitcoin API methods you can use:

import mercadobitcoin
mbtc = mercadobitcoin.Api()
mbtc.ticker('BTC')
mbtc.orderbook('BTC')
mbtc.trades('BTC')

*note that this has been updated per v3: functions with litecoin in the name have been removed.

And the private Trade API:

from mercadobitcoin import TradeApi

mbtc = TradeApi(<API_ID>, <API_SECRET>)

mbtc.list_system_messages()
mbtc.get_account_info()
mbtc.get_order(coin_pair="BRLBTC", order_id=1)
mbtc.list_orders(coin_pair="BRLBTC")
mbtc.list_orderbook(coin_pair="BRLBTC")
mbtc.place_buy_order(coin_pair="BRLBTC", quantity="42.00", limit_price="5000")
mbtc.place_sell_order(coin_pair="BRLBTC", quantity="42.00", limit_price="5000")
mbtc.cancel_order(coin_pair="BRLBTC", order_id=1)
mbtc.get_withdrawal(coin="BRL", withdrawal_id=1)
mbtc.withdraw_coin(coin_pair="BRL", quantity="42", destiny="1", description="Trasfering Money.")

Development

Install development dependencies:

brew install libyaml
pip install -r requirements-development.txt

Run tests:

tox

References