Library for accessing stock market data using the Yahoo Finance API.
The fetch method requires a stock symbol followed by Modules provided as varargs.
The following example requests summaryProfile and price modules using the Yahoo Finance API.
import com.mporres.yahoofinanceapi.*;
public static void main(String[] args) {
QuoteSummary quoteSummary = YahooFinanceApi.fetch(
"AAPL",
Modules.SUMMARY_PROFILE,
Modules.PRICE);
SummaryProfile summaryProfile = quoteSummary.getResult().get(0).getSummaryProfile();
Price price = quoteSummary.getResult().get(0).getPrice();
System.out.println(price.getShortName());
System.out.println(price.getSymbol());
System.out.println(summaryProfile.getIndustry());
System.out.println(summaryProfile.getSector());
}Here is the result:
Apple Inc.
AAPL
Consumer Electronics
Technology- assetProfile
- summaryProfile
- summaryDetail
- esgScores
- price
- incomeStatementHistory
- incomeStatementHistoryQuarterly
- balanceSheetHistory
- balanceSheetHistoryQuarterly
- cashflowStatementHistory
- cashflowStatementHistoryQuarterly
- defaultKeyStatistics
- financialData
- calendarEvents
- secFilings
- recommendationTrend
- upgradeDowngradeHistory
- institutionOwnership
- fundOwnership
- majorDirectHolders
- majorHoldersBreakdown
- insiderTransactions
- insiderHolders
- netSharePurchaseActivity
- earnings
- earningsHistory
- earningsTrend
- industryTrend
- indexTrend
- sectorTrend