A Python3 wrapper for the CoinEx API
This is an unofficial wrapper with no affiliation with CoinEx, use at your own risk.
Note: no limit on Market calls; generally 200 requests per 10 seconds for other operations. Specific rates can be found in thier respective documentation pages
pip3 install coinex
Methods in the coinex package return a CoinExResponse
object containing three attributes (success, message, and result) aligning with the coinex API response (code, message, and data). For more information on the success/code, see here
import coinex
coinex = coinex.CoinEx() #initalize the object
request = coinex.getMarketList() # use one of the object's methods to make an API call
request.success # returns 0
request.message # returns OK
request.result # returns a list of markets
The methods in this section do not require additional signature/authentication. An exception will be raised if trying to use the other methods without supplying a AccessID and Secret.
coinex = coinex.CoinEx() # no AccessID and Secret needed for common and market methods
getCurrencyRates()
- https://github.com/coinexcom/coinex_exchange_api/wiki/070currency_rategetAssetConfig(coin_type='')
- https://github.com/coinexcom/coinex_exchange_api/wiki/071asset_config
getMarketList()
- https://github.com/coinexcom/coinex_exchange_api/wiki/020marketgetMarketStatistics(market)
- https://github.com/coinexcom/coinex_exchange_api/wiki/021tickergetMarketDepth(market, merge, limit=20)
- https://github.com/coinexcom/coinex_exchange_api/wiki/022depthgetMarketTransactions(market, last_id=0, limit=100)
- https://github.com/coinexcom/coinex_exchange_api/wiki/023dealsgetMarketKLineData(market, ttype, limit=100)
- https://github.com/coinexcom/coinex_exchange_api/wiki/024klinegetMarketInfo()
- https://github.com/coinexcom/coinex_exchange_api/wiki/025marketinfogetMarketInfoSingle(market)
- https://github.com/coinexcom/coinex_exchange_api/wiki/026market_single_infogetMarketAMM()
- https://github.com/coinexcom/coinex_exchange_api/wiki/092amm_market_list
The Account and Trading APIs require additional signature/authentication in order to use.
This wrapper handles most of the authentication process, so the only thing that needs to be supplied is an AccessID and Secret with proper permissions. We recommend saving your key and secret as variables (ACCESSID = XXX
and SECRET=XXX
) in a separate python file named secrets.py
and importing it such as the example below.
For more information about acquiring an AccessID and Secret, refer to the CoinEx API documentation
from secrets import ACCESSID, SECRET # import api id and secret
coinex = coinex.CoinEx(ACCESSID, SECRET)
getAccountInfo()
- https://github.com/coinexcom/coinex_exchange_api/wiki/060balancegetAccountDepositAddress()
- https://github.com/coinexcom/coinex_exchange_api/wiki/072get_deposit_address
Using the Websocket API is currently not supported. Supported is planned in future updates.
For any help or questions, please open an issue on GitHub.