get_ohlc_data
Get 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 date in YYYY-MM-DD format | |
| from | No | Start date in YYYY-MM-DD format | |
| limit | No | Max trading days to return, most recent first (before reversing to chronological order). Default 50, max 500. | |
| 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 | Data interval | daily |
| adjust_rights | No | Adjust historical prices for rights issues. Default false. | |
| adjust_splits | No | Adjust historical prices for stock splits and scrip/bonus share dividends. Default true. | |
| adjust_dividends | No | Adjust historical prices for cash dividends, producing a total-return series. Default false — turn this on when the user is asking about total return / performance rather than raw price action. |