Fetch Data from Yahoo Finance API
Overview
Obtain historical and near real time data related to stocks, index and currencies from the Yahoo Finance API. This package is community maintained and is not officially supported by 'Yahoo'. The accuracy of data is only as correct as provided on https://finance.yahoo.com/.
Bug Fixes & Architectural Improvements
- **Financial Statements Restoration**: Added working
$get_income_statement(),$get_balance_sheet(), and$get_cash_flow()methods onTickerbacked by Yahoo'sfundamentals-timeseriesendpoint with support forfrequency = c("annual", "quarterly"). Updatedyf_get_financials()to return tidy tibbles with line items. (#48, #2) - **Unified HTTP Request Engine**: Centralized all API communication into a unified internal
api_request()helper with automatic retry, timeout, user agent header, and structured error reporting across all endpoints. (#49) - **Standardized Failure Contracts**: Multi-symbol routines (
Tickers$aggregate_data(),yf_download_prices(),yf_get_financials(),yf_get_market_stats(),yf_get_index_quotes()) consistently warn on failed symbols and return empty tibbles matching documented schemas on full failure.currency_converter(),Ticker$recommendations, andTicker$valuation_measuresunified to standard failure returns. (#50, #61) - **Batch Symbol Validation & Offline Construction**:
validate()vectorizes symbol queries into a single HTTP request. Addedvalidate = TRUEoption onTickers$new(),Index$new(), andIndex$set_index()to permit offline instantiation. (#51, #5, #61) - **Date Hygiene & Lookback Limit Enforcement**:
get_history()validates dates client-side and enforces intraday lookback boundaries (1m <= 7d, 5m/15m/30m <= 60d, 1h <= 730d). Fixedperiod = NULLlookback crash.currency_converter()guards against NA date inputs. (#52, #60) - **Robust Parsing & Transport Resilience**: Handled transport-level network errors gracefully with informative warnings. Guarded against missing or mismatched
adj_closeseries and invalid JSON payloads. (#60, #17) - **Hermetic & Live Smoke Testing**: Expanded offline mock coverage with recorded
httptest2fixtures forfundamentals-timeseriesstatements, migrated mock fixtures to short paths, and added an offline-guarded live smoke test suite. (#53, #62) - **Package Hygiene & Code Style**: Declared
R (>= 4.1)floor, removed unusedhttptestSuggests, configured.lintrwith zero remaining lints, added GitHub Actions lint workflow, updated User-Agent toyahoofinancer/<version>, and drafted the fundamental screening vignette. (#54, #57)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK, 1 FAILURE2026-06-08
- WARNING12 OK, 1 WARNING2026-06-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 14 (3 internal)includes a package overview page
- Examples that run
- 0%11 never run
- Exported functions with examples
- 92%
- Documented parameters
- 100%
- Return-value docs
- 75%
- Help pages citing references
- 0%
- Building a Live Market Dashboard with Shiny HTML
- Comparing a Portfolio of Stocks HTML
- Currency Conversion and Forex Data HTML
- Event Study: Earnings Announcements and Price Reactions HTML
- Fundamental Analysis and Stock Screening HTML
- Related-Symbol Recommendations and Technical Insights HTML
- yahoofinancer Cookbook: 15 Practical Recipes HTML
- Your First Stock Analysis with yahoofinancer HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
13 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/rsquaredacademy/yahoofinancer on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
pkgdown site last built 2026-10-17
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-04-24Named in .Rbuildignore: .claudeNamed in .gitignore: .claudePull request it wrote: opened by a project memberCommits: at least 7 crediting it in the message
- Gemini CLIfirst seen 2026-05-15Seen in the repository: GEMINI.mdNamed in .Rbuildignore: .gemini, GEMINI.mdNamed in .gitignore: .gemini, GEMINI.md
- Claude Opus 5.57 commits · Oct 2026
Dependencies
Installing yahoofinancer adds 25 packages (17 with compiled code, 9.4 MB of source tarballs). Heaviest: openssl 1.1 MB, jsonlite 1.0 MB, vctrs 1.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.6.1Latest2026-10-16 · current release · diff ↗ ··
added 4 exports
yf_download_prices, yf_get_financials, yf_get_index_quotes, yf_get_market_statslisted once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-16 07:45 UTC, so it stayed less than the time between readings. - 0.5.0
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.4.02024-11-14 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.3.02024-02-03 · diff ↗
- 0.2.0
- RR 4.3.0 released · 2023-04-21
- 0.1.02022-09-13
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2022-09-13
- Total releases
- 6 / 4 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1
- Download size
- 496 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("yahoofinancer")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.