fundamentals Timeseries
suspend fun fundamentalsTimeseries(symbol: String, types: List<FundamentalsType>, startDate: LocalDate? = null, endDate: LocalDate? = null): FundamentalsTimeseriesResult(source)
Fetches fundamentals timeseries data from the Yahoo Finance Fundamentals Timeseries API.
Retrieves timeseries data for financial statement items from Yahoo Finance. Provides annual, quarterly, and trailing data for items from income statements, balance sheets, and cash flow statements.
Return
FundamentalsTimeseriesResult containing timeseries data organized by type
Parameters
symbol
The stock symbol to query (e.g., "AAPL", "GOOGL")
types
List of FundamentalsType to retrieve (e.g., ANNUAL_TOTAL_REVENUE, QUARTERLY_NET_INCOME)
start Date
Start date for the query (default: 5 years ago)
end Date
End date for the query (default: today)
Throws
If symbol is blank or types list is empty
If the API call fails or returns an error response
Usage examples:
// Retrieve annual revenue and quarterly net income
val result = yahooClient.fundamentalsTimeseries(
"AAPL",
listOf(
FundamentalsType.ANNUAL_TOTAL_REVENUE,
FundamentalsType.QUARTERLY_NET_INCOME
)
)
// Retrieve data for a specific date range
val result = yahooClient.fundamentalsTimeseries(
"AAPL",
listOf(FundamentalsType.TRAILING_EPS),
startDate = LocalDate.of(2020, 1, 1),
endDate = LocalDate.of(2023, 12, 31)
)Content copied to clipboard