# Market

These endpoints provide public access to market data, including order book depth, recent trades, candlestick charts, and 24-hour ticker statistics. No authentication is required.

## Market Depth

> Get current order book depth for a given symbol.

```json
{"openapi":"3.0.0","info":{"title":"Coinlocally Market Spot API","version":"1.0.0"},"servers":[{"url":"https://openapi.coinlocally.com"}],"paths":{"/sapi/v2/depth":{"get":{"summary":"Market Depth","description":"Get current order book depth for a given symbol.","parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"description":"Symbol name, e.g., BTC/USDT"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":100},"description":"Limit the number of price levels returned"}],"responses":{"200":{"description":"Successfully retrieved order book depth.","content":{"application/json":{"schema":{"type":"object","properties":{"bids":{"type":"array","description":"List of current buy orders, sorted by best price (descending). Each entry is [price, quantity].","items":{"type":"array","items":{"type":"string"}}},"asks":{"type":"array","description":"List of current sell orders, sorted by best price (ascending). Each entry is [price, quantity].","items":{"type":"array","items":{"type":"string"}}},"time":{"type":"integer","description":"Server timestamp (in milliseconds) when the snapshot was generated."}}}}}}}}}}}
```

## 24hr Ticker Price Change Statistics

> Get 24 hour price change statistics. If no symbol is sent, data for all symbols is returned.

```json
{"openapi":"3.0.0","info":{"title":"Coinlocally Market Spot API","version":"1.0.0"},"servers":[{"url":"https://openapi.coinlocally.com"}],"paths":{"/sapi/v2/ticker":{"get":{"summary":"24hr Ticker Price Change Statistics","description":"Get 24 hour price change statistics. If no symbol is sent, data for all symbols is returned.","parameters":[{"name":"symbol","in":"query","required":false,"schema":{"type":"string"},"description":"Single symbol, e.g., BTC/USDT\n\n**Weight (IP/UID):**\n- If `symbol` is provided: 5\n- If `symbol` is not provided: 80"},{"name":"symbols","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of symbols, e.g., BTC/USDT,ethusdt\n\n**Weight (IP/UID):**\n- If `symbols` is not provided: 80\n- `symbols` (1–20): 5\n- `symbols` (21–100): 40\n- `symbols` (≥ 101): 80"}],"responses":{"200":{"description":"Successfully retrieved 24hr ticker data.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"time":{"type":"integer","description":"Open time (timestamp in milliseconds)"},"high":{"type":"string","description":"High price in the last 24 hours"},"low":{"type":"string","description":"Low price in the last 24 hours"},"open":{"type":"string","description":"Open price"},"last":{"type":"string","description":"Last traded price"},"vol":{"type":"string","description":"Total trade volume in base currency"},"rose":{"type":"string","description":"Price increase or rise (change %)"},"symbol":{"type":"string","description":"Symbol name, e.g., BTC/USDT"},"amount":{"type":"string","description":"Trade volume in quote currency"},"askPrice":{"type":"string","description":"Best ask price"},"askVolume":{"type":"string","description":"Best ask volume"},"bidPrice":{"type":"string","description":"Best bid price"},"bidVolume":{"type":"string","description":"Best bid volume"}}}]}}}}}}}}}
```

## Recent Trades List

> Get recent trades for a symbol.

```json
{"openapi":"3.0.0","info":{"title":"Coinlocally Market Spot API","version":"1.0.0"},"servers":[{"url":"https://openapi.coinlocally.com"}],"paths":{"/sapi/v2/trades":{"get":{"summary":"Recent Trades List","description":"Get recent trades for a symbol.","parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"description":"Symbol name, e.g., BTC/USDT"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"maximum":1000},"description":"Limit the number of trades returned"}],"responses":{"200":{"description":"Successfully retrieved recent trades.","content":{"application/json":{"schema":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string"},"qty":{"type":"string"},"time":{"type":"integer"},"side":{"type":"string","enum":["BUY","SELL"]}}}}}}}}}}}}}}
```

## Kline/Candlestick Data

> Get candlestick data for a given symbol and interval.

```json
{"openapi":"3.0.0","info":{"title":"Coinlocally Market Spot API","version":"1.0.0"},"servers":[{"url":"https://openapi.coinlocally.com"}],"paths":{"/sapi/v2/klines":{"get":{"summary":"Kline/Candlestick Data","description":"Get candlestick data for a given symbol and interval.","parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"description":"Symbol name, e.g., BTC/USDT"},{"name":"interval","in":"query","required":true,"schema":{"type":"string"},"description":"Interval of the candlestick data.\n\nSupported values: 1min, 5min, 15min, 30min, 60min, 1day, 1week, 1month."},{"name":"startTime","in":"query","required":false,"schema":{"type":"integer"},"description":"Start time in milliseconds (optional)"},{"name":"endTime","in":"query","required":false,"schema":{"type":"integer"},"description":"End time in milliseconds (optional)"}],"responses":{"200":{"description":"Successfully retrieved candlestick data.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"idx":{"type":"integer"},"open":{"type":"string"},"close":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"vol":{"type":"string"}}}}}}}}}}}}
```


---

# 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.coinlocally.com/spot/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.
