Fundamentals Timeseries Result
data class FundamentalsTimeseriesResult(val symbol: String, val data: Map<FundamentalsType, List<TimeseriesDataPoint>>)(source)
Yahoo Finance Fundamentals Timeseries API 조회 결과
요청한 재무 항목들에 대한 시계열 데이터를 타입별로 그룹화하여 제공합니다.
특징
타입별 그룹화: 각 FundamentalsType별로 시계열 데이터를 별도로 관리합니다.
빈 결과 지원: 데이터가 없는 경우 빈 맵을 반환합니다 (예외 발생 안 함).
헬퍼 메서드: 특정 타입 데이터 존재 여부 확인 및 안전한 조회를 지원합니다.
사용 예시
val result = yahooClient.fundamentalsTimeseries(
"AAPL",
listOf(FundamentalsType.ANNUAL_TOTAL_REVENUE, FundamentalsType.QUARTERLY_NET_INCOME)
)
// 특정 타입 데이터 존재 여부 확인
if (result.hasData(FundamentalsType.ANNUAL_TOTAL_REVENUE)) {
val revenues = result.get(FundamentalsType.ANNUAL_TOTAL_REVENUE)
revenues?.forEach { dataPoint ->
println("${dataPoint.asOfDate}: ${dataPoint.value}")
}
}
// 직접 접근
val netIncomes = result.data[FundamentalsType.QUARTERLY_NET_INCOME] ?: emptyList()Content copied to clipboard