YahooClient

Yahoo Finance API Client

Provides a simple client interface to access the Yahoo Finance API. This client handles authentication, rate limiting, and response parsing automatically.

Usage example:

val yahoo = YahooClient.create()
val quote = yahoo.quoteSummary("AAPL", QuoteSummaryModule.PRICE)
val chart = yahoo.chart("AAPL", Interval.OneDay, Period.OneYear)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun chart(symbol: String, interval: Interval, period: Period, vararg events: ChartEventType = emptyArray()): ChartData

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

Link copied to clipboard
open override fun close()

Closes the client and releases all resources.

Link copied to clipboard
suspend fun earningsCalendar(symbol: String, limit: Int = 12, offset: Int = 0): EarningsCalendar

Fetches earnings calendar data for a given symbol from the Yahoo Finance Earnings Calendar.

Link copied to clipboard
suspend fun fundamentalsTimeseries(symbol: String, types: List<FundamentalsType>, startDate: LocalDate? = null, endDate: LocalDate? = null): FundamentalsTimeseriesResult

Fetches fundamentals timeseries data from the Yahoo Finance Fundamentals Timeseries API.

Link copied to clipboard
suspend fun lookup(query: String, type: LookupType = LookupType.ALL, count: Int = 25): LookupResult

Searches for financial instruments using the Yahoo Finance Lookup API.

Link copied to clipboard

Fetches market summary information from the Yahoo Finance Market Summary API.

Link copied to clipboard
suspend fun marketTime(market: MarketCode): MarketTimeResult

Fetches market time information from the Yahoo Finance Market Time API.

Link copied to clipboard
suspend fun options(symbol: String, expirationDate: Long? = null): OptionsData

Fetches options chain data from the Yahoo Finance Options API.

Link copied to clipboard
suspend fun quote(symbol: String): QuoteData

Fetches real-time market data for a single symbol from the Yahoo Finance Quote API.

suspend fun quote(symbols: List<String>): List<QuoteData>

Fetches real-time market data for multiple symbols from the Yahoo Finance Quote API.

Link copied to clipboard
suspend fun quoteSummary(symbol: String, vararg modules: QuoteSummaryModule): QuoteSummaryModuleResult

Fetches quote summary data for a given symbol from the Yahoo Finance QuoteSummary API.

Link copied to clipboard
suspend fun screener(predefined: PredefinedScreener, count: Int = 25, sortField: ScreenerSortField? = null, sortAsc: Boolean? = null): ScreenerResult
suspend fun screener(predefinedId: String, count: Int = 25, sortField: ScreenerSortField? = null, sortAsc: Boolean? = null): ScreenerResult

Searches for stocks using a predefined screener query with the Yahoo Finance Screener API.

suspend fun screener(query: ScreenerQuery, sortField: ScreenerSortField = ScreenerSortField.TICKER, sortAsc: Boolean = false, size: Int = 100, offset: Int = 0): ScreenerResult

Searches for stocks using a custom query with the Yahoo Finance Screener API.

Link copied to clipboard
suspend fun search(query: String, quotesCount: Int = 8, newsCount: Int = 8, enableFuzzyQuery: Boolean = false): SearchResponse

Searches for symbols and news using the Yahoo Finance Search API.

Link copied to clipboard
suspend fun visualization(symbol: String, limit: Int = 12): VisualizationEarningsCalendar

Fetches earnings calendar data using the Yahoo Finance Visualization API.