| Title: | European UCITS ETF Data Collection |
|---|---|
| Description: | Tools to fetch, clean, and store historical and metadata for European bond and equity index ETFs (UCITS) listed on the London Stock Exchange. |
| Authors: | John Gavin [aut, cre] |
| Maintainer: | John Gavin <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-23 08:35:07 UTC |
| Source: | https://github.com/JohnGavin/etf-data |
Retrieves historical fund holdings (composition) for a given ETF ticker using tidyquant. This includes top holdings, sector weights, and asset allocation data.
fetch_etf_holdings(symbol)fetch_etf_holdings(symbol)
symbol |
Character string. The ticker symbol of the ETF (e.g., "SPY"). |
A tibble containing holding details. Returns NULL or empty tibble on failure.
## Not run: fetch_etf_holdings("SPY") ## End(Not run)## Not run: fetch_etf_holdings("SPY") ## End(Not run)
Fetches metadata (AUM, TER, etc.) for a given ETF ticker from the Yahoo Finance API.
fetch_etf_metadata(symbol)fetch_etf_metadata(symbol)
symbol |
Character string. The Yahoo Finance ticker symbol of the ETF (e.g., "VUSA.L"). |
A tibble with metadata columns. Returns an empty tibble with the symbol if fetching fails.
## Not run: fetch_etf_metadata("VUSA.L") ## End(Not run)## Not run: fetch_etf_metadata("VUSA.L") ## End(Not run)
Scrapes metadata (AUM, TER, etc.) for a given ETF ISIN from JustETF.
fetch_justetf_metadata(isin)fetch_justetf_metadata(isin)
isin |
Character string. The ISIN of the ETF (e.g., "IE00B3XXRP09"). |
A tibble with metadata columns.
## Not run: fetch_etf_metadata("IE00B3XXRP09") ## End(Not run)## Not run: fetch_etf_metadata("IE00B3XXRP09") ## End(Not run)
Retrieves a list of ETFs from JustETF, applying optional filters for AUM and TER. The function first tries the legacy JSON API, then falls back to the JustETF search table endpoint if needed.
fetch_justetf_screener( min_aum_gbp = 0, max_ter = Inf, page_size = 500, max_pages = Inf, source = c("auto", "api", "wicket"), quiet = FALSE )fetch_justetf_screener( min_aum_gbp = 0, max_ter = Inf, page_size = 500, max_pages = Inf, source = c("auto", "api", "wicket"), quiet = FALSE )
min_aum_gbp |
Numeric. Minimum Assets Under Management in GBP (millions). Default is 0. |
max_ter |
Numeric. Maximum Total Expense Ratio (percentage). Default is Inf. |
page_size |
Integer. Number of rows per page when paging the table endpoint. |
max_pages |
Integer. Maximum number of pages to fetch when paging. Default Inf. |
source |
Character. Data source preference: "auto", "api", or "wicket". |
quiet |
Logical. If TRUE, suppresses warnings when endpoints fail. |
A tibble containing the filtered ETF data.
## Not run: etfs <- fetch_justetf_screener() print(etfs) ## End(Not run)## Not run: etfs <- fetch_justetf_screener() print(etfs) ## End(Not run)
Retrieves daily OHLCV data for a given ticker using quantmod/Yahoo.
fetch_price_history(ticker, start_date = "2020-01-01", end_date = Sys.Date())fetch_price_history(ticker, start_date = "2020-01-01", end_date = Sys.Date())
ticker |
Character string. The ticker symbol (e.g., "VUSA.L"). |
start_date |
Date or character. Start date (default "2020-01-01"). |
end_date |
Date or character. End date (default Sys.Date()). |
A tibble with Date, Open, High, Low, Close, Volume, Adjusted columns.
## Not run: fetch_price_history("VUSA.L") ## End(Not run)## Not run: fetch_price_history("VUSA.L") ## End(Not run)
Retrieves the list of ETFs to track. Prefers the curated universe file when available, then falls back to the cached snapshot or seed list.
get_etf_universe(n = 20, live = FALSE, file = NULL)get_etf_universe(n = 20, live = FALSE, file = NULL)
n |
Integer. Maximum number of ETFs to return. Default is 20. Set to Inf for all. |
live |
Logical. If TRUE, attempts to fetch the latest universe from an external source. |
file |
Character. Path to a local CSV file to read the universe from. Overrides |
A tibble with columns: ticker, name, isin, currency
## Not run: get_etf_universe() # Returns top 20 get_etf_universe(n = 5) get_etf_universe(n = Inf) # Returns all get_etf_universe(file = "my_etfs.csv") ## End(Not run)## Not run: get_etf_universe() # Returns top 20 get_etf_universe(n = 5) get_etf_universe(n = Inf) # Returns all get_etf_universe(file = "my_etfs.csv") ## End(Not run)
Converts an AUM (Assets Under Management) string (e.g., "GBP 100,642 m") into structured components.
parse_aum(aum_text)parse_aum(aum_text)
aum_text |
Character vector. The AUM string(s) to parse. |
A tibble with columns: currency (factor), aum_amount (numeric), aum_units (factor), aum_units_amount (numeric).
parse_aum("GBP 100,642 m")parse_aum("GBP 100,642 m")