Get OHLC price history
get_ohlc_dataGet OHLCV (open, high, low, close, volume) data for a CSE symbol. Prices are adjusted for splits by default (clean price action), but NOT for rights issues or dividends, unless requested. Defaults to the most recent 50 trading days; if more history is available the response says so and how to page further back with offset. Returns CSV (date,open,high,low,close,volume) preceded by a note if the symbol was resolved from a name/typo, if the company has other instruments, or if any corporate actions (splits/rights/dividends) fall within the requested range. If the input is ambiguous, returns JSON candidates instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of an explicit date range to fetch, in YYYY-MM-DD format. Omit to default to the latest available trading day. | |
| from | No | Start of an explicit date range to fetch, in YYYY-MM-DD format. Omit to use the default recent-trading-days window instead (see `limit`). | |
| limit | No | Max trading days to return. The most recent matching days are selected first and then reordered chronologically before being returned — use `offset` to page further back in history. | |
| offset | No | Skip this many of the most recent trading days before taking `limit` — use to page further back into history. | |
| symbol | Yes | A CSE ticker (e.g. "SAMP" or "SAMP.N0000") or the company name (e.g. "Sampath Bank"). Typos are tolerated. A bare symbol or name defaults to the voting-shares instrument if the company has more than one listed instrument (voting/non-voting/rights/debentures/preferential) — the response notes the others if so. If the input is ambiguous, the response returns candidates instead of data; ask the user to pick one and call again with the exact symbol. | |
| interval | No | Bar size for the returned series — use "weekly" or "monthly" to aggregate into coarser bars instead of daily candles. | daily |
| adjust_rights | No | Adjust historical prices for past rights issues falling within the range, producing continuous pre-/post-issue price action. | |
| adjust_splits | No | Adjust historical prices for stock splits and scrip/bonus share dividends. | |
| adjust_dividends | No | Adjust historical prices for cash dividends, producing a total-return series — turn this on when the user is asking about total return / performance rather than raw price action. |