---
title: "Get Ohlc"
method: GET
path: "/api/ohlc/{symbol}"
tags: ["market"]
---

# Get Ohlc

`GET /api/ohlc/{symbol}`

## Request

- Base URL: `https://api.halalterminal.com`
- URL: `https://api.halalterminal.com/api/ohlc/{symbol}`
- Auth: API key in header `X-API-Key`

Retrieve OHLC candlestick data for a given symbol.

Returns a time-series list of Open, High, Low, Close, and Volume data
points for the requested symbol, period, and interval.

**curl example**:
```bash
curl -X GET "http://localhost:8000/api/ohlc/AAPL?period=1y&interval=1d"
```

**Python requests example**:
```python
import requests
resp = requests.get(
    "http://localhost:8000/api/ohlc/AAPL",
    params={"period": "1y", "interval": "1d"},
)
candles = resp.json()
```

## Path parameters

- `symbol` string, required: Ticker symbol, e.g. AAPL.

## Query parameters

- `period` string: Lookback period, e.g. 1d, 5d, 1mo, 1y, 5y, max.
- `interval` string: Candle interval, e.g. 1m, 5m, 1d, 1wk.

## Response `200`

List of OHLC candlestick data points

- OHLCPointResponse[]
  - `Date` string, required: Trading date in ISO-8601 format
  - `Open` number, required: Opening price
  - `High` number, required: Highest price during the period
  - `Low` number, required: Lowest price during the period
  - `Close` number, required: Closing price
  - `Volume` integer, required: Number of shares traded

## Other responses

- `401`: API key required or invalid
- `404`: Symbol not found in database
- `422`: Validation Error
- `429`: Quota exceeded

---

[API](https://skmtc.dev/halalterminal/apis/halal-terminal-api.md) · [All operations](https://skmtc.dev/halalterminal/apis/halal-terminal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/halalterminal/apis/halal-terminal-api/revisions/78768b250943?raw)
