chart

suspend fun chart(symbol: String, interval: Interval, period: Period, vararg events: ChartEventType = emptyArray()): ChartData(source)

Fetches historical chart data for a given symbol from the Yahoo Finance Chart API.

Return

ChartData containing OHLCV data and metadata

Parameters

symbol

The stock symbol to query (e.g., "AAPL", "TSLA")

interval

The data interval (e.g., Interval.OneDay, Interval.OneHour)

period

The time period to retrieve data for (e.g., Period.OneYear, Period.OneMonth)

events

Optional event types to include (e.g., ChartEventType.DIVIDENDS, ChartEventType.SPLITS)

Throws

If the API call fails or returns an error response