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

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-tickers

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

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-ticker

Function Name:

Usage:

Get Index Tickers

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-index-tickers

Function Name:

Usage:

Get Order Book

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-order-book

Function Name:

Usage:

Get Candlesticks

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-candlesticks

Function Name:

Usage:

Get Candlesticks History

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-candlesticks-history

Function Name:

Usage:

Get Index Candlesticks

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-index-candlesticks

Function Name:

Usage:

Get Mark Price Candlesticks

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-mark-price-candlesticks

Function Name:

Usage:

Get Trades

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-trades

Function Name:

Usage:

Get Trades History

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-trades-history

Function Name:

Usage:

Get 24H Total Volume

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-24h-total-volume

Function Name:

Usage:

Get Oracle

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-oracle

Function Name:

Usage:

Get Exchange Rate

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-exchange-rate

Function Name:

Usage:

Get Index Components

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-index-components

Function Name:

Usage:

Get Block Tickers

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-block-tickers

Function Name:

Usage:

Get Block Ticker

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-block-ticker

Function Name:

Usage:

Get Block Trades

Please refer to the official OKX API Docs for required parameters.

https://www.okx.com/docs-v5/en/#rest-api-market-data-get-block-trades

Function Name:

Usage:

Last updated