# Charts

## GET /ohlc

> Fetch OHLC (candlestick) data for the requested pair

```json
{"openapi":"3.1.0","info":{"title":"Saturn Indexer API","version":"0.1.0"},"tags":[{"name":"ohlc","description":"OHLC chart data"}],"servers":[{"url":"http://127.0.0.1:3000","description":"Local testing"}],"paths":{"/ohlc":{"get":{"tags":["ohlc"],"description":"Fetch OHLC (candlestick) data for the requested pair","operationId":"get_ohlc_data","parameters":[{"name":"granularity","in":"query","required":true,"schema":{"$ref":"#/components/schemas/OHLCGranularity"}},{"name":"startDate","in":"query","required":true,"schema":{"type":"string"}},{"name":"endDate","in":"query","required":true,"schema":{"type":"string"}},{"name":"token0","in":"query","required":true,"schema":{"type":"string"}},{"name":"token1","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OHLC Data","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OHLCData"}}}}},"400":{"description":"Bad request"}}}}},"components":{"schemas":{"OHLCGranularity":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","1d","1w"]},"OHLCData":{"type":"object","required":["id","pair","openPrice","highPrice","lowPrice","closePrice","volume","startTimestamp","endTimestamp","granularity","transactions","createdAt","updatedAt"],"properties":{"id":{"type":"integer","format":"int32","minimum":0},"pair":{"$ref":"#/components/schemas/AssetPair"},"openPrice":{"type":"string"},"highPrice":{"type":"string"},"lowPrice":{"type":"string"},"closePrice":{"type":"string"},"volume":{"type":"string"},"startTimestamp":{"type":"string","format":"date-time"},"endTimestamp":{"type":"string","format":"date-time"},"granularity":{"$ref":"#/components/schemas/OHLCGranularity"},"transactions":{"type":"integer","format":"int32","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"AssetPair":{"type":"object","required":["token0Id","token1Id"],"properties":{"token0Id":{"type":"string"},"token1Id":{"type":"string"}}}}}}
```
