Pure Clojure Yahoo Finance client using Java HttpClient. No Python dependency, no API key required.
Provides access to:
Note: Financial statements, options data, and comprehensive fundamentals require Yahoo's authenticated endpoints which are currently blocked. For these features, consider using AlphaVantage, Financial Modeling Prep, or other dedicated financial data APIs.
Pure Clojure Yahoo Finance client using Java HttpClient. No Python dependency, no API key required. Provides access to: - Current prices (single and parallel fetch) - Historical OHLCV data with full customization - Dividends and stock splits - Basic ticker information and metadata Note: Financial statements, options data, and comprehensive fundamentals require Yahoo's authenticated endpoints which are currently blocked. For these features, consider using AlphaVantage, Financial Modeling Prep, or other dedicated financial data APIs.
(fetch-dividends-splits ticker & {:keys [period start end] :or {period "5y"}})Fetch dividend and split events for a ticker. Returns {:dividends ... :splits ...} or empty maps on failure.
Options: :period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 5y) :start - Epoch seconds (integer) or Instant (overrides :period) :end - Epoch seconds (integer) or Instant (requires :start; defaults to now)
Fetch dividend and split events for a ticker. Returns {:dividends ... :splits ...} or empty maps on failure.
Options:
:period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 5y)
:start - Epoch seconds (integer) or Instant (overrides :period)
:end - Epoch seconds (integer) or Instant (requires :start; defaults to now)(fetch-dividends-splits* ticker & {:keys [period start end] :or {period "5y"}})Fetch dividend and split events for a ticker. Returns structured result {:ok? true :data {:dividends ... :splits ...}} or {:ok? false :error {...}}.
Options: :period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 5y) :start - Epoch seconds (integer) or Instant (overrides :period) :end - Epoch seconds (integer) or Instant (requires :start; defaults to now)
Fetch dividend and split events for a ticker. Returns structured result {:ok? true :data {:dividends ... :splits ...}} or {:ok? false :error {...}}.
Options:
:period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 5y)
:start - Epoch seconds (integer) or Instant (overrides :period)
:end - Epoch seconds (integer) or Instant (requires :start; defaults to now)(fetch-historical ticker
&
{:keys [period interval start end adjusted prepost]
:or {period "1y" interval "1d" adjusted true prepost false}})Fetch historical OHLCV data for a ticker. Returns vector of maps, empty on failure.
Options: :period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 1y) :interval - 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default 1d) :start - Epoch seconds (integer) or Instant (overrides :period) :end - Epoch seconds (integer) or Instant (requires :start; defaults to now) :adjusted - Include adjusted close (default true) :prepost - Include pre/post market data (default false)
Note: For dividend/split events, use fetch-dividends-splits instead.
Fetch historical OHLCV data for a ticker. Returns vector of maps, empty on failure. Options: :period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 1y) :interval - 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default 1d) :start - Epoch seconds (integer) or Instant (overrides :period) :end - Epoch seconds (integer) or Instant (requires :start; defaults to now) :adjusted - Include adjusted close (default true) :prepost - Include pre/post market data (default false) Note: For dividend/split events, use fetch-dividends-splits instead.
(fetch-historical* ticker
&
{:keys [period interval start end adjusted prepost]
:or
{period "1y" interval "1d" adjusted true prepost false}})Fetch historical OHLCV data for a ticker. Returns structured result {:ok? true :data [...] :request {...} :warnings [...]} or {:ok? false :error {...}}.
Options: :period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 1y) :interval - 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default 1d) :start - Epoch seconds (integer) or Instant (overrides :period) :end - Epoch seconds (integer) or Instant (requires :start; defaults to now) :adjusted - Include adjusted close (default true) :prepost - Include pre/post market data (default false)
Validation behavior:
Note: For dividend/split events, use fetch-dividends-splits* instead.
Fetch historical OHLCV data for a ticker. Returns structured result {:ok? true :data [...] :request {...} :warnings [...]} or {:ok? false :error {...}}.
Options:
:period - 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max (default 1y)
:interval - 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo (default 1d)
:start - Epoch seconds (integer) or Instant (overrides :period)
:end - Epoch seconds (integer) or Instant (requires :start; defaults to now)
:adjusted - Include adjusted close (default true)
:prepost - Include pre/post market data (default false)
Validation behavior:
- Invalid values (period/interval not in allowed sets, :end without :start, start > end)
are rejected immediately with :invalid-opts error
- Valid but incompatible combinations (e.g., 1m interval with 1mo period exceeding 7-day limit)
generate warnings in :warnings key but don't fail—Yahoo's API will reject truly invalid requests
Note: For dividend/split events, use fetch-dividends-splits* instead.(fetch-info ticker)Fetch basic ticker information and metadata. Returns map or nil on failure.
Returns a map with available company info including:
Note: This is basic info from the chart endpoint. For comprehensive company info (P/E ratio, market cap, EPS, sector, industry, description), Yahoo's quoteSummary endpoint is required but currently blocked by authentication requirements. Consider using AlphaVantage or FMP for comprehensive fundamentals.
Fetch basic ticker information and metadata. Returns map or nil on failure. Returns a map with available company info including: - :symbol, :long-name, :short-name - :currency, :exchange-name, :instrument-type - :regular-market-price, :regular-market-volume - :regular-market-day-high, :regular-market-day-low - :fifty-two-week-high, :fifty-two-week-low - :timezone, :gmt-offset Note: This is basic info from the chart endpoint. For comprehensive company info (P/E ratio, market cap, EPS, sector, industry, description), Yahoo's quoteSummary endpoint is required but currently blocked by authentication requirements. Consider using AlphaVantage or FMP for comprehensive fundamentals.
(fetch-info* ticker)Fetch basic ticker information and metadata. Returns structured result {:ok? true :data {...}} or {:ok? false :error {...}}.
Returns a map with available company info including:
Note: This is basic info from the chart endpoint. For comprehensive company info (P/E ratio, market cap, EPS, sector, industry, description), Yahoo's quoteSummary endpoint is required but currently blocked by authentication requirements. Consider using AlphaVantage or FMP for comprehensive fundamentals.
Fetch basic ticker information and metadata. Returns structured result {:ok? true :data {...}} or {:ok? false :error {...}}.
Returns a map with available company info including:
- :symbol, :long-name, :short-name
- :currency, :exchange-name, :instrument-type
- :regular-market-price, :regular-market-volume
- :regular-market-day-high, :regular-market-day-low
- :fifty-two-week-high, :fifty-two-week-low
- :timezone, :gmt-offset
Note: This is basic info from the chart endpoint. For comprehensive
company info (P/E ratio, market cap, EPS, sector, industry, description),
Yahoo's quoteSummary endpoint is required but currently blocked by
authentication requirements. Consider using AlphaVantage or FMP for
comprehensive fundamentals.(fetch-price ticker)Fetch current price for a single ticker. Returns price number or nil on failure.
Fetch current price for a single ticker. Returns price number or nil on failure.
(fetch-price* ticker)Fetch current price for a single ticker. Returns structured result {:ok? true :data price} or {:ok? false :error {...}}.
Fetch current price for a single ticker. Returns structured result {:ok? true :data price} or {:ok? false :error {...}}.
(fetch-prices tickers & {:keys [concurrency] :or {concurrency 8}})Fetch prices for multiple tickers in parallel. Returns {ticker price} map, omitting failures.
Options: :concurrency - Maximum number of concurrent requests (default 8)
Fetch prices for multiple tickers in parallel. Returns {ticker price} map, omitting failures.
Options:
:concurrency - Maximum number of concurrent requests (default 8)(fetch-prices* tickers & {:keys [concurrency] :or {concurrency 8}})Fetch prices for multiple tickers in parallel with bounded concurrency. Returns {ticker {:ok? ... :data/:error ...}} map.
Options: :concurrency - Maximum number of concurrent requests (default 8)
Fetch prices for multiple tickers in parallel with bounded concurrency.
Returns {ticker {:ok? ... :data/:error ...}} map.
Options:
:concurrency - Maximum number of concurrent requests (default 8)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |