> For the complete documentation index, see [llms.txt](https://www.pionex.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pionex.com/docs/api-docs/trade-api/market.md).

# Market

Market data (public)

## Get market trades

> Get recent trades. Weight: 1.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/trades":{"get":{"tags":["Market"],"summary":"Get market trades","description":"Get recent trades. Weight: 1.","operationId":"getMarketTrades","parameters":[{"name":"symbol","in":"query","required":true,"description":"Trading pair symbol","schema":{"type":"string"}},{"name":"limit","in":"query","description":"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","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":"Trading pair symbol"},"tradeId":{"type":"string","description":"Unique trade identifier"},"price":{"type":"string","description":"Transaction price"},"size":{"type":"string","description":"Transaction quantity"},"side":{"type":"string","enum":["BUY","SELL"],"description":"Trade side (from taker perspective)"},"timestamp":{"type":"string","description":"Execution timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code","enum":["APIKEY_LOST","SIGNATURE_LOST","IP_NOT_WHITELISTED","INVALID_APIKEY","INVALID_SIGNATURE","APIKEY_EXPIRED","INVALID_TIMESTAMP","PERMISSION_DENIED","TRADE_INVALID_SYMBOL","TRADE_PARAMETER_ERROR","TRADE_OPERATION_DENIED","TRADE_ORDER_NOT_FOUND","MARKET_INVALID_SYMBOL","MARKET_PARAMETER_ERROR","MARKET_INVALID_TIME"]},"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

> Get order book snapshot. Weight: 1.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"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":"Get order book snapshot. Weight: 1.","operationId":"getMarketDepth","parameters":[{"name":"symbol","in":"query","required":true,"description":"Trading pair symbol","schema":{"type":"string"}},{"name":"limit","in":"query","description":"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, quantity], sorted by price descending","items":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2}},"asks":{"type":"array","description":"Ask orders [price, quantity], sorted by price ascending","items":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2}},"updateTime":{"type":"integer","format":"int64","description":"Update timestamp 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","enum":["APIKEY_LOST","SIGNATURE_LOST","IP_NOT_WHITELISTED","INVALID_APIKEY","INVALID_SIGNATURE","APIKEY_EXPIRED","INVALID_TIMESTAMP","PERMISSION_DENIED","TRADE_INVALID_SYMBOL","TRADE_PARAMETER_ERROR","TRADE_OPERATION_DENIED","TRADE_ORDER_NOT_FOUND","MARKET_INVALID_SYMBOL","MARKET_PARAMETER_ERROR","MARKET_INVALID_TIME"]},"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 tickers

> Get 24-hour price change statistics. Weight: 1.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/tickers":{"get":{"tags":["Market"],"summary":"Get 24hr tickers","description":"Get 24-hour price change statistics. Weight: 1.","operationId":"getTickers","parameters":[{"name":"symbol","in":"query","description":"Trading pair symbol. Returns all tickers if not specified.","schema":{"type":"string"}},{"name":"type","in":"query","description":"Defaults to SPOT if symbol is not specified. Accepts SPOT or PERP.","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","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":"Trading pair symbol"},"time":{"type":"integer","format":"int64","description":"Timestamp 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":"24-hour total trading volume"},"amount":{"type":"string","description":"24-hour total trading amount"},"count":{"type":"string","description":"24-hour total trading count"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code","enum":["APIKEY_LOST","SIGNATURE_LOST","IP_NOT_WHITELISTED","INVALID_APIKEY","INVALID_SIGNATURE","APIKEY_EXPIRED","INVALID_TIMESTAMP","PERMISSION_DENIED","TRADE_INVALID_SYMBOL","TRADE_PARAMETER_ERROR","TRADE_OPERATION_DENIED","TRADE_ORDER_NOT_FOUND","MARKET_INVALID_SYMBOL","MARKET_PARAMETER_ERROR","MARKET_INVALID_TIME"]},"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 book tickers

> Get best bid/ask prices. Weight: 1.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"Market data (public)"}],"servers":[{"url":"https://api.pionex.com","description":"Production"}],"paths":{"/api/v1/market/bookTickers":{"get":{"tags":["Market"],"summary":"Get book tickers","description":"Get best bid/ask prices. Weight: 1.","operationId":"getBookTickers","parameters":[{"name":"symbol","in":"query","description":"Trading pair symbol. Returns all if not specified.","schema":{"type":"string"}},{"name":"type","in":"query","description":"Defaults to PERP if symbol is not specified. Accepts SPOT or PERP.","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","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":"Trading pair symbol"},"bidPrice":{"type":"string","description":"Best bid price"},"bidSize":{"type":"string","description":"Volume at the best bid price"},"askPrice":{"type":"string","description":"Best ask price"},"askSize":{"type":"string","description":"Volume at the best ask price"},"timestamp":{"type":"string","description":"Timestamp in milliseconds"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code","enum":["APIKEY_LOST","SIGNATURE_LOST","IP_NOT_WHITELISTED","INVALID_APIKEY","INVALID_SIGNATURE","APIKEY_EXPIRED","INVALID_TIMESTAMP","PERMISSION_DENIED","TRADE_INVALID_SYMBOL","TRADE_PARAMETER_ERROR","TRADE_OPERATION_DENIED","TRADE_ORDER_NOT_FOUND","MARKET_INVALID_SYMBOL","MARKET_PARAMETER_ERROR","MARKET_INVALID_TIME"]},"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)

> Get OHLCV candlestick data. Weight: 1. Maximum 10,000 records.

```json
{"openapi":"3.0.3","info":{"title":"Pionex Open API","version":"1.0.0"},"tags":[{"name":"Market","description":"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":"Get OHLCV candlestick data. Weight: 1. Maximum 10,000 records.","operationId":"getKlines","parameters":[{"name":"symbol","in":"query","required":true,"description":"Trading pair symbol","schema":{"type":"string"}},{"name":"interval","in":"query","required":true,"description":"Kline interval","schema":{"type":"string","enum":["1M","5M","15M","30M","60M","4H","8H","12H","1D"]}},{"name":"endTime","in":"query","description":"End time in milliseconds","schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","description":"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","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":"Timestamp 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":"Total trading volume"}}},"ErrorResponse":{"type":"object","properties":{"result":{"type":"boolean"},"code":{"type":"string","description":"Error code","enum":["APIKEY_LOST","SIGNATURE_LOST","IP_NOT_WHITELISTED","INVALID_APIKEY","INVALID_SIGNATURE","APIKEY_EXPIRED","INVALID_TIMESTAMP","PERMISSION_DENIED","TRADE_INVALID_SYMBOL","TRADE_PARAMETER_ERROR","TRADE_OPERATION_DENIED","TRADE_ORDER_NOT_FOUND","MARKET_INVALID_SYMBOL","MARKET_PARAMETER_ERROR","MARKET_INVALID_TIME"]},"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"}}}}}}}
```
