# Public Data

The API endpoints of `Public Data` do not require authentication.

## Public Data

### Get Instruments

{% hint style="info" %}
Please refer to the official OKX API Docs for the required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-instruments>
{% endhint %}

#### Function Name:

```javascript
getInstruments()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getInstruments(exchange, options) {
    try {
        let result = await exchange.getInstruments(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInstruments(myOkxAccount,
<strong>{
</strong>    instType: "SWAP"
});
</code></pre>

### Get Delivery/Exercise Data

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-delivery-exercise-history>
{% endhint %}

#### Function Name:

```javascript
getDeliveryAndRequestHistory()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getDeliveryAndRequestHistory(exchange, options) {
    try {
        let result = await exchange.getDeliveryAndRequestHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getDeliveryAndRequestHistory(myOkxAccount,
<strong>{
</strong>  instType: "OPTION",
  uly: "BTC-USD"
});
</code></pre>

### Get Open Interest

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-open-interest>
{% endhint %}

#### Function Name:

```javascript
getOpenInterest()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getOpenInterest(exchange, options) {
    try {
        let result = await exchange.getOpenInterest(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getOpenInterest(myOkxAccount,
<strong>{
</strong>    instType: "SWAP"
});
</code></pre>

### Get Funding Rate

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-funding-rate>
{% endhint %}

#### Function Name:

```javascript
getFundingRate()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getFundingRate(exchange, options) {
    try {
        let result = await exchange.getFundingRate(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getFundingRate(myOkxAccount,
<strong>{
</strong>    instId: "BTC-USD-SWAP"
});
</code></pre>

### Get Funding Rate History

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-funding-rate-history>
{% endhint %}

#### Function Name:

```javascript
getFundingHistory()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getFundingHistory(exchange, options) {
    try {
        let result = await exchange.getFundingHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getFundingHistory(myOkxAccount,
<strong>{
</strong>    instId: "BTC-USD-SWAP"
});
</code></pre>

### Get Limit Price

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-limit-price>
{% endhint %}

#### Function Name:

```javascript
getLimitPrice()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getLimitPrice(exchange, options) {
    try {
        let result = await exchange.getLimitPrice(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getLimitPrice(myOkxAccount,
<strong>{
</strong>    instId: "BTC-USDT-SWAP"
});
</code></pre>

### Get Option Market Data

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-option-market-data>
{% endhint %}

#### Function Name:

```javascript
getOptionMarketData()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getOptionMarketData(exchange, options) {
    try {
        let result = await exchange.getOptionMarketData(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getOptionMarketData(myOkxAccount,
<strong>{
</strong>    uly: "BTC-USD"
});
</code></pre>

### Get Estimated Delivery/Exercise Price

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-estimated-delivery-exercise-price>
{% endhint %}

#### Function Name:

```javascript
getEstimatedDelExpPrice()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getEstimatedDelExpPrice(exchange, options) {
    try {
        let result = await exchange.getEstimatedDelExpPrice(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getEstimatedDelExpPrice(myOkxAccount,
<strong>{
</strong>  instId: "BTC-USD-230106-16200-P"
});
</code></pre>

### Get Discount Rate and Interest-Free Quota

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-discount-rate-and-interest-free-quota>
{% endhint %}

#### Function Name:

```javascript
getDiscRateAndIntFreeQuota()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getDiscRateAndIntFreeQuota(exchange, options) {
    try {
        let result = await exchange.getDiscRateAndIntFreeQuota(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getDiscRateAndIntFreeQuota(myOkxAccount,
<strong>{
</strong>    instType: "SWAP"
});
</code></pre>

### Get System Time

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-system-time>
{% endhint %}

#### Function Name:

```javascript
getServerTime()
```

#### Usage:&#x20;

```javascript
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 getServerTime(exchange, options) {
    try {
        let result = await exchange.getServerTime(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getServerTime(myOkxAccount);
```

### Get Liquidation Orders

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-liquidation-orders>
{% endhint %}

#### Function Name:

```javascript
getLiqOrders()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getLiqOrders(exchange, options) {
    try {
        let result = await exchange.getLiqOrders(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getLiqOrders(myOkxAccount,
<strong>{
</strong>  instType: "MARGIN",
  instId: "BTC-USDT"
}));
</code></pre>

### Get Mark Price

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-mark-price>
{% endhint %}

#### Function Name:

```javascript
getMarkPrice()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getMarkPrice(exchange, options) {
    try {
        let result = await exchange.getMarkPrice(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getMarkPrice(myOkxAccount,
<strong>{
</strong>    instType: "SWAP"
});
</code></pre>

### Get Position Tiers

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-position-tiers>
{% endhint %}

#### Function Name:

```javascript
getPositionTiers()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getPositionTiers(exchange, options) {
    try {
        let result = await exchange.getPositionTiers(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getPositionTiers(myOkxAccount,
<strong>{
</strong>  instType: "SWAP",
  tdMode: "cross",
  uly: ["BTC-USD"]
});
</code></pre>

### Get Interest Rate and Loan Quota

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-interest-rate-and-loan-quota>
{% endhint %}

#### Function Name:

```javascript
getInterestRateAndLoanQuota()
```

#### Usage:&#x20;

```javascript
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 getInterestRateAndLoanQuota(exchange, options) {
    try {
        let result = await exchange.getInterestRateAndLoanQuota(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInterestRateAndLoanQuota(myOkxAccount);
```

### Get Interest Rate and Loan Quota for VIP Loans

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-interest-rate-and-loan-quota-for-vip-loans>
{% endhint %}

#### Function Name:

```javascript
getVipInterestRateAndLoanQuota()
```

#### Usage:&#x20;

```javascript
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 getVipInterestRateAndLoanQuota(exchange, options) {
    try {
        let result = await exchange.getVipInterestRateAndLoanQuota(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getVipInterestRateAndLoanQuota(myOkxAccount);
```

### Get Underlying

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-underlying>
{% endhint %}

#### Function Name:

```javascript
getUnderlying()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getUnderlying(exchange, options) {
    try {
        let result = await exchange.getUnderlying(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getUnderlying(myOkxAccount,
<strong>{
</strong>    instType: "SWAP"
});
</code></pre>

### Get Insurance Fund

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-get-insurance-fund>
{% endhint %}

#### Function Name:

```javascript
getInsuranceFund()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 getInsuranceFund(exchange, options) {
    try {
        let result = await exchange.getInsuranceFund(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getInsuranceFund(myOkxAccount,
<strong>{
</strong>  instType: "SWAP",
  uly: "BTC-USD"
});
</code></pre>

### Unit Convert

{% hint style="info" %}
Please refer to the official OKX API Docs for required parameters.

<https://www.okx.com/docs-v5/en/#rest-api-public-data-unit-convert>
{% endhint %}

#### Function Name:

```javascript
unitConvert()
```

#### Usage:&#x20;

<pre class="language-javascript"><code class="lang-javascript">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 unitConvert(exchange, options) {
    try {
        let result = await exchange.unitConvert(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await unitConvert(myOkxAccount,
<strong>{
</strong>  instId: "BTC-USD-SWAP",
  px: "35000",
  sz: "0.888"
});
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/okx-functions/public-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
