CCXT

cex

cex cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

cex

Kind: global class
Extends: Exchange

fetchCurrencies

fetches all available currencies on an exchange

Kind: instance method of cex
Returns: dict - an associative dictionary of currencies

See: https://trade.cex.io/docs/#rest-public-api-calls-currencies-info

ParamTypeRequiredDescription
paramsdictNoextra parameters specific to the exchange API endpoint
cex.fetchCurrencies (params?)

fetchMarkets

retrieves data on all markets for ace

Kind: instance method of cex
Returns: Array<object> - an array of objects representing market data

See: https://trade.cex.io/docs/#rest-public-api-calls-pairs-info

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchMarkets (params?)

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of cex
Returns: int - the current integer timestamp in milliseconds from the exchange server

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchTime (params?)

fetchTicker

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of cex
Returns: object - a dictionary of ticker structures

See: https://trade.cex.io/docs/#rest-public-api-calls-ticker

ParamTypeRequiredDescription
symbolstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchTicker (symbol, params?)

fetchTickers

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of cex
Returns: object - a dictionary of ticker structures

See: https://trade.cex.io/docs/#rest-public-api-calls-ticker

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchTickers (symbols, params?)

fetchTrades

get the list of most recent trades for a particular symbol

Kind: instance method of cex
Returns: Array<Trade> - a list of trade structures

See: https://trade.cex.io/docs/#rest-public-api-calls-trade-history

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest entry
cex.fetchTrades (symbol, since?, limit?, params?)

fetchOrderBook

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of cex
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://trade.cex.io/docs/#rest-public-api-calls-order-book

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchOrderBook (symbol, limit?, params?)

fetchOHLCV

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of cex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://trade.cex.io/docs/#rest-public-api-calls-candles

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest entry
cex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchTradingFees

fetch the trading fees for multiple markets

Kind: instance method of cex
Returns: object - a dictionary of fee structures indexed by market symbols

See: https://trade.cex.io/docs/#rest-public-api-calls-candles

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchTradingFees (params?)

fetchBalance

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of cex
Returns: object - a balance structure

See: https://trade.cex.io/docs/#rest-private-api-calls-account-status-v3

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.methodobjectNo'privatePostGetMyWalletBalance' or 'privatePostGetMyAccountStatusV3'
params.accountobjectNoin case 'privatePostGetMyAccountStatusV3' is chosen, this can specify the account name (default is empty string)
cex.fetchBalance (params?)

fetchOrders

fetches information on multiple orders made by the user

Kind: instance method of cex
Returns: Array<Order> - a list of order structures

See: https://trade.cex.io/docs/#rest-private-api-calls-orders

