This module allows you to fetch ticker data from Yahoo! Finance®. At the moment you can fetch data on the financials of a stock ticker as well as the historical ticker price. More functions are coming soon!
Summary
Functions
Get the balance sheet history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Same as balance_sheet/2 except raise on error.
Get the cash flow history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Same as cash_flow/2 except raise on error.
Get the OHLCV history for a provided stock symbol given a start and end date. The result is
an Explorer.DataFrame struct.
Same as history/2 except raise on error.
Get the entire OHLCV history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Same as history_max/2 except raise on error.
Get the income statement history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Same as income_statement/2 except raise on error.
Types
@type result() :: {:ok, Explorer.DataFrame.t()} | {:error, term()}
Functions
Get the balance sheet history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Examples
iex> {:ok, data_frame} =
...> Yfinance.Ticker.balance_sheet("aapl", :quarterly)
iex> %Explorer.DataFrame{} = data_frame
@spec balance_sheet!(symbol :: String.t(), frequency :: :yearly | :quarterly) :: Explorer.DataFrame.t()
Same as balance_sheet/2 except raise on error.
Get the cash flow history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Examples
iex> {:ok, data_frame} =
...> Yfinance.Ticker.cash_flow("aapl", :quarterly)
iex> %Explorer.DataFrame{} = data_frame
@spec cash_flow!(symbol :: String.t(), frequency :: :yearly | :quarterly) :: Explorer.DataFrame.t()
Same as cash_flow/2 except raise on error.
@spec history( symbol :: String.t(), state_date :: Date.t(), end_date :: Date.t(), opts :: keyword() ) :: result()
Get the OHLCV history for a provided stock symbol given a start and end date. The result is
an Explorer.DataFrame struct.
Options
:actions(boolean/0) - Whether to include dividends and stock splits.:auto_adjust(boolean/0) - Whether to adjust OHLC for splits.:prepost(boolean/0) - Whether to include pre/post market data.
Examples
iex> {:ok, data_frame} =
...> Yfinance.Ticker.history("aapl", Date.shift(Date.utc_today(), month: -1), Date.utc_today())
iex> %Explorer.DataFrame{} = data_frame
iex> {:error, %Yfinance.Error{type: :option_error}} =
...> Yfinance.Ticker.history(
...> "aapl",
...> Date.shift(Date.utc_today(), month: -1),
...> Date.utc_today(),
...> actions: "BAD_INPUT"
...> )
@spec history!( symbol :: String.t(), state_date :: Date.t(), end_date :: Date.t(), opts :: keyword() ) :: Explorer.DataFrame.t()
Same as history/2 except raise on error.
Get the entire OHLCV history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Options
:actions(boolean/0) - Whether to include dividends and stock splits.:auto_adjust(boolean/0) - Whether to adjust OHLC for splits.:prepost(boolean/0) - Whether to include pre/post market data.
Examples
iex> {:ok, data_frame} =
...> Yfinance.Ticker.history_max("aapl")
iex> %Explorer.DataFrame{} = data_frame
iex> {:error, %Yfinance.Error{type: :option_error}} =
...> Yfinance.Ticker.history_max(
...> "aapl",
...> actions: "BAD_INPUT"
...> )
@spec history_max!( symbol :: String.t(), opts :: keyword() ) :: Explorer.DataFrame.t()
Same as history_max/2 except raise on error.
Get the income statement history for a provided stock symbol. The result is
an Explorer.DataFrame struct.
Examples
iex> {:ok, data_frame} =
...> Yfinance.Ticker.income_statement("aapl", :quarterly)
iex> %Explorer.DataFrame{} = data_frame
@spec income_statement!(symbol :: String.t(), frequency :: :yearly | :quarterly) :: Explorer.DataFrame.t()
Same as income_statement/2 except raise on error.