> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Yfinance

> YFinanceTools give an agent access to stock prices, fundamentals, and analyst data from Yahoo Finance.

**YFinanceTools** enable an Agent to access stock data, financial information and more from Yahoo Finance.

## Prerequisites

The following example requires the `yfinance` and `openai` libraries.

```shell theme={null}
uv pip install -U yfinance openai
```

## Example

The following agent will provide information about the stock price and analyst recommendations for NVDA (Nvidia Corporation).

```python cookbook/91_tools/yfinance_tools.py theme={null}
from agno.agent import Agent
from agno.tools.yfinance import YFinanceTools

agent = Agent(
    tools=[YFinanceTools(all=True)],
    description="You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",
    instructions=["Format your response using markdown and use tables to display data where possible."],
)
agent.print_response("Share the NVDA stock price and analyst recommendations", markdown=True)
```

## Toolkit Params

Only `get_current_stock_price` is enabled by default. Enable the rest individually or pass `all=True`.

| Parameter                        | Type            | Default | Description                                        |
| -------------------------------- | --------------- | ------- | -------------------------------------------------- |
| `enable_stock_price`             | `bool`          | `True`  | Enable the get\_current\_stock\_price function     |
| `enable_company_info`            | `bool`          | `False` | Enable the get\_company\_info function             |
| `enable_stock_fundamentals`      | `bool`          | `False` | Enable the get\_stock\_fundamentals function       |
| `enable_income_statements`       | `bool`          | `False` | Enable the get\_income\_statements function        |
| `enable_key_financial_ratios`    | `bool`          | `False` | Enable the get\_key\_financial\_ratios function    |
| `enable_analyst_recommendations` | `bool`          | `False` | Enable the get\_analyst\_recommendations function  |
| `enable_company_news`            | `bool`          | `False` | Enable the get\_company\_news function             |
| `enable_technical_indicators`    | `bool`          | `False` | Enable the get\_technical\_indicators function     |
| `enable_historical_prices`       | `bool`          | `False` | Enable the get\_historical\_stock\_prices function |
| `all`                            | `bool`          | `False` | Enable all functions                               |
| `session`                        | `Optional[Any]` | `None`  | Custom requests session passed to yfinance         |

## Toolkit Functions

| Function                      | Description                                                      |
| ----------------------------- | ---------------------------------------------------------------- |
| `get_current_stock_price`     | This function retrieves the current stock price of a company.    |
| `get_company_info`            | This function retrieves detailed information about a company.    |
| `get_historical_stock_prices` | This function retrieves historical stock prices for a company.   |
| `get_stock_fundamentals`      | This function retrieves fundamental data about a stock.          |
| `get_income_statements`       | This function retrieves income statements of a company.          |
| `get_key_financial_ratios`    | This function retrieves key financial ratios for a company.      |
| `get_analyst_recommendations` | This function retrieves analyst recommendations for a stock.     |
| `get_company_news`            | This function retrieves the latest news related to a company.    |
| `get_technical_indicators`    | This function retrieves technical indicators for stock analysis. |

You can use `include_tools` or `exclude_tools` to modify the list of tools the agent has access to. Learn more about [selecting tools](/tools/selecting-tools).

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/yfinance.py)
