https://github.com/imanmousaei/coinexpy
Python wrapper for Coinex APIs
https://github.com/imanmousaei/coinexpy
api api-wrapper bitcoin coinex crypto cryptocurrency python trading
Last synced: 3 months ago
JSON representation
Python wrapper for Coinex APIs
- Host: GitHub
- URL: https://github.com/imanmousaei/coinexpy
- Owner: imanmousaei
- License: mit
- Created: 2021-09-02T13:49:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-13T07:05:52.000Z (over 4 years ago)
- Last Synced: 2026-01-02T16:27:09.424Z (6 months ago)
- Topics: api, api-wrapper, bitcoin, coinex, crypto, cryptocurrency, python, trading
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 16
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coinexpy - Python wrapper for Coinex APIs
Through coinexpy you can simply buy or sell crypto in your [Coinex](https://www.coinex.com) account
# Features
* place limit order
* place market order
* get balance
* get price
# Install
```bash
pip install coinexpy
```
# Example
You can create API key and get your access_id & secret_key [here](https://www.coinex.com/apikey)
```python
from coinexpy.coinex import Coinex
coinex = Coinex('', '')
balance = coinex.get_balance()
usdt_balance = coinex.get_available('USDT')
btc_price = coinex.get_last_price('BTCUSDT')
coinex.market_buy('BTCUSDT', 100) # buy 100$ worth of bitcoin with market price
coinex.market_sell('BTCUSDT', 100) # sell 100$ worth of BTC
coinex.limit_buy('BTCUSDT', 100, 50000) # place a limit buy order on bitcoin with amount=100$
result = coinex.limit_sell('BTCUSDT', 100, 50000)
coinex.cancel_order(result['id'], result['market'])
```
## Amount
Field `amount` should be calculated with the 2nd currency in pair e.g. in BTCUSDT you should calculate amount in USDT
# Donate
For additional support you can always donate.
My TRX address:
```
TKjj4ds7pyRKrLDPa71aCQ9y73kFQPKjX2
```
BCH:
```
qrxfzgu5prerumfmzm20jajkp6nvje092yx8n5g0k6
```
USDT TRC20:
```
TKjj4ds7pyRKrLDPa71aCQ9y73kFQPKjX2
```
# Contact
If you need another function or found a bug in existing ones submit a new issue [Here](https://github.com/imanmousaei/coinexpy/issues/new).