ParamTypeRequiredDescription
statusstringYesorder status to fetch for
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest entry
cex.fetchOrders (status, symbol, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple canceled orders made by the user

Kind: instance method of cex
Returns: object - a list of order structures

See: https://trade.cex.io/docs/#rest-private-api-calls-orders

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNotimestamp in ms of the earliest order, default is undefined
limitintNomax number of orders to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchClosedOrders (symbol, since?, limit?, params?)

fetchOpenOrders

fetches information on multiple canceled orders made by the user

Kind: instance method of cex
Returns: object - a list of order structures

See: https://trade.cex.io/docs/#rest-private-api-calls-orders

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNotimestamp in ms of the earliest order, default is undefined
limitintNomax number of orders to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchOpenOrders (symbol, since?, limit?, params?)

fetchOpenOrder

fetches information on an open order made by the user

Kind: instance method of cex
Returns: object - an order structure

See: https://trade.cex.io/docs/#rest-private-api-calls-orders

ParamTypeRequiredDescription
idstringYesorder id
symbolstringNounified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchOpenOrder (id, symbol?, params?)

fetchClosedOrder

fetches information on an closed order made by the user

Kind: instance method of cex
Returns: object - an order structure

See: https://trade.cex.io/docs/#rest-private-api-calls-orders

ParamTypeRequiredDescription
idstringYesorder id
symbolstringNounified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchClosedOrder (id, symbol?, params?)

createOrder

create a trade order

Kind: instance method of cex
Returns: object - an order structure

See: https://trade.cex.io/docs/#rest-private-api-calls-new-order

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.accountIdstringNoaccount-id to use (default is empty string)
params.triggerPricefloatNothe price at which a trigger order is triggered at
cex.createOrder (symbol, type, side, amount, price?, params?)

cancelOrder

cancels an open order

Kind: instance method of cex
Returns: object - An order structure

See: https://trade.cex.io/docs/#rest-private-api-calls-cancel-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.cancelOrder (id, symbol, params?)

cancelAllOrders

cancel all open orders in a market

Kind: instance method of cex
Returns: Array<object> - a list of order structures

See: https://trade.cex.io/docs/#rest-private-api-calls-cancel-all-orders

ParamTypeRequiredDescription
symbolstringYesalpaca cancelAllOrders cannot setting symbol, it will cancel all open orders
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.cancelAllOrders (symbol, params?)

fetchLedger

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of cex
Returns: object - a ledger structure

See: https://trade.cex.io/docs/#rest-private-api-calls-transaction-history

ParamTypeRequiredDescription
codestringNounified currency code
sinceintNotimestamp in ms of the earliest ledger entry
limitintNomax number of ledger entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest ledger entry
cex.fetchLedger (code?, since?, limit?, params?)

fetchDepositsWithdrawals

fetch history of deposits and withdrawals

Kind: instance method of cex
Returns: object - a list of transaction structure

See: https://trade.cex.io/docs/#rest-private-api-calls-funding-history

ParamTypeRequiredDescription
codestringNounified currency code for the currency of the deposit/withdrawals, default is undefined
sinceintNotimestamp in ms of the earliest deposit/withdrawal, default is undefined
limitintNomax number of deposit/withdrawals to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.fetchDepositsWithdrawals (code?, since?, limit?, params?)

transfer

transfer currency internally between wallets on the same account

Kind: instance method of cex
Returns: object - a transfer structure

See: https://trade.cex.io/docs/#rest-private-api-calls-internal-transfer

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYes'SPOT', 'FUND', or 'CONTRACT'
toAccountstringYes'SPOT', 'FUND', or 'CONTRACT'
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.transfer (code, amount, fromAccount, toAccount, params?)

fetchDepositAddress

fetch the deposit address for a currency associated with this account

Kind: instance method of cex
Returns: object - an address structure

See: https://trade.cex.io/docs/#rest-private-api-calls-deposit-address

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.accountIdstringNoaccount-id (default to empty string) to refer to (at this moment, only sub-accounts allowed by exchange)
cex.fetchDepositAddress (code, params?)

watchBalance

watch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of cex
Returns: object - a balance structure

See: https://cex.io/websocket-api#get-balance

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchBalance (params?)

watchTrades

get the list of most recent trades for a particular symbol. Note: can only watch one symbol at a time.

Kind: instance method of cex
Returns: Array<object> - a list of trade structures

See: https://cex.io/websocket-api#old-pair-room

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchTrades (symbol, since?, limit?, params?)

watchTicker

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of cex
Returns: object - a ticker structure

See: https://cex.io/websocket-api#ticker-subscription

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.methodstringNopublic or private
cex.watchTicker (symbol, params?)

watchTickers

watches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of cex
Returns: object - a dictionary of ticker structures

See: https://cex.io/websocket-api#ticker-subscription

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchTickers (symbols, params?)

fetchTickerWs

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of cex
Returns: object - a ticker structure

See: https://docs.cex.io/#ws-api-ticker-deprecated

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the cex api endpoint
cex.fetchTickerWs (symbol, params?)

fetchBalanceWs

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of cex
Returns: object - a balance structure

See: https://docs.cex.io/#ws-api-get-balance

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the cex api endpoint
cex.fetchBalanceWs (params?)

watchOrders

get the list of orders associated with the user. Note: In CEX.IO system, orders can be present in trade engine or in archive database. There can be time periods (~2 seconds or more), when order is done/canceled, but still not moved to archive database. That means, you cannot see it using calls: archived-orders/open-orders.

Kind: instance method of cex
Returns: Array<object> - a list of trade structures

See: https://docs.cex.io/#ws-api-open-orders

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchOrders (symbol, since?, limit?, params?)

watchMyTrades

get the list of trades associated with the user. Note: In CEX.IO system, orders can be present in trade engine or in archive database. There can be time periods (~2 seconds or more), when order is done/canceled, but still not moved to archive database. That means, you cannot see it using calls: archived-orders/open-orders.

Kind: instance method of cex
Returns: Array<object> - a list of trade structures

See: https://docs.cex.io/#ws-api-open-orders

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchMyTrades (symbol, since?, limit?, params?)

watchOrderBook

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of cex
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://cex.io/websocket-api#orderbook-subscribe

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchOrderBook (symbol, limit?, params?)

watchOHLCV

watches historical candlestick data containing the open, high, low, and close price, and the volume of a market. It will return the last 120 minutes with the selected timeframe and then 1m candle updates after that.

Kind: instance method of cex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://cex.io/websocket-api#minute-data

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents.
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
cex.watchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchOrderWs

fetches information on an order made by the user

Kind: instance method of cex
Returns: object - An order structure

See: https://docs.cex.io/#ws-api-get-order

ParamTypeRequiredDescription
idstringYesthe order id
symbolstringYesnot used by cex fetchOrder
paramsobjectNoextra parameters specific to the cex api endpoint
cex.fetchOrderWs (id, symbol, params?)

fetchOpenOrdersWs

fetch all unfilled currently open orders

Kind: instance method of cex
Returns: Array<Order> - a list of order structures

See: https://docs.cex.io/#ws-api-open-orders

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the cex api endpoint
cex.fetchOpenOrdersWs (symbol, since?, limit?, params?)

createOrderWs

create a trade order

Kind: instance method of cex
Returns: object - an order structure

See: https://docs.cex.io/#ws-api-order-placement

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatYesthe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the kraken api endpoint
params.maker_onlybooleanNoOptional, maker only places an order only if offers best sell (<= max) or buy(>= max) price for this pair, if not order placement will be rejected with an error - "Order is not maker"
cex.createOrderWs (symbol, type, side, amount, price, params?)

editOrderWs

edit a trade order

Kind: instance method of cex
Returns: object - an order structure

See: https://docs.cex.io/#ws-api-cancel-replace

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of the currency you want to trade in units of the base currency
pricefloat, undefinedNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the cex api endpoint
cex.editOrderWs (id, symbol, type, side, amount, price?, params?)

cancelOrderWs

cancels an open order

Kind: instance method of cex
Returns: object - An order structure

See: https://docs.cex.io/#ws-api-order-cancel

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesnot used by cex cancelOrder ()
paramsobjectNoextra parameters specific to the cex api endpoint
cex.cancelOrderWs (id, symbol, params?)

cancelOrdersWs

cancel multiple orders

Kind: instance method of cex
Returns: object - a list of order structures

See: https://docs.cex.io/#ws-api-mass-cancel-place

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesnot used by cex cancelOrders()
paramsobjectNoextra parameters specific to the cex api endpoint
cex.cancelOrdersWs (ids, symbol, params?)

On this page