| get_price_historyA | Get historical adjusted closing prices for one or more tickers. Prices are adjusted for splits and dividends. Series longer than 400
points are thinned evenly (first and last kept, `thinned: true`); use a
coarser interval for full data. For statistics, prefer
get_performance_stats / analyze_portfolio_risk over computing from this.
Args:
tickers: Yahoo symbols, e.g. ["AAPL", "ASML.AS", "VWCE.DE"].
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest value.
interval: "1d", "1wk" or "1mo".
base_currency: Optional ISO code (e.g. "EUR") to convert all prices
into with daily FX; default is each listing's own currency.
Returns:
Per ticker: first/last date, last price, points, `thinned` and
`prices` by date; or an error dict.
|
| search_symbolA | Find ticker candidates for a company/ETF name, partial ticker or ISIN. The same security often trades on several exchanges (e.g. ASML on NASDAQ
and Euronext Amsterdam), so when more than one candidate is plausible,
ASK THE USER which listing/exchange/currency they hold. For European ETFs
by ISIN, resolve_instrument gives exchange-accurate tickers.
Args:
query: Name, ticker fragment or ISIN.
max_results: Maximum candidates (1-25).
Returns:
`candidates` (symbol, name, type, exchange, sector) and a `note`.
|
| get_symbol_infoB | Name, exchange, currency, type, sector/industry and country of a ticker. Args:
ticker: Yahoo symbol, e.g. "ASML.AS".
Returns:
The known fields (empty ones left out), or an error dict.
|
| get_etf_sector_allocationA | Sector allocation (% by sector) of an ETF or fund, from Yahoo. Yahoo coverage of European UCITS ETFs is patchy: for those, prefer
get_etf_exposure (justETF, by ISIN).
Args:
ticker: Yahoo symbol of the fund, e.g. "SPY", "IWDA.AS".
Returns:
`sector_allocation_pct` by sector, largest first; or an error dict.
|
| get_etf_holdingsA | Top holdings of an ETF with each company's % weight, from Yahoo. Yahoo usually exposes only the top ~10 holdings; `total_pct_covered`
shows how much of the fund that is. For UCITS ETFs and portfolio-level
overlap, prefer get_etf_exposure / analyze_portfolio (justETF, by ISIN).
Args:
ticker: Yahoo symbol of the fund, e.g. "QQQ", "IWDA.AS".
Returns:
`holdings` (symbol, name, weight_pct) and `total_pct_covered`; or an
error dict.
|
| get_quoteA | Latest price, previous close, day change, currency and exchange. Data may be delayed (up to ~15-20 min). `currency` is as Yahoo reports
it: "GBp" means pence (divide by 100 for GBP).
Args:
tickers: Yahoo symbols, e.g. ["IWDA.AS", "VWRL.L", "AAPL"].
Returns:
`as_of` and per ticker price, previous close, change %, currency and
exchange (or an error entry).
|
| get_fx_ratesA | Latest FX rates into a base currency (and the change since start_date). Rate = units of base_currency per 1 unit of the currency, e.g. with base
EUR, USD -> 0.92 means 1 USD = 0.92 EUR. Minor units are accepted
("GBp" is converted as GBP / 100).
Args:
currencies: ISO codes, e.g. ["USD", "GBP", "CHF"].
base_currency: ISO code to express rates in. Default EUR.
start_date: Optional YYYY-MM-DD to also return the % change since then.
Returns:
`base_currency` and per currency `rate` and `date` (plus
`start_rate` and `change_since_start_pct` with start_date).
|
| get_performance_statsA | Return and risk statistics per ticker, optionally vs a benchmark. Total and annualised return (annualised only for windows >= 1 year),
annualised volatility, Sharpe, Sortino, Calmar, max drawdown with peak /
trough / recovery dates, best and worst period. With `benchmark`: beta,
alpha, correlation, tracking error and information ratio. Uses adjusted
closes (dividends reinvested). Each ticker uses its own available window,
so check `from`/`to` before comparing; for a portfolio use
analyze_portfolio_risk.
Args:
tickers: Yahoo symbols.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest value.
interval: Return frequency: "1d", "1wk" or "1mo".
base_currency: Optional ISO code to measure everything in (e.g. "EUR"
for a euro investor holding USD assets); default local currency.
risk_free_rate_pct: Annual risk-free rate in %, for Sharpe/Sortino.
benchmark: Optional Yahoo symbol to compare against, e.g. "IWDA.AS".
Returns:
`stats` per ticker (with `vs_benchmark` when given), the currency used
and any `warnings`; or an error dict.
|
| get_correlationA | Correlation matrix of returns between 2+ tickers (default weekly). Exchange holidays are forward-filled and only the common window is used.
Without `base_currency`, each series is in its own currency, so FX moves
affect the result; set e.g. base_currency="EUR" to measure as a euro
investor experiences it.
Args:
tickers: 2 or more Yahoo symbols.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive).
interval: "1d", "1wk" or "1mo".
base_currency: Optional ISO code to convert all prices into first.
Returns:
The `correlation` matrix with its window and observations, plus
`missing` tickers and `warnings`; or an error dict.
|
| get_dividendsA | Dividend payments per share for a ticker, plus a trailing-12-month total. Amounts are per share as Yahoo reports them; this can be the fund's
distribution currency rather than the listing's trading currency (e.g. a
USD-distributing ETF listed in GBP), so check before computing a yield.
Args:
ticker: Yahoo symbol.
start_date: YYYY-MM-DD. Defaults to 2020-01-01.
end_date: YYYY-MM-DD (exclusive).
Returns:
`dividends` by date in the range with their `total` and `count`, plus
`trailing_12m_total` and `payments_last_12m`; or an error dict.
|
| search_etfA | Find an ETF's ISIN from its name, ticker or index (use this first). Accepts e.g. "iShares Core MSCI World", "IWDA", "vanguard all world acc"
or an ISIN. Returns matches with ISIN, name and tickers. Yahoo Finance is
used as a fallback for fuzzy names; hits that cannot be mapped to an ISIN
come back in `unresolved_candidates` (isin null). Accumulating vs
distributing and hedged variants look alike: if several matches are
plausible, ASK THE USER which one they hold. All other justETF tools
need the ISIN.
Args:
query: Fund name, ticker, index name or ISIN.
max_results: Maximum matches to return.
use_yahoo: Also query Yahoo Finance when the registry has no full match.
Returns:
`matches` with ISIN, name, tickers and match type; optional
`unresolved_candidates`; a `note` on what to do next.
|
| get_etf_profileA | Key facts about an ETF from justETF, looked up by ISIN. Example ISIN: IE00B4L5Y983 (iShares Core MSCI World, Acc).
Args:
isin: ETF ISIN (12 characters).
refresh: Bypass the 24h cache and re-download the page.
Returns:
Name, ticker, TER (% p.a.), fund size, distribution policy
(accumulating/distributing), replication, index, fund currency and
currency hedging, domicile, provider, inception date, number of
holdings, legal structure, tax status per country, securities
lending and a description; or an `error`.
|
| get_etf_exposureA | Country, sector and top-10 holdings breakdown of one ETF (justETF). justETF lists the largest ~10 countries and ~13 sectors; the remainder
is reported as "Other". Top holdings are limited to the top 10.
Args:
isin: ETF ISIN.
section: "countries", "sectors", "holdings" or "all".
refresh: Bypass the 24h cache.
Returns:
The requested breakdowns with weights in %, the as-of date and
warnings; or an `error`.
|
| get_etf_performanceA | Returns and risk of an ETF from justETF. Returns are in the currency named in `currency` (EUR by default).
Past performance does not predict future results.
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
`performance`: period returns (YTD, 1m, 3m, 6m, 1y, 3y, 5y, since
inception) and calendar-year returns; `risk`: volatility (1/3/5y),
return per risk and maximum drawdown. Or an `error`.
|
| get_etf_listingsA | Exchanges where an ETF trades: currency, ticker, Bloomberg/Reuters codes. Useful to find the ticker for a specific exchange (e.g. XETRA vs London).
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
`listings`, one per exchange; or an `error`.
|
| get_similar_etfsA | ETFs on the same index (justETF's "further ETFs") with size, TER, policy. Good for "is there a cheaper ETF tracking the same index?".
Args:
isin: ETF ISIN.
refresh: Bypass the 24h cache.
Returns:
The index, this ETF's TER and size, and `similar_etfs`; or an `error`.
|
| compare_etfsA | Side-by-side comparison of up to 15 ETFs by ISIN. Args:
isins: List of ETF ISINs.
refresh: Bypass the 24h cache.
Returns:
`etfs`: one row each with cost (TER), fund size, distribution,
replication, domicile, index, currency, hedging, inception,
returns, volatility and holdings count; the `cheapest` and
`largest` ISIN; per-ISIN `errors`.
|
| analyze_portfolioA | Analyse a list of ETFs: cost, fund size, structure and look-through exposure. Give each position as {"isin": "...", "amount": 5000}. `amount` is the
money (any currency, used for weights and yearly cost) or a weight; give
it for every position or for none (equal weights). Use
`focus_countries` / `focus_sectors` (e.g. ["United States"],
["Technology"]) to get only those buckets. Named buckets are lower
bounds: justETF lumps the tail into "Other".
Args:
positions: List of {"isin": str, "amount": number (optional)}.
top_n: Buckets to return per breakdown when no focus is given.
focus_countries: Only return countries containing one of these names.
focus_sectors: Only return sectors containing one of these names.
refresh: Bypass the 24h cache.
Returns:
Weighted TER and yearly fees, fund size per ETF (with small-fund
flags), portfolio share by distribution/replication/domicile/
currency/provider/index, and combined exposure by country, sector
and top stocks with each ETF's contribution; or an `error`.
|
| resolve_instrumentA | ISIN -> Yahoo Finance tickers, best listing first. Use this to go from an ISIN (broker statement, KID, justETF) to a
symbol for the Yahoo tools. ETFs are mapped from their exchange
listings on justETF (XETRA -> .DE, Euronext Amsterdam -> .AS, London
-> .L, SIX -> .SW, ...); other ISINs (e.g. single stocks) fall back to
Yahoo search. Listings in `base_currency` rank first, then the most
liquid exchanges. Venues Yahoo lacks (gettex, Tradegate) are listed
under `unmapped_listings`. If the user holds a specific listing,
use that one.
Args:
isin: 12-character ISIN, e.g. IE00B4L5Y983.
base_currency: Optional ISO code to prefer listings trading in it.
Returns:
`yahoo_candidates` best first, the `source` used and any
`unmapped_listings`; or an error dict.
|
| analyze_portfolio_riskA | Risk and return of a whole portfolio, measured in one base currency. Positions can be stocks or ETFs, given by Yahoo symbol or ISIN, sized
by quantity (shares) or current value (in base currency); with
neither, positions are equally weighted. Prices are converted to the
base currency with daily FX (pence-quoted London listings handled),
put on a common calendar, and analysed. Use analyze_portfolio
(justETF) for cost and country/sector/stock look-through of ETFs.
Example positions: [{"isin": "IE00B4L5Y983", "value": 30000},
{"symbol": "ASML.AS", "quantity": 10}, {"symbol": "AAPL", "quantity": 25}]
Args:
positions: Up to 30 holdings: {symbol | isin, quantity | value}.
base_currency: ISO code of the investor's currency. Default EUR.
benchmark: Optional Yahoo symbol, e.g. "IWDA.AS" or "^GSPC".
start_date: YYYY-MM-DD. Defaults to 3 years before end_date.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest data.
interval: Return frequency. Default "1wk": daily returns across
regions (US vs Europe) understate correlation and beta because
the markets close hours apart.
method: "current_holdings" (today's units held throughout) or
"constant_weights" (rebalanced to today's weights each period).
risk_free_rate_pct: Annual risk-free rate in %, e.g. 2.0.
Returns:
Total value and weights; portfolio return, volatility,
Sharpe/Sortino/Calmar, max drawdown (dates); vs `benchmark` beta,
alpha, tracking error, information ratio; per position return,
volatility, beta and share of portfolio risk; correlation matrix;
diversification ratio; how ISINs were resolved; FX rates used;
warnings (short histories, stale quotes, bad Yahoo prices
removed). Or an error dict.
|