FinancialDatasetsTools.
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your API keys
4
Run the example
Save the code above as
financial_datasets_tools.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Query income statements and balance sheets through the current Financial Datasets API contracts.
FinancialDatasetsTools.
get_income_statements and get_balance_sheets, which match the current Financial Datasets OpenAPI.from agno.agent import Agent
from agno.tools.financial_datasets import FinancialDatasetsTools
agent = Agent(
name="Financial Statement Agent",
tools=[
FinancialDatasetsTools(
include_tools=["get_income_statements", "get_balance_sheets"]
)
],
description="Analyze company income statements and balance sheets.",
instructions=[
"Use the financial statement tools for the requested ticker.",
"Compare important metrics across periods when relevant.",
"Format the result clearly and identify the source periods.",
],
markdown=True,
)
if __name__ == "__main__":
agent.print_response(
"Get the most recent income statement for AAPL and highlight key metrics",
stream=True,
)
agent.print_response(
"Analyze the balance sheets for MSFT over the last 3 years. "
"Focus on debt-to-equity ratio and cash position.",
stream=True,
)
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Install dependencies
uv pip install -U agno openai requests
Export your API keys
export FINANCIAL_DATASETS_API_KEY="your_financial_datasets_api_key_here"
export OPENAI_API_KEY="your_openai_api_key_here"
$Env:FINANCIAL_DATASETS_API_KEY="your_financial_datasets_api_key_here"
$Env:OPENAI_API_KEY="your_openai_api_key_here"
Run the example
financial_datasets_tools.py, then run:python financial_datasets_tools.py
Was this page helpful?