The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

hist

GitHub Actions codecov

Overview

yfhist is a package that provides simple and efficient access to Yahoo Finance’s historical data API (/v8/finance/chart/{symbol}) for querying and retrieval of financial data.

The core functionality of the yfhist package abstracts the complexities of interacting with Yahoo Finance APIs, such as session management, crumb and cookie handling, query construction, date validation, and interval management. This abstraction allows users to focus on retrieving data rather than managing API details. Use cases include historical data across a range of security types:

The package supports flexible query capabilities, including customizable date ranges, multiple time intervals, and automatic data validation. It automatically manages interval-specific limitations, such as lookback periods for intraday data and maximum date ranges for minute-level intervals.

The implementation leverages standard HTTP libraries to handle API interactions efficiently and provides support for both R and Python to ensure accessibility for a broad audience.

Installation

install.packages("yfhist")
# install.packages("devtools")
devtools::install_github("jasonjfoster/hist/r")

Usage

First, load the package and explore the available interval options:

library(yfhist)

print(data_intervals)

Then, to retrieve historical data, use the the get_data function:

data <- get_data(c("AAPL", "MSFT"))

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.