# Market

Futures market data (public)

## Get recent trades

> Query recent market trades. Results are taker-side trades only, sorted in descending order. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/trades":{"get":{"tags":["Market"],"summary":"Get recent trades","description":"Query recent market trades. Results are taker-side trades only, sorted in descending order. Weight: 5.","operationId":"getMarketTrades","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 10-500.","schema":{"type":"integer","default":100,"minimum":10,"maximum":500}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"trades":{"type":"array","description":"Recent trades sorted in descending order","items":{"$ref":"#/components/schemas/MarketTrade"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"MarketTrade":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"tradeId":{"type":"string","description":"Trade ID"},"price":{"type":"string","description":"Trade price"},"size":{"type":"string","description":"Trade quantity"},"side":{"type":"string","description":"Taker side","enum":["BUY","SELL"]},"timestamp":{"type":"string","description":"Trade time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get klines (candlestick data)

> Query candlestick/kline data for a futures symbol. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/klines":{"get":{"tags":["Market"],"summary":"Get klines (candlestick data)","description":"Query candlestick/kline data for a futures symbol. Weight: 5.","operationId":"getMarketKlines","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"description":"Kline interval. M=minutes, H=hours, D=day, W=week, m=month. Daily and larger intervals start from UTC 00:00. Weekly starts from Monday UTC 00:00. Monthly starts from the 1st UTC 00:00.","schema":{"type":"string","enum":["1M","5M","15M","30M","60M","4H","8H","12H","1D","1W","1m"]}},{"name":"endTime","in":"query","description":"End time in milliseconds. Defaults to current time. Returned klines include this time.","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-500.","schema":{"type":"integer","default":100,"minimum":1,"maximum":500}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"klines":{"type":"array","description":"Klines sorted by time in descending order","items":{"$ref":"#/components/schemas/Kline"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Kline":{"type":"object","properties":{"time":{"type":"integer","format":"int64","description":"Kline open time in milliseconds"},"open":{"type":"string","description":"Open price"},"close":{"type":"string","description":"Close price"},"high":{"type":"string","description":"Highest price"},"low":{"type":"string","description":"Lowest price"},"volume":{"type":"string","description":"Trading volume in base currency"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get order book depth

> Query order book depth for a futures symbol. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/depth":{"get":{"tags":["Market"],"summary":"Get order book depth","description":"Query order book depth for a futures symbol. Weight: 5.","operationId":"getMarketDepth","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Number of price levels. Default 20, range 1-1000.","schema":{"type":"integer","default":20,"minimum":1,"maximum":1000}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"bids":{"type":"array","description":"Bid orders [price, size], sorted by price descending","items":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2}},"asks":{"type":"array","description":"Ask orders [price, size], sorted by price ascending","items":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2}},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get 24hr ticker

> Query 24-hour rolling window price change statistics. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/tickers":{"get":{"tags":["Market"],"summary":"Get 24hr ticker","description":"Query 24-hour rolling window price change statistics. Weight: 5.","operationId":"getMarketTickers","parameters":[{"name":"symbol","in":"query","description":"Futures symbol. If specified, `type` is ignored.","schema":{"type":"string"}},{"name":"type","in":"query","description":"Market type. Defaults to SPOT. Only effective when `symbol` is not specified.","schema":{"type":"string","enum":["SPOT","PERP"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"tickers":{"type":"array","description":"24hr ticker data sorted by symbol ascending","items":{"$ref":"#/components/schemas/Ticker"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"Ticker":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"time":{"type":"integer","format":"int64","description":"Server time in milliseconds (rounded up to the second)"},"open":{"type":"string","description":"Open price"},"close":{"type":"string","description":"Close price"},"high":{"type":"string","description":"Highest price"},"low":{"type":"string","description":"Lowest price"},"volume":{"type":"string","description":"Trading volume in base currency"},"amount":{"type":"string","description":"Trading amount (sum of price * quantity)"},"count":{"type":"integer","description":"Number of trades"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get best bid/ask price

> Query best bid and ask price for futures symbols. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/bookTicker":{"get":{"tags":["Market"],"summary":"Get best bid/ask price","description":"Query best bid and ask price for futures symbols. Weight: 5.","operationId":"getBookTicker","parameters":[{"name":"symbol","in":"query","description":"Futures symbol. If specified, `type` is ignored.","schema":{"type":"string"}},{"name":"type","in":"query","description":"Market type. Defaults to PERP. Only effective when `symbol` is not specified.","schema":{"type":"string","enum":["SPOT","PERP"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"tickers":{"type":"array","description":"Book tickers sorted by symbol ascending","items":{"$ref":"#/components/schemas/BookTicker"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"BookTicker":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"bidPrice":{"type":"string","description":"Best bid price"},"bidSize":{"type":"string","description":"Best bid quantity"},"askPrice":{"type":"string","description":"Best ask price"},"askSize":{"type":"string","description":"Best ask quantity"},"timestamp":{"type":"integer","format":"int64","description":"Update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get index price klines

> Query index price candlestick data for a futures symbol. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/indexKlines":{"get":{"tags":["Market"],"summary":"Get index price klines","description":"Query index price candlestick data for a futures symbol. Weight: 5.","operationId":"getIndexKlines","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol. Only perpetual contracts are supported.","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"description":"Kline interval. M=minutes, H=hours, D=day, W=week, m=month. Daily and larger intervals start from UTC 00:00.","schema":{"type":"string","enum":["1M","5M","15M","30M","60M","4H","8H","12H","1D","1W","1m"]}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-2000.","schema":{"type":"integer","default":100,"minimum":1,"maximum":2000}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"klines":{"type":"array","description":"Index price klines sorted by time in descending order","items":{"$ref":"#/components/schemas/IndexKline"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"IndexKline":{"type":"object","properties":{"time":{"type":"string","description":"Kline open time in milliseconds"},"open":{"type":"string","description":"Open price"},"close":{"type":"string","description":"Close price"},"high":{"type":"string","description":"Highest price"},"low":{"type":"string","description":"Lowest price"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get mark price klines

> Query mark price candlestick data for a futures symbol. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/markKlines":{"get":{"tags":["Market"],"summary":"Get mark price klines","description":"Query mark price candlestick data for a futures symbol. Weight: 5.","operationId":"getMarkKlines","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol. Only perpetual contracts are supported.","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"description":"Kline interval. M=minutes, H=hours, D=day, W=week, m=month. Daily and larger intervals start from UTC 00:00.","schema":{"type":"string","enum":["1M","5M","15M","30M","60M","4H","8H","12H","1D","1W","1m"]}},{"name":"limit","in":"query","description":"Number of results to return. Default 100, range 1-2000.","schema":{"type":"integer","default":100,"minimum":1,"maximum":2000}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"klines":{"type":"array","description":"Mark price klines sorted by time in descending order","items":{"$ref":"#/components/schemas/IndexKline"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"IndexKline":{"type":"object","properties":{"time":{"type":"string","description":"Kline open time in milliseconds"},"open":{"type":"string","description":"Open price"},"close":{"type":"string","description":"Close price"},"high":{"type":"string","description":"Highest price"},"low":{"type":"string","description":"Lowest price"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get historical funding rates

> Query historical funding rates for a futures symbol. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/fundingRates":{"get":{"tags":["Market"],"summary":"Get historical funding rates","description":"Query historical funding rates for a futures symbol. Weight: 5.","operationId":"getFundingRates","parameters":[{"name":"symbol","in":"query","required":true,"description":"Futures symbol. Only perpetual contracts are supported.","schema":{"type":"string"}},{"name":"endTime","in":"query","description":"Query funding rates before this time. Defaults to current time. Milliseconds.","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"Number of results to return. Default 1, range 1-500.","schema":{"type":"integer","default":1,"minimum":1,"maximum":500}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"rates":{"type":"array","description":"Funding rates sorted by fundingTime in descending order","items":{"type":"object","properties":{"fundingRate":{"type":"string","description":"Funding rate"},"fundingTime":{"type":"integer","format":"int64","description":"Funding time in milliseconds"}}}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get futures index prices

> Query index price, mark price, and next funding rate for futures symbols. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/indexes":{"get":{"tags":["Market"],"summary":"Get futures index prices","description":"Query index price, mark price, and next funding rate for futures symbols. Weight: 5.","operationId":"getIndexes","parameters":[{"name":"symbol","in":"query","description":"Futures symbol. Only perpetual contracts are supported. Returns all if not specified.","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"indexes":{"type":"array","description":"Index data sorted by symbol ascending","items":{"$ref":"#/components/schemas/FuturesIndex"}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"FuturesIndex":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"indexPrice":{"type":"string","description":"Index price"},"markPrice":{"type":"string","description":"Mark price"},"nextFundingRate":{"type":"string","description":"Estimated next funding rate"},"nextFundingTime":{"type":"integer","format":"int64","description":"Next funding time in milliseconds"},"updateTime":{"type":"integer","format":"int64","description":"Last update time in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Get open interest

> Query open interest for all futures symbols. Weight: 5.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Futures Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Futures market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/openInterests":{"get":{"tags":["Market"],"summary":"Get open interest","description":"Query open interest for all futures symbols. Weight: 5.","operationId":"getOpenInterests","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseResponse"},{"type":"object","properties":{"data":{"type":"object","properties":{"openInterests":{"type":"array","description":"Open interest data sorted by symbol ascending","items":{"type":"object","properties":{"symbol":{"type":"string","description":"Futures symbol"},"openInterest":{"type":"string","description":"Open interest amount"}}}}}}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"components":{"schemas":{"BaseResponse":{"type":"object","properties":{"result":{"type":"boolean","description":"Request success indicator"},"timestamp":{"type":"integer","format":"int64","description":"Response timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"},"timestamp":{"type":"integer","format":"int64"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```


---

# 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://www.pionex.com/docs/api-docs/futures-api/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.
