# OHLC `GET` `https://api.unusualwhales.com/api/stock/{ticker}/ohlc/{candle_size}` Returns the Open High Low Close (OHLC) candle data for a given ticker. Results are limited to 2,500 elements even if there are more available. Note: If you select 1d or 1w as a candle_size then the candles won't have a start & end time. For 1w, the `date` field is the Monday of the ISO week. Note: Suppose you enter end_date value 2024-11-25 which was a Monday. Your response will include 1-2 hours of data from Tuesday 2024-11-26 due to UTC date rollover. Rest-assured, the response data covers the full trading day (based on Eastern time) according to your entered end_date. ## Authentication ``` Authorization: Bearer YOUR_API_KEY ``` ## Path Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `ticker` | SingleTicker | Yes | A single ticker | | `candle_size` | string | Yes | | ## Query Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `timeframe` | Time frame | No | The timeframe of the data to return. Can be one of the following formats: - YTD - 1D, 2D, etc. - 1W, 2W, etc. - 1M, 2M, etc. - 1Y, 2Y, etc. | | `end_date` | OHLC End Date | No | A trading date in the format of YYYY-MM-DD. This is the end date for the given timeframe. If you set the timeframe to 1 minute ticks and have an end_date of 2024-01-18 then it would start searching backwards from 2024-01-18 | | `date` | Market Date | No | A trading date in the format of YYYY-MM-DD. | | `limit` | Max 2500 Min 1 | No | How many items to return. Max: 2500. Min: 1. | ## Response (200) | Field | Type | Description | |-------|------|-------------| | `close` | Candle Close | The closing price of the candle. | | `end_time` | Candle End time | The end time of the candle as UTC timestamp. | | `high` | Candle High | The highest price of the candle. | | `low` | Candle Low | The lowest price of the candle. | | `market_time` | Market General Market Time | The market time: - pr = premarket - r = regular - po = postmarket | | `open` | Candle Open | The opening price of the candle. | | `start_time` | Candle Start time | The start time of the candle as UTC timestamp. | | `total_volume` | Candle Total volume | The total volume of the ticker for the full trading till now. | | `volume` | Candle Volume | The volume of the candle. | ## Example ### curl ```bash curl -X GET "https://api.unusualwhales.com/api/stock/{ticker}/ohlc/{candle_size}" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("api.unusualwhales.com") headers = {"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"} conn.request("GET", "/api/stock/{ticker}/ohlc/{candle_size}", headers=headers) response = conn.getresponse() print(response.read().decode("utf-8")) ``` ## Response Example ```json { "data": [ { "close": "56.79", "end_time": "2023-09-07T20:11:00Z", "high": "56.79", "low": "56.79", "market_time": "po", "open": "56.79", "start_time": "2023-09-07T20:10:00Z", "total_volume": 13774488, "volume": 29812 }, { "close": "56.79", "end_time": "2023-09-07T20:07:00Z", "high": "56.79", "low": "56.79", "market_time": "po", "open": "56.79", "start_time": "2023-09-07T20:06:00Z", "total_volume": 13744676, "volume": 10699 } ] } ```