Package: cex-services
cex_servicesThis package is designed for interacting with many crypto centralized exchanges. Currently only supportpublic API endpointsin Version1.0.x. Will add private API endpoints in version2.0.x.Getting startedusepip install cex-servicesto install the package.UsageAfter installing the package, you can use the following code start the service.All the codes is written in async mode.fromcex_services.binanceimportBinanceimportasyncioasyncdefmain():binance=awaitBinance.create()# get exchange infoprint(awaitbinance.get_exchange_info())# get all tickersprint(awaitbinance.get_tickers())if__name__=="__main__":asyncio.run(main())Supported ExchangesExchangeVersionPublic APIPrivate APIBinance1.0.1YesNoOKX1.0.1YesNoBybit1.0.1YesNoGate.io1.0.1YesNoKucoin1.0.1YesNoHTX1.0.1YesNoSupported API endpointsEndpointExchangesget_exchange_infoBinance, OKX, Bybit, Gate.io, Kucoin, HTX, Bitgetget_tickersBinance, OKX, Bybit, Gate.io, Kucoin, HTX, Bitgetget_klinesBinance, OKXUnified function parameters and output format1.get_exchange_infoInputParameterRequiredDefaultDescriptionmarket_typeNoNoneshould be value inspot,perp,futuresOutput (Nested Dictionary)FieldTypeDescriptioninstrument_idstrThe key of the dictionary. Format:{base}/{quote}:{settle}-{delivery}activeboolIndicates whether this instrument is currently tradable.is_spotboolIndicates whether this instrument is in the spot market.is_marginboolIndicates whether margin trading is available for this instrument.is_futuresboolIndicates whether this instrument is in the futures market.is_perpboolIndicates whether this instrument is in the perpetual market.is_linearboolReturnsTrueif this instrument is settled in a stable currency.is_inverseboolReturnsTrueif this instrument is settled in a coin.symbolstrThe unified symbol of the trading pair. Format:{base}/{quote}basestrThe base currency of the instrument.quotestrThe quote currency of the instrument.settlestrThe settlement currency for the instrument.multiplierintThe multiplier, typically indicating the quantity of the base currency included in one instrument unit.leveragefloatThe maximum leverage available for trading.listing_timeintThe listing time, represented as a 13-digit integer.expiration_timeintThe expiration time, represented as a 13-digit integer.contract_sizefloatThe contract size, with a default value of1. Indicates the amount of base currency per contract, usually applicable toperpandfutures.tick_sizefloatThe minimum increment by which the price can change.min_order_sizefloatThe minimum size for an order.max_order_sizefloatThe maximum size for an order.raw_datadictThe unprocessed raw data associated with the instrument.2.get_tickersInputParameterRequiredDefaultDescriptionmarket_typeNoNoneshould be value inspot,perp,futuresOutput (nested dict)FieldTypeDescriptioninstrument_idstrThe key of the dictionary. Format:{base}/{quote}:{settle}-{delivery}symbolstrThe raw symbol from the exchange.open_timeintThe opening time of the trading pair, in 13 digits.close_timeintThe closing time of the trading pair, in 13 digits.openfloatThe opening price of the trading pair in 24hr.highfloatThe highest price of the trading pair in 24hr.lowfloatThe lowest price of the trading pair in 24hr.last_pricefloatThe last price of the trading pair.base_volumefloatThe trading volume of the base currency in 24hr.quote_volumefloatThe trading volume of the quote currency in 24hr.price_changefloatThe price change of the trading pair in 24hr.price_change_percentfloatThe price change percentage of the trading pair in 24hr.raw_datadictThe unprocessed raw data associated with the trading pair.