Market Data
Documentation on interacting with a variety of OKX's Market Data API functions through the PENDAX Javascript SDK.
API calls for market data functions do not require account authentication/authorization.
Market Data
Get Tickers
This function is also included in "Common Functions" as getMarkets()
Function Name:
getTickers()Usage:
import { createExchange } from "./exchanges/exchange.js";
let myOkxAccount = createExchange({
exchange: "okx",
authenticate: true,
key: "myKeys",
secret: "mySecret",
passphrase: "myPassphrase",
label: "okx",
marginType: "usdt"
});
async function getTickers(exchange, options) {
try {
let result = await exchange.getTickers(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getTickers(myOkxAccount,
{
instType:"SWAP"
})Get Ticker
This function is also included in "Common Functions" as getMarket()
Function Name:
Usage:
Get Index Tickers
Function Name:
Usage:
Get Order Book
Function Name:
Usage:
Get Candlesticks
Function Name:
Usage:
Get Candlesticks History
Function Name:
Usage:
Get Index Candlesticks
Function Name:
Usage:
Get Mark Price Candlesticks
Function Name:
Usage:
Get Trades
Function Name:
Usage:
Get Trades History
Function Name:
Usage:
Get 24H Total Volume
Function Name:
Usage:
Get Oracle
Function Name:
Usage:
Get Exchange Rate
Function Name:
Usage:
Get Index Components
Function Name:
Usage:
Get Block Tickers
Function Name:
Usage:
Get Block Ticker
Function Name:
Usage:
Get Block Trades
Function Name:
Usage:
Last updated