CCXT

apex

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

apex

Kind: global class
Extends: Exchange

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-system-time-v3

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

fetchBalance

query for account info

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-retrieve-user-account-balance

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchBalance (params?)

fetchAccount

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

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-retrieve-user-account-data

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchAccount (params?)

fetchCurrencies

fetches all available currencies on an exchange

Kind: instance method of apex
Returns: object - an associative dictionary of currencies

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-all-config-data-v3

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchCurrencies (params?)

fetchMarkets

retrieves data on all markets for apex

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-all-config-data-v3

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

fetchTicker

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

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-ticker-data-v3

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchTicker (symbol, params?)

fetchTickers

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

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-ticker-data-v3

ParamTypeRequiredDescription
symbolsstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchTickers (symbols, params?)

fetchOHLCV

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

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-candlestick-chart-data-v3

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 candle to fetch
apex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchOrderBook

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

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-market-depth-v3

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
apex.fetchOrderBook (symbol, limit?, params?)

fetchTrades

get the list of most recent trades for a particular symbol

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

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-newest-trading-data-v3

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.untilintNothe latest time in ms to fetch trades for
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times
apex.fetchTrades (symbol, since?, limit?, params?)

fetchOpenInterest

retrieves the open interest of a contract trading pair

Kind: instance method of apex
Returns: object - an open interest structure/docs/manual#open-interest-structure

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-ticker-data-v3

ParamTypeRequiredDescription
symbolstringYesunified CCXT market symbol
paramsobjectNoexchange specific parameters
apex.fetchOpenInterest (symbol, params?)

fetchFundingRateHistory

fetches historical funding rate prices

Kind: instance method of apex
Returns: Array<object> - a list of funding rate structures

See: https://api-docs.pro.apex.exchange/#publicapi-v3-for-omni-get-funding-rate-history-v3

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNotimestamp in ms of the earliest funding rate to fetch
limitintNothe maximum amount of funding rate structures to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest funding rate
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
apex.fetchFundingRateHistory (symbol, since?, limit?, params?)

createOrder

create a trade order

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-post-creating-orders

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 fullfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerPricefloatNoThe price a trigger order is triggered at
params.stopLossPricefloatNoThe price a stop loss order is triggered at
params.takeProfitPricefloatNoThe price a take profit order is triggered at
params.timeInForcestringNo"GTC", "IOC", or "POST_ONLY"
params.postOnlyboolNotrue or false
params.reduceOnlyboolNoEnsures that the executed order does not flip the opened position.
params.clientOrderIdstringNoa unique id for the order
apex.createOrder (symbol, type, side, amount, price?, params?)

transfer

transfer currency internally between wallets on the same account

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

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.transferIdstringNoUUID, which is unique across the platform
apex.transfer (code, amount, fromAccount, toAccount, params?)

cancelAllOrders

cancel all open orders in a market

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-post-cancel-all-open-orders

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market to cancel orders in
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.cancelAllOrders (symbol, params?)

cancelOrder

cancels an open order

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-post-cancel-order

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

fetchOrder

fetches information on an order made by the user

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

See

ParamTypeRequiredDescription
idstringYesthe order id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNoa unique id for the order
apex.fetchOrder (id, symbol, params?)

fetchOpenOrders

fetches information on multiple orders made by the user

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-open-orders

ParamTypeRequiredDescription
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
apex.fetchOpenOrders (symbol, since?, limit?, params?)

fetchOrders

fetches information on multiple orders made by the user classic accounts only

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-all-order-history

ParamTypeRequiredDescription
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, default 100
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilobjectNoend time, ms
params.statusbooleanNo"PENDING", "OPEN", "FILLED", "CANCELED", "EXPIRED", "UNTRIGGERED"
params.sidebooleanNoBUY or SELL
params.typestringNo"LIMIT", "MARKET","STOP_LIMIT", "STOP_MARKET", "TAKE_PROFIT_LIMIT","TAKE_PROFIT_MARKET"
params.orderTypestringNo"ACTIVE","CONDITION","HISTORY"
params.pagebooleanNoPage numbers start from 0
apex.fetchOrders (symbol, since?, limit?, params?)

fetchOrderTrades

fetch all the trades made from a single order

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-trade-history

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchMyTrades

fetches information on multiple orders made by the user classic accounts only

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-trade-history

ParamTypeRequiredDescription
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, default 100
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilobjectNoend time
params.sidebooleanNoBUY or SELL
params.orderTypestringNo"LIMIT", "MARKET","STOP_LIMIT", "STOP_MARKET", "TAKE_PROFIT_LIMIT","TAKE_PROFIT_MARKET"
params.pagebooleanNoPage numbers start from 0
apex.fetchMyTrades (symbol, since?, limit?, params?)

fetchFundingHistory

fetches information on multiple orders made by the user classic accounts only

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

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-funding-rate

ParamTypeRequiredDescription
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, default 100
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilobjectNoend time, ms
params.sidebooleanNoBUY or SELL
params.pagebooleanNoPage numbers start from 0
apex.fetchFundingHistory (symbol, since?, limit?, params?)

setLeverage

set the level of leverage for a market

Kind: instance method of apex
Returns: object - response from the exchange

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-post-sets-the-initial-margin-rate-of-a-contract

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.setLeverage (leverage, symbol, params?)

fetchPositions

fetch all open positions

Kind: instance method of apex
Returns: Array<object> - a list of position structure

See: https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-get-retrieve-user-account-data

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.fetchPositions (symbols?, params?)

watchTrades

watches information on multiple trades made in a market

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.watchTrades (symbol, since?, limit?, params?)

watchTradesForSymbols

get the list of most recent trades for a list of symbols

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

ParamTypeRequiredDescription
symbolsArray<string>Yesunified 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
apex.watchTradesForSymbols (symbols, since?, limit?, params?)

watchOrderBook

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

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

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
apex.watchOrderBook (symbol, limit?, params?)

watchOrderBookForSymbols

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

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

ParamTypeRequiredDescription
symbolsArray<string>Yesunified array of symbols
limitintNothe maximum amount of order book entries to return.
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.watchOrderBookForSymbols (symbols, 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 apex
Returns: object - a ticker structure

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

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

watchTickers

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.watchTickers (symbols, params?)

watchOHLCV

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

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

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

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
apex.watchOHLCV (symbol, timeframe, since?, limit?, params?)

watchOHLCVForSymbols

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

Kind: instance method of apex
Returns: object - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint

ParamTypeRequiredDescription
symbolsAndTimeframesArray<Array<string>>Yesarray of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
apex.watchOHLCVForSymbols (symbolsAndTimeframes, since?, limit?, params?)

watchMyTrades

watches information on multiple trades made by the user

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

See: https://api-docs.pro.apex.exchange/#private-websocket

ParamTypeRequiredDescription
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.unifiedMarginbooleanNouse unified margin account
apex.watchMyTrades (symbol, since?, limit?, params?)

watchPositions

watch all open positions

Kind: instance method of apex
Returns: Array<object> - a list of position structure

See: https://api-docs.pro.apex.exchange/#private-websocket

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
sinceintNothe earliest time in ms to fetch positions for
limitintNothe maximum number of positions to retrieve
paramsobjectYesextra parameters specific to the exchange API endpoint
apex.watchPositions (symbols?, since?, limit?, params)

watchOrders

watches information on multiple orders made by the user

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

See: https://api-docs.pro.apex.exchange/#private-websocket

ParamTypeRequiredDescription
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
apex.watchOrders (symbol, since?, limit?, params?)

On this page