# Market

## Test Connectivity

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity>
{% endhint %}

#### Function Name:

```javascript
testConnectivitySpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await testConnectivitySpot(myMexcExchanges);
```

## Check Server Time

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#check-server-time>
{% endhint %}

#### Function Name:

```javascript
getServerTimeSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getServerTimeSpot(myMexcExchanges);
```

## API default symbol

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#api-default-symbol>
{% endhint %}

#### Function Name:

```javascript
getSelfSymbolsSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getSelfSymbolsSpot(myMexcExchanges);
```

## Exchange Information

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#exchange-information>
{% endhint %}

#### Function Name:

```javascript
getExchangeInformationSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getExchangeInformationSpot(myMexcExchanges, {symbol: "BTCUSDT"});
```

## Order Book

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#order-book>
{% endhint %}

#### Function Name:

```javascript
getOrderBookSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getOrderBookSpot(myMexcExchanges, 
   {
     symbol: "BTCUSDT"
   });
```

## Recent Trades List

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list>
{% endhint %}

#### Function Name:

```javascript
getRecentTradesListSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getRecentTradesListSpot(myMexcExchanges, 
   {
     symbol: "BTCUSDT"
   });
```

## Compressed/Aggregate Trades List

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list>
{% endhint %}

#### Function Name:

```javascript
getAggTradesSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getAggTradesSpot(myMexcExchanges, 
   {
     symbol: "BTCUSDT"
   });
```

## Kline/Candlestick Data

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data>
{% endhint %}

#### Function Name:

```javascript
getKlinesSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getKlinesSpot(myMexcExchanges, 
   {
     symbol: "BTCUSDT",
     interval: "15m"
   });
```

## Current Average Price

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#current-average-price>
{% endhint %}

#### Function Name:

```javascript
getAvgPriceSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getAvgPriceSpot(myMexcExchanges,
 {
     symbol: "BTCUSDT"
 });
```

## 24hr Ticker Price Change Statistics

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics>
{% endhint %}

#### Function Name:

```javascript
get24HrTickerSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await get24HrTickerSpot(myMexcExchanges);
```

## Symbol Price Ticker

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#symbol-price-ticker>
{% endhint %}

#### Function Name:

```javascript
getPriceTickerSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getPriceTickerSpot(myMexcExchanges);
```

## Symbol Order Book Ticker

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

<https://mxcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker>
{% endhint %}

#### Function Name:

```javascript
getBookTickerSpot()
```

#### Usage:

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

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

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

let result = await getBookTickerSpot(myMexcExchanges);
```


---

# 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/mexc-functions/market.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.
