{"id":17859904,"url":"https://github.com/hitzseb/jfinance","last_synced_at":"2026-02-26T17:03:27.362Z","repository":{"id":247852259,"uuid":"827026368","full_name":"hitzseb/jfinance","owner":"hitzseb","description":"Java library for easier interaction with the Yahoo Finance API","archived":false,"fork":false,"pushed_at":"2025-02-09T17:31:14.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T14:11:04.605Z","etag":null,"topics":["java","library","yahoo-finance-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hitzseb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-10T21:49:00.000Z","updated_at":"2025-04-02T23:58:44.000Z","dependencies_parsed_at":"2024-08-01T03:17:56.874Z","dependency_job_id":"94b470ce-bc72-4f2a-a9c8-3330c5233edd","html_url":"https://github.com/hitzseb/jfinance","commit_stats":null,"previous_names":["hitzseb/yahoo-finance-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hitzseb/jfinance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitzseb%2Fjfinance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitzseb%2Fjfinance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitzseb%2Fjfinance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitzseb%2Fjfinance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitzseb","download_url":"https://codeload.github.com/hitzseb/jfinance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitzseb%2Fjfinance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29865415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T16:38:37.846Z","status":"ssl_error","status_checked_at":"2026-02-26T16:37:58.932Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","library","yahoo-finance-api"],"created_at":"2024-10-28T07:03:55.116Z","updated_at":"2026-02-26T17:03:27.321Z","avatar_url":"https://github.com/hitzseb.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Jfinance\n\nA Java library that provides a simple interface to interact with the Yahoo Finance API and retrieve stock data. This library is inspired by the popular **yfinance** library for Python.\n\n\n### Introduction\n\n**Jfinance** offers an easy way to access Yahoo Finance data using Java. With this library, you can fetch detailed stock information, historical price data, and more. It's designed to simplify the process of integrating financial data into your Java applications.\n\n### Usage examples\n\nRetrieve detailed information about a stock:\n\n```\nStock stock = YahooFinanceAPI.getStock(\"AAPL\");\nSystem.out.println(stock);\n```\nExample output:\n```\nStock{symbol='AAPL', name='Apple Inc.', type='EQUITY', sector='Technology', industry='Consumer Electronics', exchangeName='NasdaqGS', currency='USD', longBusinessSummary='Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables, and accessories worldwide. The company offers iPhone, a line of smartphones; Mac, a line of personal computers; iPad, a line of multi-purpose tablets; and wearables, home, and accessories comprising AirPods, Apple TV, Apple Watch, Beats products, and HomePod. It also provides AppleCare support and cloud services; and operates various platforms, including the App Store that allow customers to discover and download applications and digital content, such as books, music, video, games, and podcasts, as well as advertising services include third-party licensing arrangements and its own advertising platforms. In addition, the company offers various subscription-based services, such as Apple Arcade, a game subscription service; Apple Fitness+, a personalized fitness service; Apple Music, which offers users a curated listening experience with on-demand radio stations; Apple News+, a subscription news and magazine service; Apple TV+, which offers exclusive original content; Apple Card, a co-branded credit card; and Apple Pay, a cashless payment service, as well as licenses its intellectual property. The company serves consumers, and small and mid-sized businesses; and the education, enterprise, and government markets. It distributes third-party applications for its products through the App Store. The company also sells its products through its retail and online stores, and direct sales force; and third-party cellular network carriers, wholesalers, retailers, and resellers. Apple Inc. was founded in 1976 and is headquartered in Cupertino, California.', regularMarketPrice=227.63, regularMarketChangePercent=-0.023968767, fiftyDayAverage=221.28876, twoHundredDayAverage=0.0, marketCap=3419480784896, bookValue=3.767, priceToBook=60.4274, beta=1.24, trailingPE=36.074486, forwardPE=27.392298, trailingEps=6.31, forwardEps=8.31, dividendYield=0.0042, payoutRatio=0.1571, sharesOutstanding=15022100480, enterpriseValue=3645256499200, floatShares=15091184209, sharesShort=135189465, shortRatio=2.74, shortPercentOfFloat=0.009, impliedSharesOutstanding=15390999552, netIncomeToCommon=9.3736001536E10, pegRatio=2.1068, enterpriseToRevenue=9.322, enterpriseToEbitda=27.07, totalCash=65171001344, totalDebt=119058997248, totalRevenue=391034994688, ebitda=134660997120, debtToEquity=209.059, revenuePerShare=25.485, returnOnAssets=0.21464000642299652, returnOnEquity=1.5741299, freeCashflow=110846001152, operatingCashflow=118254002176, earningsGrowth=-0.341, revenueGrowth=0.061, grossMargins=0.46206, ebitdaMargins=0.34437, operatingMargins=0.31171, profitMargins=0.23971}\n```\n\nRetrieve detailed information about multiple stocks concurrently:\n\n```\nList\u003cString\u003e symbols = Arrays.asList(\"AAPL\", \"MSFT\", \"NVDA\", \"META\", \"AMZN\", \"GOOGL\", \"TSLA\");\nList\u003cStock\u003e stocks = YahooFinanceAPI.getStocks(symbols);\nstocks.sort(Comparator.comparingLong(Stock::getMarketCap).reversed());\nstocks.forEach(stock -\u003e System.out.println(\"Stock: \" + stock.getSymbol() + \", Market Cap: \" + stock.getMarketCap()));\n```\nExample output:\n```\nStock: AAPL, Market Cap: 3419480784896\nStock: NVDA, Market Cap: 3179781554176\nStock: MSFT, Market Cap: 3046073171968\nStock: AMZN, Market Cap: 2428462694400\nStock: GOOGL, Market Cap: 2269191602176\nStock: META, Market Cap: 1810350735360\nStock: TSLA, Market Cap: 1163157962752\n```\n\nRetrieve historical price data for a stock in a specified period. The expected arguments are:\n`symbol, period1, period2` and optionally you can add a `timezone` as fourth argument.\n\nValid Intervals:\n- \"1m\", \"2m\", \"5m\", \"15m\", \"30m\", \"60m\", \"90m\", \"1h\", \"1d\", \"5d\", \"1wk\", \"1mo\", \"3mo\"\n\n```\nChart chart = YahooFinanceAPI.getChartByRange(\"AAPL\", \"1h\", \"1d\");\nSystem.out.println(YahooFinanceAPI.buildTable(chart));\n```\nExample output:\n```\nDate                 Open       High       Low        Close      Volume    \n--------------------------------------------------------------------------------------\n2024-10-25 10:30     229,74     232,43     229,57     232,13     8235944   \n2024-10-25 11:30     232,12     233,20     232,12     232,23     4138746   \n2024-10-25 12:30     232,23     232,73     231,76     232,71     3211126   \n2024-10-25 13:30     232,74     232,94     231,53     231,86     2367087   \n2024-10-25 14:30     231,83     231,97     231,07     231,84     2818009   \n2024-10-25 15:30     231,85     232,20     231,37     231,62     2642893   \n2024-10-25 16:30     231,65     231,80     231,11     231,40     3572932   \n2024-10-25 17:00     231,41     231,41     231,41     231,41     0         \n```\n\nRetrieve historical price data for a stock up to a specified range. The expected arguments are:\n`symbol, interval, range` and optionally you can add a `timezone` as fourth argument.\n\nValid Ranges:\n- \"1d\", \"5d\", \"1mo\", \"3mo\", \"6mo\", \"1y\", \"2y\", \"5y\", \"10y\", \"ytd\", \"max\"\n\n```\nChart chart = YahooFinanceAPI.getChartByPeriod(\"AAPL\", \"5d\", \"2024-03-01\", \"2024-04-01\");\nSystem.out.println(TableBuilder.buildFromChart(chart));\n```\nExample output:\n```\nDate                 Open       High       Low        Close      Adj Close  Volume    \n--------------------------------------------------------------------------------------\n2024-03-01           179,55     180,53     177,38     179,66     179,42     73488000  \n2024-03-06           171,06     171,24     168,68     169,12     168,89     68587700  \n2024-03-11           172,94     174,38     172,05     172,75     172,52     60139500  \n2024-03-21           177,05     177,49     170,84     171,37     171,14     106181300 \n2024-03-26           170,00     171,42     169,58     169,71     169,48     57388400  \n```\n\nRetrieve historical price data for multiple stocks concurrently:\n\n```\nList\u003cString\u003e symbols = Arrays.asList(\"AAPL\", \"MSFT\", \"NVDA\", \"META\", \"AMZN\", \"GOOGL\", \"TSLA\");\nList\u003cChart\u003e charts = YahooFinanceAPI.getChartsByRange(symbols, \"1d\", \"1d\");\nSystem.out.println(charts);\n```\nExample output:\n```\n[Chart{symbol='AAPL', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[229.57000732421875], volume=[38776700], open=[229.74000549316406], high=[233.22000122070312], close=[231.41000366210938]}], adjclose=[AdjClose{adjclose=[231.41000366210938]}]}}, Chart{symbol='MSFT', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[426.57000732421875], volume=[16888400], open=[426.760009765625], high=[432.5199890136719], close=[428.1499938964844]}], adjclose=[AdjClose{adjclose=[428.1499938964844]}]}}, Chart{symbol='NVDA', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[140.8000030517578], volume=[204182400], open=[140.92999267578125], high=[144.1300048828125], close=[141.5399932861328]}], adjclose=[AdjClose{adjclose=[141.5399932861328]}]}}, Chart{symbol='META', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[571.719970703125], volume=[11318300], open=[573.9299926757812], high=[581.2899780273438], close=[573.25]}], adjclose=[AdjClose{adjclose=[573.25]}]}}, Chart{symbol='AMZN', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[187.52999877929688], volume=[29310400], open=[187.85000610351562], high=[190.4499969482422], close=[187.8300018310547]}], adjclose=[AdjClose{adjclose=[187.8300018310547]}]}}, Chart{symbol='GOOGL', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[163.4199981689453], volume=[19805000], open=[163.6699981689453], high=[165.58999633789062], close=[165.27000427246094]}], adjclose=[AdjClose{adjclose=[165.27000427246094]}]}}, Chart{symbol='TSLA', currency='USD', exchangeTimezoneName='America/New_York', timestamp=[2024-10-25], indicators=Indicators{quote=[Quote{low=[255.32000732421875], volume=[161061400], open=[256.010009765625], high=[269.489990234375], close=[269.19000244140625]}], adjclose=[AdjClose{adjclose=[269.19000244140625]}]}}]\n```\n\n### Java Version\n\n- **Java 11** or later\n\nThis project is developed with Java 11, and it is compatible with any subsequent version of Java due to its backward compatibility.\n\n\n### Required libraries\n\n- Jackson Databind\n- Jsoup\n\nMaven:\n```\n\u003c!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fasterxml.jackson.core\u003c/groupId\u003e\n    \u003cartifactId\u003ejackson-databind\u003c/artifactId\u003e\n    \u003cversion\u003e2.17.1\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003c!-- https://mvnrepository.com/artifact/org.jsoup/jsoup --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.jsoup\u003c/groupId\u003e\n    \u003cartifactId\u003ejsoup\u003c/artifactId\u003e\n    \u003cversion\u003e1.18.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Contributing\n\nContributions are welcome. If you find a bug or have a suggestion for an improvement, please open an issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitzseb%2Fjfinance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitzseb%2Fjfinance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitzseb%2Fjfinance/lists"}