> For the complete documentation index, see [llms.txt](https://docs.compendium.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.compendium.finance/pendax/using-pendax-sdk/blofin-functions/public-data.md).

# Public Data

## GET Instruments

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

<https://docs.blofin.com/index.html#get-instruments>
{% endhint %}

#### Function Name:

```javascript
getInstruments()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getInstruments(exchange, options) {
    try {
        let result = await exchange.getInstruments(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getInstruments(myBlofinExchange, 
});
```

## GET Tickers

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

<https://docs.blofin.com/index.html#get-tickers>
{% endhint %}

#### Function Name:

```javascript
getTickers()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getTickers(exchange, options) {
    try {
        let result = await exchange.getTickers(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getTickers(myBlofinExchange, 
});
```

## GET Order Book

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

<https://docs.blofin.com/index.html#get-order-book>
{% endhint %}

#### Function Name:

```javascript
getOrderBook()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getOrderBook(exchange, options) {
    try {
        let result = await exchange.getOrderBook(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderBook(myBlofinExchange, 
});
```

## GET Trades

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

<https://docs.blofin.com/index.html#get-trades>
{% endhint %}

#### Function Name:

```javascript
getTrades()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getTrades(exchange, options) {
    try {
        let result = await exchange.getTrades(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getTrades(myBlofinExchange, {
	instId: "<String>"
});
```

## GET Mark Price

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

<https://docs.blofin.com/index.html#get-mark-price>
{% endhint %}

#### Function Name:

```javascript
getMarkPrice()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getMarkPrice(exchange, options) {
    try {
        let result = await exchange.getMarkPrice(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getMarkPrice(myBlofinExchange, {
	instId: "<String>"
});
```

## GET Funding Rate

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

<https://docs.blofin.com/index.html#get-funding-rate>
{% endhint %}

#### Function Name:

```javascript
getFundingRate()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getFundingRate(exchange, options) {
    try {
        let result = await exchange.getFundingRate(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getFundingRate(myBlofinExchange, {
	instId: "<String>"
});
```

## GET Funding Rate History

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

<https://docs.blofin.com/index.html#get-funding-rate-history>
{% endhint %}

#### Function Name:

```javascript
getFundingRateHistory()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getFundingRateHistory(exchange, options) {
    try {
        let result = await exchange.getFundingRateHistory(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getFundingRateHistory(myBlofinExchange, {
	instId: "<String>"
});
```

## GET Candlesticks

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

<https://docs.blofin.com/index.html#get-candlesticks>
{% endhint %}

#### Function Name:

```javascript
getCandleSticks()
```

#### Usage:

```javascript
import { createExchange } from "./exchanges/exchange.js";

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

async function getCandleSticks(exchange, options) {
    try {
        let result = await exchange.getCandleSticks(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getCandleSticks(myBlofinExchange, {
	instId: "<String>"
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
