Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/btrevizan/mb_api
A Python 3 API for Mercado Bitcoin's API.
https://github.com/btrevizan/mb_api
api bitcoin bitcoin-api mercadobitcoin python3
Last synced: about 2 months ago
JSON representation
A Python 3 API for Mercado Bitcoin's API.
- Host: GitHub
- URL: https://github.com/btrevizan/mb_api
- Owner: btrevizan
- License: mit
- Created: 2017-10-09T01:18:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-01T21:56:55.000Z (over 3 years ago)
- Last Synced: 2024-10-23T02:19:11.574Z (2 months ago)
- Topics: api, bitcoin, bitcoin-api, mercadobitcoin, python3
- Language: Python
- Homepage:
- Size: 55.7 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Mercado Bitcoin's API Interface
A Python 3 API interface for Mercado Bitcoin's API.`mbapi` implements all methods from Mercado Bitcoin's Data API (a.k.a. API) and Trade API (a.k.a. TAPI).
To know more about method parameters you can see the methods and classes documentation `.__doc__` or
access the [API documentation](https://www.mercadobitcoin.com.br/api-doc/) and [TAPI documentation](https://www.mercadobitcoin.com.br/trade-api/).## Instalation
```bash
sudo pip3 install mbapi
```## Usage
### API
```python
from mbapi.api import Request
from mbapi.labels import Coin# Requests for BTC
request = Request()ticker = request.ticker()
orderbook = request.orderbook()# Requests for LTC
request = Request(Coin.LTC)ticker = request.ticker()
orderbook = request.orderbook()
```### TAPI
```python
from mbapi.tapi import Auth, Tradeauth = Auth(id=,
pin=,
secret=)# Trade method for BTC
trade = Trade(auth)response = trade.place_buy_order(1, 23905) # place a buy order
trade.cancel_order(response.data['order']['order_id']) # cancel the buy order
```## Troubleshoot
While developing, I got a UnicodeEncodeError. You could get too. To fix it, add the following lines to your `~/.bash_profile`.
```bash
export LANGUAGE=cs_CZ.UTF-8
export LC_ALL=cs_CZ.UTF-8
```## Note
This is a project in development. So, I apologize for the poor documentation.
In case of doubts, feel free to e-mail me: [email protected]